From 5cc44523f79b6cf495d2649fce9bf9e5181787e8 Mon Sep 17 00:00:00 2001 From: Aaron Brashears Date: Fri, 9 Feb 2007 23:35:12 +0000 Subject: Result of svn merge -r57350:57790 svn+ssh://svn/svn/linden/branches/os-patches.001 into release. --- indra/llcommon/llevent.cpp | 10 ++++------ indra/llcommon/llevent.h | 1 + indra/llcommon/llsd.cpp | 4 +++- indra/llcommon/llstring.cpp | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'indra/llcommon') 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::iterator itor; - for (itor=mListeners.begin(); itor!=mListeners.end();) + std::vector::iterator itor = mListeners.begin(); + std::vector::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 #include + +#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): -- cgit v1.2.3