summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-02-09 23:35:12 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-02-09 23:35:12 +0000
commit5cc44523f79b6cf495d2649fce9bf9e5181787e8 (patch)
treeaf7409521b24318b7c48a7434824178888c17a3e /indra/llcommon
parent0009346667872b90d39089c3800ab3e00ce73b51 (diff)
Result of svn merge -r57350:57790 svn+ssh://svn/svn/linden/branches/os-patches.001 into release.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llevent.cpp10
-rw-r--r--indra/llcommon/llevent.h1
-rw-r--r--indra/llcommon/llsd.cpp4
-rw-r--r--indra/llcommon/llstring.cpp1
4 files changed, 9 insertions, 7 deletions
diff --git a/indra/llcommon/llevent.cpp b/indra/llcommon/llevent.cpp
index 6e6fce6ec3..368159ee54 100644
--- a/indra/llcommon/llevent.cpp
+++ b/indra/llcommon/llevent.cpp
@@ -167,16 +167,14 @@ void LLSimpleDispatcher::addListener(LLEventListener* listener, LLSD filter, con
void LLSimpleDispatcher::removeListener(LLEventListener* listener)
{
- std::vector<LLListenerEntry>::iterator itor;
- for (itor=mListeners.begin(); itor!=mListeners.end();)
+ std::vector<LLListenerEntry>::iterator itor = mListeners.begin();
+ std::vector<LLListenerEntry>::iterator end = mListeners.end();
+ for (; itor != end; ++itor)
{
if ((*itor).listener == listener)
{
mListeners.erase(itor);
- }
- else
- {
- ++itor;
+ break;
}
}
listener->handleDetach(mParent);
diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h
index 4a619ba16f..283f40f923 100644
--- a/indra/llcommon/llevent.h
+++ b/indra/llcommon/llevent.h
@@ -109,6 +109,7 @@ public:
// Adds a listener to this dispatcher, with a given user data
// that will be passed to the listener when an event is fired.
+ // Duplicate pointers are removed on addtion.
void addListener(LLEventListener *listener, LLSD filter, const LLSD& userdata);
// Removes a listener from this dispatcher
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index aa4cba99d1..e5f366c4a4 100644
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -10,6 +10,8 @@
#include <sstream>
#include <math.h>
+
+#include "llerror.h"
#include "../llmath/llmath.h"
#include "llformat.h"
@@ -234,7 +236,7 @@ namespace {
public:
ImplUUID(const LLSD::UUID& v) : Base(v) { }
- virtual LLSD::String asString() const{ return mValue.getString(); }
+ virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::UUID asUUID() const { return mValue; }
};
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 50fd881ad7..767a72dfe9 100644
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -176,6 +176,7 @@ llutf16string utf8str_to_utf16str ( const LLString& utf8str )
LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len)
{
LLWString wout;
+ if((len <= 0) || utf16str.empty()) return wout;
S32 i = 0;
// craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):