From 364bb0c13e8e7a4fffd07b63c3c61e69dfd20aa2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 21 Nov 2013 12:37:26 +0200 Subject: [PATCH] MAINT-3471 FIXED Set USER_LOCALE when updating item count. --- indra/newview/llpanelmaininventory.cpp | 13 ++++++++----- indra/newview/llpanelmaininventory.h | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 8af221e332..97a55a0429 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -864,13 +864,16 @@ void LLPanelMainInventory::draw() void LLPanelMainInventory::updateItemcountText() { - // *TODO: Calling setlocale() on each frame may be inefficient. - //LLLocale locale(LLStringUtil::getLocale()); - std::string item_count_string; - LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); + if(mItemCount != gInventory.getItemCount()) + { + mItemCount = gInventory.getItemCount(); + mItemCountString = ""; + LLLocale locale(LLLocale::USER_LOCALE); + LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount); + } LLStringUtil::format_map_t string_args; - string_args["[ITEM_COUNT]"] = item_count_string; + string_args["[ITEM_COUNT]"] = mItemCountString; string_args["[FILTER]"] = getFilterText(); std::string text = ""; diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 5887463011..c23640fe91 100755 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -147,6 +147,8 @@ private: LLSaveFolderState* mSavedFolderState; std::string mFilterText; std::string mFilterSubString; + S32 mItemCount; + std::string mItemCountString; LLTextBox* mItemcountText; // ## Zi: Filter dropdown