diff options
author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-19 17:13:21 +0200 |
---|---|---|
committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-19 17:13:21 +0200 |
commit | 82de841c52357642d30b6d89b11da079f9c0f5d1 (patch) | |
tree | 8ed3ec82392b6afd2ddf2023035fdfa45cd74c0b /indra/llui/lltextbase.cpp | |
parent | 4610e911c959cdd21728822ae80b9e717ccd3012 (diff) | |
parent | 00c05a885fb1cbee967065798f57d74bf47f2478 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 14 |
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()) |