From 1129c7252ad06472add84da2c6bf326d29d81c16 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 9 Feb 2010 18:51:33 +0200 Subject: Fixed normal bug EXT-4817 - Preferences > Chat > Alert color preference is broken --HG-- branch : product-engine --- indra/llui/lluicolortable.cpp | 28 ++++++++++++++-------------- indra/llui/lluicolortable.h | 9 ++++++--- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index 9be33483d0..ac765fc9d5 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -56,7 +56,7 @@ LLUIColorTable::Params::Params() { } -void LLUIColorTable::insertFromParams(const Params& p) +void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table) { // this map will contain all color references after the following loop typedef std::map string_string_map_t; @@ -69,14 +69,7 @@ void LLUIColorTable::insertFromParams(const Params& p) ColorEntryParams color_entry = *it; if(color_entry.color.value.isChosen()) { - if(mUserSetColors.find(color_entry.name)!=mUserSetColors.end()) - { - setColor(color_entry.name, color_entry.color.value); - } - else - { - setColor(color_entry.name, color_entry.color.value, mLoadedColors); - } + setColor(color_entry.name, color_entry.color.value, table); } else { @@ -220,16 +213,16 @@ bool LLUIColorTable::loadFromSettings() bool result = false; std::string default_filename = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "colors.xml"); - result |= loadFromFilename(default_filename); + result |= loadFromFilename(default_filename, mLoadedColors); std::string current_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "colors.xml"); if(current_filename != default_filename) { - result |= loadFromFilename(current_filename); + result |= loadFromFilename(current_filename, mLoadedColors); } std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); - loadFromFilename(user_filename); + loadFromFilename(user_filename, mUserSetColors); return result; } @@ -299,7 +292,7 @@ void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, st } } -bool LLUIColorTable::loadFromFilename(const std::string& filename) +bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_map_t& table) { LLXMLNodePtr root; @@ -320,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename) if(params.validateBlock()) { - insertFromParams(params); + insertFromParams(params, table); } else { @@ -330,3 +323,10 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename) return true; } + +void LLUIColorTable::insertFromParams(const Params& p) +{ + insertFromParams(p, mUserSetColors); +} + +// EOF \ No newline at end of file diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h index c87695f456..d401e5e724 100644 --- a/indra/llui/lluicolortable.h +++ b/indra/llui/lluicolortable.h @@ -45,6 +45,10 @@ class LLUIColor; class LLUIColorTable : public LLSingleton { LOG_CLASS(LLUIColorTable); + + // consider using sorted vector, can be much faster + typedef std::map string_color_map_t; + public: struct ColorParams : LLInitParam::Choice { @@ -91,10 +95,9 @@ public: void saveUserSettings() const; private: - bool loadFromFilename(const std::string& filename); + bool loadFromFilename(const std::string& filename, string_color_map_t& table); - // consider using sorted vector, can be much faster - typedef std::map string_color_map_t; + void insertFromParams(const Params& p, string_color_map_t& table); void clearTable(string_color_map_t& table); void setColor(const std::string& name, const LLColor4& color, string_color_map_t& table); -- cgit v1.2.3 From f8aa91dccb8255356f3be60eb00e34aa6ad0a186 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 10 Feb 2010 12:10:43 +0200 Subject: Fixed function name. --HG-- branch : product-engine --- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lltexteditor.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index ad9f066539..ce5f1bd082 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -737,7 +737,7 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) } if (!LLTextBase::handleRightMouseDown(x, y, mask)) { - if(getChowContextMenu()) + if(getShowContextMenu()) { showContextMenu(x, y); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 00c6a8b68a..71d937b2c4 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -204,7 +204,7 @@ public: void getSelectedSegments(segment_vec_t& segments) const; void setShowContextMenu(bool show) { mShowContextMenu = show; } - bool getChowContextMenu() const { return mShowContextMenu; } + bool getShowContextMenu() const { return mShowContextMenu; } protected: void showContextMenu(S32 x, S32 y); -- cgit v1.2.3 From ea9185e0dcfde046232cc2ce20d34171b96e37e5 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 10 Feb 2010 13:37:49 +0200 Subject: Fixed linux build error - added skipped newline at end of file --HG-- branch : product-engine --- indra/llui/lluicolortable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index ac765fc9d5..1b64ef3abe 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -329,4 +329,5 @@ void LLUIColorTable::insertFromParams(const Params& p) insertFromParams(p, mUserSetColors); } -// EOF \ No newline at end of file +// EOF + -- cgit v1.2.3