summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-02-25 01:34:52 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-02-25 01:34:52 -0800
commitc6163fafaac9c72683b11894ed309d1f55a745c8 (patch)
tree612be60185cbea598bdf907f045c9fc29fb40a2c /indra/llui/lltextbase.cpp
parent0bf246ed663ad11d316fe7898a3fee3f57676d4b (diff)
parent82de841c52357642d30b6d89b11da079f9c0f5d1 (diff)
automated merge
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 5ebf49c488..17aecaf32f 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -346,7 +346,8 @@ void LLTextBase::drawSelectionBackground()
S32 segment_line_start = segmentp->getStart() + segment_offset;
S32 segment_line_end = llmin(segmentp->getEnd(), line_iter->mDocIndexEnd);
- S32 segment_width, segment_height;
+ S32 segment_width = 0;
+ S32 segment_height = 0;
// if selection after beginning of segment
if(selection_left >= segment_line_start)
@@ -433,7 +434,8 @@ void LLTextBase::drawCursor()
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection())
{
- S32 segment_width, segment_height;
+ S32 segment_width = 0;
+ S32 segment_height = 0;
segmentp->getDimensions(mCursorPos - segmentp->getStart(), 1, segment_width, segment_height);
S32 width = llmax(CURSOR_THICKNESS, segment_width);
cursor_rect.mRight = cursor_rect.mLeft + width;
@@ -2443,10 +2445,12 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)
bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
{
- height = mFontHeight;
+ height = 0;
+ width = 0;
bool force_newline = false;
if (num_chars > 0)
{
+ height = mFontHeight;
LLWString text = mEditor.getWText();
// if last character is a newline, then return true, forcing line break
llwchar last_char = text[mStart + first_char + num_chars - 1];
@@ -2461,10 +2465,6 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt
width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);
}
}
- else
- {
- width = 0;
- }
LLUIImagePtr image = mStyle->getImage();
if( image.notNull())