From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/llui/lllineeditor.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'linden/indra/llui/lllineeditor.cpp') diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index 12d1929..a0af463 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -35,6 +35,7 @@ #include "lllineeditor.h" +#include "lltexteditor.h" #include "audioengine.h" #include "llmath.h" #include "llfontgl.h" @@ -450,19 +451,19 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL doSelectAll = TRUE; // Select the word we're on - if( isPartOfWord( wtext[mCursorPos] ) ) + if( LLTextEditor::isPartOfWord( wtext[mCursorPos] ) ) { S32 old_selection_start = mLastSelectionStart; S32 old_selection_end = mLastSelectionEnd; // Select word the cursor is over - while ((mCursorPos > 0) && isPartOfWord( wtext[mCursorPos-1] )) + while ((mCursorPos > 0) && LLTextEditor::isPartOfWord( wtext[mCursorPos-1] )) { // Find the start of the word mCursorPos--; } startSelection(); - while ((mCursorPos < (S32)wtext.length()) && isPartOfWord( wtext[mCursorPos] ) ) + while ((mCursorPos < (S32)wtext.length()) && LLTextEditor::isPartOfWord( wtext[mCursorPos] ) ) { // Find the end of the word mCursorPos++; } @@ -764,7 +765,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const { cursorPos--; } - while( (cursorPos > 0) && isPartOfWord( wtext[cursorPos-1] ) ) + while( (cursorPos > 0) && LLTextEditor::isPartOfWord( wtext[cursorPos-1] ) ) { cursorPos--; } @@ -774,7 +775,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const S32 LLLineEditor::nextWordPos(S32 cursorPos) const { const LLWString& wtext = mText.getWString(); - while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) + while( (cursorPos < getLength()) && LLTextEditor::isPartOfWord( wtext[cursorPos] ) ) { cursorPos++; } @@ -1422,7 +1423,7 @@ void LLLineEditor::draw() #else // the old programmer art. // drawing solids requires texturing be disabled { - LLGLSNoTexture no_texture; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // draw background for text if( !mReadOnly ) { @@ -1817,9 +1818,6 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) return success; } -//static -BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); } - // static BOOL LLLineEditor::postvalidateFloat(const std::string &str) { @@ -1993,7 +1991,7 @@ BOOL LLLineEditor::prevalidateAlphaNum(const LLWString &str) if(len == 0) return rv; while(len--) { - if( !isalnum(str[len]) ) + if( !LLStringOps::isAlnum((char)str[len]) ) { rv = FALSE; break; @@ -2012,7 +2010,7 @@ BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str) if(len == 0) return rv; while(len--) { - if(!(isalnum(str[len]) || (' ' == str[len]))) + if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len]))) { rv = FALSE; break; @@ -2034,7 +2032,7 @@ BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str) rv = FALSE; break; } - if(!((' ' == str[len]) || isalnum(str[len]) || ispunct(str[len]))) + if(!((' ' == str[len]) || LLStringOps::isAlnum((char)str[len]) || LLStringOps::isPunct((char)str[len]))) { rv = FALSE; break; @@ -2052,12 +2050,13 @@ BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str) if(len == 0) return rv; while(len--) { - if(iswspace(str[len])) + if(LLStringOps::isSpace(str[len])) { rv = FALSE; break; } - if( !(isalnum(str[len]) || ispunct(str[len]) ) ) + if( !(LLStringOps::isAlnum((char)str[len]) || + LLStringOps::isPunct((char)str[len]) ) ) { rv = FALSE; break; @@ -2282,7 +2281,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory } //static -void LLLineEditor::cleanupClass() +void LLLineEditor::cleanupLineEditor() { sImage = NULL; } -- cgit v1.1