diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-09-12 06:27:13 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-09-12 06:27:13 +0000 |
commit | da94c0eaa2ce2711f0ae26968e87ef3e409126a9 (patch) | |
tree | e0b23896f17e0a0ea60160b2c7e39331f3cb9668 /indra/llui | |
parent | 642cdd95726755b7c24c7f2b25e2fea8e49b5b9b (diff) |
QAR-855 Viewer 1.21 RC 2
merge viewer_1-21 94770-96059 -> release
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 16 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index bf5cfd9934..0440d4c68b 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4252,26 +4252,29 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node) } /////////////////////////////////////////////////////////////////// +// Refactoring note: We may eventually want to replace this with boost::regex or +// boost::tokenizer capabilities since we've already fixed at least two JIRAs +// concerning logic issues associated with this function. S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const { std::string openers=" \t\n('\"[{<>"; std::string closers=" \t\n)'\"]}><;"; - S32 m2; - S32 retval; + S32 m2 = 0; + S32 retval = 0; if (reverse) { - for (retval=pos; retval>0; retval--) + for (retval=pos; retval >= 0; retval--) { m2 = openers.find(line.substr(retval,1)); if (m2 >= 0) { - retval++; break; } } + return retval+1; } else { @@ -4284,9 +4287,8 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) break; } } - } - - return retval; + return retval; + } } BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index f34c48b729..43898f57ef 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -134,7 +134,7 @@ void gl_state_for_2d(S32 width, S32 height) glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0.0f, window_width, 0.0f, window_height, -1.0f, 1.0f); + glOrtho(0.0f, llmax(window_width, 1.f), 0.0f, llmax(window_height,1.f), -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); stop_glerror(); |