summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorrichard <none@none>2010-01-15 13:19:02 -0800
committerrichard <none@none>2010-01-15 13:19:02 -0800
commitd0458d8e2d73804786467ad226b5102a1855772a (patch)
tree7adbb29ed96a3054f4e265ff685ab0025c676e1e /indra/llui
parent7efc0fbb4fd912d59a38a4d5653f1dc12c3876b1 (diff)
parent4c4c68a3408c85e49d365c31be93e006be612ab1 (diff)
merge
Diffstat (limited to 'indra/llui')
-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())