diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 52aa069aaa4cd3eab1768796a08e6dbc8982dc0d..c15b8b51a3df1df64b414afe1a7b8ae15312e0f5 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2302,7 +2302,7 @@ BOOL LLLineEditor::postvalidateFloat(const std::string &str) } // May be a comma or period, depending on the locale - llwchar decimal_point = (llwchar)LLResMgr::getInstanceFast()->getDecimalPoint(); + llwchar decimal_point = (llwchar)LLResMgr::getDecimalPoint(); for( ; i < len; i++ ) { diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 8a3afc825977554481fc2030e313dc1d8f4eff34..80952fcb49cf540d65f2d60ad2d0193370f7449e 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -47,7 +47,7 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) mLocale = locale_id; } -char LLResMgr::getDecimalPoint() const +char LLResMgr::getDecimalPoint() { char decimal = localeconv()->decimal_point[0]; @@ -62,7 +62,7 @@ char LLResMgr::getDecimalPoint() const return decimal; } -char LLResMgr::getThousandsSeparator() const +char LLResMgr::getThousandsSeparator() { char separator = localeconv()->thousands_sep[0]; @@ -77,7 +77,7 @@ char LLResMgr::getThousandsSeparator() const return separator; } -char LLResMgr::getMonetaryDecimalPoint() const +char LLResMgr::getMonetaryDecimalPoint() { char decimal = localeconv()->mon_decimal_point[0]; @@ -92,7 +92,7 @@ char LLResMgr::getMonetaryDecimalPoint() const return decimal; } -char LLResMgr::getMonetaryThousandsSeparator() const +char LLResMgr::getMonetaryThousandsSeparator() { char separator = localeconv()->mon_thousands_sep[0]; @@ -109,36 +109,13 @@ char LLResMgr::getMonetaryThousandsSeparator() const // Sets output to a string of integers with monetary separators inserted according to the locale. -std::string LLResMgr::getMonetaryString( S32 input ) const +std::string LLResMgr::getMonetaryString( S32 input ) { std::string output; LLLocale locale(LLLocale::USER_LOCALE); struct lconv *conv = localeconv(); -#if LL_DARWIN - // On the Mac, locale support is broken before 10.4, which causes things to go all pear-shaped. - // Fake up a conv structure with some reasonable values for the fields this function uses. - struct lconv fakeconv; - char fake_neg[2] = "-"; - char fake_mon_group[4] = "\x03\x03\x00"; // commas every 3 digits - if(conv->negative_sign[0] == 0) // Real locales all seem to have something here... - { - fakeconv = *conv; // start with what's there. - switch(mLocale) - { - default: // Unknown -- use the US defaults. - case LLLOCALE_USA: - case LLLOCALE_UK: // UK ends up being the same as US for the items used here. - fakeconv.negative_sign = fake_neg; - fakeconv.mon_grouping = fake_mon_group; - fakeconv.n_sign_posn = 1; // negative sign before the string - break; - } - conv = &fakeconv; - } -#endif - char* negative_sign = conv->negative_sign; char separator = getMonetaryThousandsSeparator(); char* grouping = conv->mon_grouping; @@ -244,7 +221,7 @@ std::string LLResMgr::getMonetaryString( S32 input ) const return output; } -void LLResMgr::getIntegerString( std::string& output, S32 input ) const +void LLResMgr::getIntegerString( std::string& output, S32 input ) { // handle special case of input value being zero if (input == 0) diff --git a/indra/llui/llresmgr.h b/indra/llui/llresmgr.h index 8f14d9f687cfa8d62f25f7b15c107c22135fdf2d..e0f51ee46d18657268c6605ce9f26bf0cc791130 100644 --- a/indra/llui/llresmgr.h +++ b/indra/llui/llresmgr.h @@ -48,13 +48,13 @@ class LLResMgr final : public LLSingleton<LLResMgr> void setLocale( LLLOCALE_ID locale_id ); LLLOCALE_ID getLocale() const { return mLocale; } - char getDecimalPoint() const; - char getThousandsSeparator() const; + static char getDecimalPoint(); + static char getThousandsSeparator(); - char getMonetaryDecimalPoint() const; - char getMonetaryThousandsSeparator() const; - std::string getMonetaryString( S32 input ) const; - void getIntegerString( std::string& output, S32 input ) const; + static char getMonetaryDecimalPoint(); + static char getMonetaryThousandsSeparator(); + static std::string getMonetaryString( S32 input ); + static void getIntegerString( std::string& output, S32 input ); private: diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index 1721aa3919f5aef1facd12189d6a70c08f1931ee..fc972f97e84b62155219d5e620c608f72dd69b52 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -62,7 +62,7 @@ namespace LLTextValidate if( 0 < len ) { // May be a comma or period, depending on the locale - llwchar decimal_point = (llwchar)LLResMgr::getInstanceFast()->getDecimalPoint(); + llwchar decimal_point = (llwchar)LLResMgr::getDecimalPoint(); S32 i = 0; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index c85a71364e97d050ba28de803adeab873388cac0..102e108f5c214cd4c6c64d19f3df42a068b3a706 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -831,7 +831,7 @@ void LLPanelLandGeneral::refresh() } S32 price = parcel->getSalePrice(); - mSaleInfoForSale1->setTextArg("[PRICE]", LLResMgr::getInstance()->getMonetaryString(price)); + mSaleInfoForSale1->setTextArg("[PRICE]", LLResMgr::getMonetaryString(price)); mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); if (can_be_sold) { diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index c43526acaf071803b4e13a902b19539fe356b574..69c30cd8f4b150e24e3ead3303d96a655e749751 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -207,7 +207,7 @@ void LLFloaterMemLeak::draw() if(sTotalLeaked > 0) { std::string bytes_string; - LLResMgr::getInstance()->getIntegerString(bytes_string, sTotalLeaked >> 10 ); + LLResMgr::getIntegerString(bytes_string, sTotalLeaked >> 10 ); getChild<LLUICtrl>("total_leaked_label")->setTextArg("[SIZE]", bytes_string); } else diff --git a/indra/newview/llfloateroutfitsnapshot.cpp b/indra/newview/llfloateroutfitsnapshot.cpp index ad5e97e0677c7afea40fac8361fc727918b6ca0d..06709922c6623f35cca0b70812e7a4feaaf52b81 100644 --- a/indra/newview/llfloateroutfitsnapshot.cpp +++ b/indra/newview/llfloateroutfitsnapshot.cpp @@ -104,7 +104,7 @@ void LLFloaterOutfitSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floate std::string bytes_string; if (got_snap) { - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10); + LLResMgr::getIntegerString(bytes_string, (previewp->getDataSize()) >> 10); } // Update displayed image resolution. diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 5cf16f3ad6d821984fd66cd5c71791acafadf391..294c3d815948074d55ece002042ed5070a2e6483 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -756,10 +756,10 @@ void LLFloaterPathfindingObjects::updateMessagingStatus() LLLocale locale(LLStringUtil::getLocale()); std::string numItemsString; - LLResMgr::getInstance()->getIntegerString(numItemsString, numItems); + LLResMgr::getIntegerString(numItemsString, numItems); std::string numSelectedItemsString; - LLResMgr::getInstance()->getIntegerString(numSelectedItemsString, numSelectedItems); + LLResMgr::getIntegerString(numSelectedItemsString, numSelectedItems); LLStringUtil::format_map_t string_args; string_args["[NUM_SELECTED]"] = numSelectedItemsString; diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 835cfba9856ec59e1bf2c5bd89321a1f4974a75d..8855bbc9c609e1f30b9122512d23b643969c3667 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -278,7 +278,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) if (pay_button > 0) { std::string button_str = "L$"; - button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); + button_str += LLResMgr::getMonetaryString( pay_button ); self->mQuickPayButton[i]->setLabelSelected(button_str); self->mQuickPayButton[i]->setLabelUnselected(button_str); @@ -298,7 +298,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) // build a string containing the maximum value and calc nerw button width from it. std::string balance_str = "L$"; - balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); + balance_str += LLResMgr::getMonetaryString( max_pay_amount ); const LLFontGL* font = LLFontGL::getFontSansSerif(); S32 new_button_width = font->getWidth( std::string(balance_str)); new_button_width += ( 12 + 12 ); // padding diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index cde499937c1c146ecbff7685539d706a4e165500..28229b41b02d0f0cbdc6380a398be1f77634c39a 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -327,7 +327,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) std::string bytes_string; if (got_snap) { - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + LLResMgr::getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); } // Update displayed image resolution. diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 9885de43d88f185af706801a723573613dc38436..dbf3b1b3972a6e15b9608d4a51b665e8e728bbd3 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -519,7 +519,7 @@ void LLFloaterTools::refresh() index++; if (selected_child->isSelected()) { - LLResMgr::getInstance()->getIntegerString(num_string, index); + LLResMgr::getIntegerString(num_string, index); break; } } @@ -537,10 +537,10 @@ void LLFloaterTools::refresh() if (!gMeshRepo.meshRezEnabled()) { std::string obj_count_string; - LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); + LLResMgr::getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); getChild<LLUICtrl>("selection_count")->setTextArg("[OBJ_COUNT]", obj_count_string); std::string prim_count_string; - LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); + LLResMgr::getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); getChild<LLUICtrl>("selection_count")->setTextArg("[PRIM_COUNT]", prim_count_string); // calculate selection rendering cost @@ -548,7 +548,7 @@ void LLFloaterTools::refresh() { std::string prim_cost_string; S32 render_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectRenderCost(); - LLResMgr::getInstance()->getIntegerString(prim_cost_string, render_cost); + LLResMgr::getIntegerString(prim_cost_string, render_cost); } // disable the object and prim counts if nothing selected diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 0a30ab92177a34eaec44f02850f8485f5a7f926e..004998b90d86d11ffb92e7ad63a37cc05ba83bbe 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -240,7 +240,7 @@ void LLInspectGroup::processGroupData() else { std::string amount = - LLResMgr::getInstance()->getMonetaryString( + LLResMgr::getMonetaryString( data->mMembershipFee); LLStringUtil::format_map_t args; args["[AMOUNT]"] = amount; diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index e8da861e064d4a21b9463005dcfa7254fd6b169c..67841d991a8441ca882c9c5f8ea901ef042625d6 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -550,7 +550,7 @@ void LLInspectObject::updatePrice(LLSelectNode* nodep) else if (for_sale) { LLStringUtil::format_map_t args; - args["[AMOUNT]"] = LLResMgr::getInstance()->getMonetaryString(price); + args["[AMOUNT]"] = LLResMgr::getMonetaryString(price); line = getString("Price", args); show_price_icon = true; } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 0a237a838a380fc318acdb53eb13ce8cdc6b9315..632754f022bff36a66a00b60c7f9e84577a501c8 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -576,7 +576,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string if (fractional_portion != 0) { - fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); + fraction_string = llformat("%c%02d%s", LLResMgr::getDecimalPoint(), fractional_portion, suffix.c_str()); hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, 1.f, 3.f, color, hud_selection); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2ab20033bd120243c927ef87251b4768adbff156..3435205aaf7ce21c96c1da3a890ff0c902285f20 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -732,7 +732,7 @@ void LLPanelMainInventory::updateItemcountText() mItemCount = gInventory.getItemCount(); mItemCountString = ""; LLLocale locale(LLLocale::USER_LOCALE); - LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount); + LLResMgr::getIntegerString(mItemCountString, mItemCount); } if(mCategoryCount != gInventory.getCategoryCount()) @@ -740,7 +740,7 @@ void LLPanelMainInventory::updateItemcountText() mCategoryCount = gInventory.getCategoryCount(); mCategoryCountString = ""; LLLocale locale(LLLocale::USER_LOCALE); - LLResMgr::getInstance()->getIntegerString(mCategoryCountString, mCategoryCount); + LLResMgr::getIntegerString(mCategoryCountString, mCategoryCount); } LLStringUtil::format_map_t string_args; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index ce465aff76a8a57b3b4e7d26f513756e8e83cadc..582999969846633cd4cdb51693af684b903121f0 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -414,7 +414,7 @@ void LLStatusBar::setBalance(S32 balance) LLFirstUse::receiveLindens(); } - std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); + std::string money_str = LLResMgr::getMonetaryString( balance ); LLStringUtil::format_map_t string_args; string_args["[AMT]"] = llformat("%s", money_str.c_str()); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c6902f9b6920285caef7f5c7fdccfc2a472201c4..5bc9b0241934315cde7fa3803f4d0b77278bdbe4 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1132,7 +1132,7 @@ BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg) { LLStringUtil::format_map_t args; S32 price = hover_parcel->getSalePrice(); - args["[AMOUNT]"] = LLResMgr::getInstance()->getMonetaryString(price); + args["[AMOUNT]"] = LLResMgr::getMonetaryString(price); line = LLTrans::getString("TooltipForSaleL$", args); tooltip_msg.append(line); tooltip_msg.push_back('\n'); @@ -1252,7 +1252,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l { static LLUIString tooltip_price = LLTrans::getString("TooltipPrice"); S32 price = nodep->mSaleInfo.getSalePrice(); - tooltip_price.setArg("[AMOUNT]", LLResMgr::getInstance()->getMonetaryString(price)); + tooltip_price.setArg("[AMOUNT]", LLResMgr::getMonetaryString(price)); tooltip_msg.append(tooltip_price.getString()); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3ffc87fc80be8c7d97f58be212d1e92b2e08353f..967a675f616bc8cc47cb7b3a4ef3ffa6fcea373d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4894,11 +4894,11 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save args["PATH"] = lastSnapshotDir; std::string needM_bytes_string; - LLResMgr::getInstance()->getIntegerString(needM_bytes_string, (image->getDataSize()) >> 10); + LLResMgr::getIntegerString(needM_bytes_string, (image->getDataSize()) >> 10); args["NEED_MEMORY"] = needM_bytes_string; std::string freeM_bytes_string; - LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); + LLResMgr::getIntegerString(freeM_bytes_string, (b_space.free) >> 10); args["FREE_MEMORY"] = freeM_bytes_string; LLNotificationsUtil::add("SnapshotToComputerFailed", args);