aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstatbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llstatbar.cpp')
-rw-r--r--linden/indra/newview/llstatbar.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/linden/indra/newview/llstatbar.cpp b/linden/indra/newview/llstatbar.cpp
index 13b8358..19a9442 100644
--- a/linden/indra/newview/llstatbar.cpp
+++ b/linden/indra/newview/llstatbar.cpp
@@ -137,17 +137,17 @@ void LLStatBar::draw()
137 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), 137 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
138 LLFontGL::LEFT, LLFontGL::TOP); 138 LLFontGL::LEFT, LLFontGL::TOP);
139 139
140 char value_format[64]; /* Flawfinder: ignore */ 140 std::string value_format;
141 char value_str[256]; /* Flawfinder: ignore */ 141 std::string value_str;
142 if (!mUnitLabel.empty()) 142 if (!mUnitLabel.empty())
143 { 143 {
144 snprintf(value_format, sizeof(value_format), "%%.%df%%s", mPrecision); /* Flawfinder: ignore */ 144 value_format = llformat( "%%.%df%%s", mPrecision);
145 snprintf(value_str, sizeof(value_str), value_format, mValue, mUnitLabel.c_str()); /* Flawfinder: ignore */ 145 value_str = llformat( value_format.c_str(), mValue, mUnitLabel.c_str());
146 } 146 }
147 else 147 else
148 { 148 {
149 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */ 149 value_format = llformat( "%%.%df", mPrecision);
150 snprintf(value_str, sizeof(value_str), value_format, mValue); /* Flawfinder: ignore */ 150 value_str = llformat( value_format.c_str(), mValue);
151 } 151 }
152 152
153 // Draw the value. 153 // Draw the value.
@@ -155,10 +155,10 @@ void LLStatBar::draw()
155 LLColor4(1.f, 1.f, 1.f, 0.5f), 155 LLColor4(1.f, 1.f, 1.f, 0.5f),
156 LLFontGL::RIGHT, LLFontGL::TOP); 156 LLFontGL::RIGHT, LLFontGL::TOP);
157 157
158 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */ 158 value_format = llformat( "%%.%df", mPrecision);
159 if (mDisplayBar) 159 if (mDisplayBar)
160 { 160 {
161 char tick_label[256]; /* Flawfinder: ignore */ 161 std::string tick_label;
162 162
163 // Draw the tick marks. 163 // Draw the tick marks.
164 F32 tick_value; 164 F32 tick_value;
@@ -182,7 +182,7 @@ void LLStatBar::draw()
182 right = left + tick_width; 182 right = left + tick_width;
183 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); 183 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
184 184
185 snprintf(tick_label, sizeof(tick_label), value_format, tick_value); /* Flawfinder: ignore */ 185 tick_label = llformat( value_format.c_str(), tick_value);
186 // draw labels for the tick marks 186 // draw labels for the tick marks
187 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height, 187 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height,
188 LLColor4(1.f, 1.f, 1.f, 0.5f), 188 LLColor4(1.f, 1.f, 1.f, 0.5f),
@@ -258,17 +258,17 @@ void LLStatBar::draw()
258 LLView::draw(); 258 LLView::draw();
259} 259}
260 260
261const LLString& LLStatBar::getLabel() const 261const std::string& LLStatBar::getLabel() const
262{ 262{
263 return mLabel; 263 return mLabel;
264} 264}
265 265
266void LLStatBar::setLabel(const LLString& label) 266void LLStatBar::setLabel(const std::string& label)
267{ 267{
268 mLabel = label; 268 mLabel = label;
269} 269}
270 270
271void LLStatBar::setUnitLabel(const LLString& unit_label) 271void LLStatBar::setUnitLabel(const std::string& unit_label)
272{ 272{
273 mUnitLabel = unit_label; 273 mUnitLabel = unit_label;
274} 274}