diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index cbb6e85b96af1138fc4a06f2f46119aa244e147a..500a04f89eb8ada36cfeb651904fb5994531ae66 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -36,6 +36,8 @@ #include "lltrans.h" #include "llgltexture.h" +#include <absl/strings/str_format.h> + // Timers to temporise database requests const F32 AGENTS_UPDATE_TIMER = 60.0; // Seconds between 2 agent requests for a region const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // Seconds before we consider re-requesting item data for the grid @@ -521,17 +523,18 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& { static LLUIString tooltip_fmt = LLTrans::getString("worldmap_item_tooltip_format"); - tooltip_fmt.setArg("[AREA]", llformat("%d", extra)); - tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2)); + tooltip_fmt.setArg("[AREA]", absl::StrCat(extra)); + tooltip_fmt.setArg("[PRICE]", absl::StrCat(extra2)); // Check for division by zero if (extra != 0) { - tooltip_fmt.setArg("[SQMPRICE]", llformat("%.1f", (F32)extra2 / (F32)extra)); + tooltip_fmt.setArg("[SQMPRICE]", absl::StrFormat("%.1f", (F32)extra2 / (F32)extra)); } else { - tooltip_fmt.setArg("[SQMPRICE]", LLTrans::getString("Unknown")); + static LLUIString unknown_str = LLTrans::getString("Unknown"); + tooltip_fmt.setArg("[SQMPRICE]", unknown_str); } new_item.setTooltip(tooltip_fmt.getString()); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 4c6a37a46d69ba493176f6ad8440ec5914df7304..2b1bdcc39dc6db4e93a31a7234adc7cbf3af8566 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -62,6 +62,8 @@ #include "llglheaders.h" +#include "absl/strings/str_format.h" + // Basically a C++ implementation of the OCEAN_COLOR defined in mapstitcher.py // Please ensure consistency between those 2 files (TODO: would be better to get that color from an asset source...) // # Constants @@ -457,7 +459,7 @@ void LLWorldMapView::draw() std::string mesg; if (info->isDown()) { - mesg = llformat( "%s (%s) (%s)", info->getName().c_str(), sStringsMap["offline"].c_str(), info->getShortAccessString().c_str()); + mesg = absl::StrFormat( "%s (%s) (%s)", info->getName(), sStringsMap["offline"], info->getShortAccessString()); } else if (mapShowAgentCount) { @@ -469,12 +471,12 @@ void LLWorldMapView::draw() } if (agent_count > 0) { - mesg = llformat( "%s (%d) (%s)", info->getName().c_str(), agent_count, info->getShortAccessString().c_str()); + mesg = absl::StrFormat( "%s (%d) (%s)", info->getName(), agent_count, info->getShortAccessString()); } } if (mesg.empty()) { - mesg = llformat( "%s (%s)", info->getName().c_str(), info->getShortAccessString().c_str()); + mesg = absl::StrFormat( "%s (%s)", info->getName(), info->getShortAccessString()); } // if (!mesg.empty()) @@ -1083,11 +1085,11 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask ) LLViewerRegion *region = gAgent.getRegion(); // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.4.5) | Modified: RLVa-1.4.5 - std::string message = llformat("%s (%s)", - (RlvActions::canShowLocation()) ? info->getName().c_str() : RlvStrings::getString(RlvStringKeys::Hidden::Region).c_str(), - info->getAccessString().c_str()); + std::string message = absl::StrFormat("%s (%s)", + (RlvActions::canShowLocation()) ? info->getName() : RlvStrings::getString(RlvStringKeys::Hidden::Region), + info->getAccessString()); // [/RLVa:KB] -// std::string message = llformat("%s (%s)", info->getName().c_str(), info->getAccessString().c_str()); +// std::string message = absl::StrFormat("%s (%s)", info->getName(), info->getAccessString()); if (!info->isDown()) { @@ -1102,20 +1104,19 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask ) if (agent_count > 0) { LLStringUtil::format_map_t string_args; - string_args["[NUMBER]"] = llformat("%d", agent_count); - message += '\n'; - message += getString((agent_count == 1 ? "world_map_person" : "world_map_people") , string_args); + string_args["[NUMBER]"] = absl::StrCat(agent_count); + absl::StrAppend(&message, "\n", + getString((agent_count == 1 ? "world_map_person" : "world_map_people") , string_args)); } } - tooltip_msg.assign( message ); + tooltip_msg = std::move(message); // do not use message after this point // Optionally show region flags std::string region_flags = info->getFlagsString(); if (!region_flags.empty()) { - tooltip_msg += '\n'; - tooltip_msg += region_flags; + absl::StrAppend(&tooltip_msg, "\n", region_flags); } const S32 SLOP = 9; diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index a2e519a61aa14057f5f29c24df900fc5e5fc76bb..f94ae80479ce4af7b197bfb81fbefdf40a27caeb 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -32,6 +32,8 @@ #include "llviewertexturelist.h" #include "math.h" // log() +#include "absl/strings/str_format.h" + // Turn this on to output tile stats in the standard output #define DEBUG_TILES_STAT 0 @@ -181,7 +183,7 @@ LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level) { // Get the grid coordinates - std::string imageurl = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); + std::string imageurl = absl::StrCat(gSavedSettings.getString("CurrentMapServerURL"), absl::StrFormat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y)); // DO NOT COMMIT!! DEBUG ONLY!!! // Use a local jpeg for every tile to test map speed without S3 access