aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-01 17:39:58 -0600
committerJacek Antonelli2008-12-01 17:40:06 -0600
commit7abecb48babe6a6f09bf6692ba55076546cfced9 (patch)
tree8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/llui/lllineeditor.cpp
parentSecond Life viewer sources 1.21.6 (diff)
downloadmeta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2
meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz
Second Life viewer sources 1.22.0-RC
Diffstat (limited to 'linden/indra/llui/lllineeditor.cpp')
-rw-r--r--linden/indra/llui/lllineeditor.cpp29
1 files changed, 14 insertions, 15 deletions
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 @@
35 35
36#include "lllineeditor.h" 36#include "lllineeditor.h"
37 37
38#include "lltexteditor.h"
38#include "audioengine.h" 39#include "audioengine.h"
39#include "llmath.h" 40#include "llmath.h"
40#include "llfontgl.h" 41#include "llfontgl.h"
@@ -450,19 +451,19 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
450 BOOL doSelectAll = TRUE; 451 BOOL doSelectAll = TRUE;
451 452
452 // Select the word we're on 453 // Select the word we're on
453 if( isPartOfWord( wtext[mCursorPos] ) ) 454 if( LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
454 { 455 {
455 S32 old_selection_start = mLastSelectionStart; 456 S32 old_selection_start = mLastSelectionStart;
456 S32 old_selection_end = mLastSelectionEnd; 457 S32 old_selection_end = mLastSelectionEnd;
457 458
458 // Select word the cursor is over 459 // Select word the cursor is over
459 while ((mCursorPos > 0) && isPartOfWord( wtext[mCursorPos-1] )) 460 while ((mCursorPos > 0) && LLTextEditor::isPartOfWord( wtext[mCursorPos-1] ))
460 { // Find the start of the word 461 { // Find the start of the word
461 mCursorPos--; 462 mCursorPos--;
462 } 463 }
463 startSelection(); 464 startSelection();
464 465
465 while ((mCursorPos < (S32)wtext.length()) && isPartOfWord( wtext[mCursorPos] ) ) 466 while ((mCursorPos < (S32)wtext.length()) && LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
466 { // Find the end of the word 467 { // Find the end of the word
467 mCursorPos++; 468 mCursorPos++;
468 } 469 }
@@ -764,7 +765,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
764 { 765 {
765 cursorPos--; 766 cursorPos--;
766 } 767 }
767 while( (cursorPos > 0) && isPartOfWord( wtext[cursorPos-1] ) ) 768 while( (cursorPos > 0) && LLTextEditor::isPartOfWord( wtext[cursorPos-1] ) )
768 { 769 {
769 cursorPos--; 770 cursorPos--;
770 } 771 }
@@ -774,7 +775,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
774S32 LLLineEditor::nextWordPos(S32 cursorPos) const 775S32 LLLineEditor::nextWordPos(S32 cursorPos) const
775{ 776{
776 const LLWString& wtext = mText.getWString(); 777 const LLWString& wtext = mText.getWString();
777 while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) 778 while( (cursorPos < getLength()) && LLTextEditor::isPartOfWord( wtext[cursorPos] ) )
778 { 779 {
779 cursorPos++; 780 cursorPos++;
780 } 781 }
@@ -1422,7 +1423,7 @@ void LLLineEditor::draw()
1422#else // the old programmer art. 1423#else // the old programmer art.
1423 // drawing solids requires texturing be disabled 1424 // drawing solids requires texturing be disabled
1424 { 1425 {
1425 LLGLSNoTexture no_texture; 1426 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1426 // draw background for text 1427 // draw background for text
1427 if( !mReadOnly ) 1428 if( !mReadOnly )
1428 { 1429 {
@@ -1817,9 +1818,6 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str)
1817 return success; 1818 return success;
1818} 1819}
1819 1820
1820//static
1821BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); }
1822
1823// static 1821// static
1824BOOL LLLineEditor::postvalidateFloat(const std::string &str) 1822BOOL LLLineEditor::postvalidateFloat(const std::string &str)
1825{ 1823{
@@ -1993,7 +1991,7 @@ BOOL LLLineEditor::prevalidateAlphaNum(const LLWString &str)
1993 if(len == 0) return rv; 1991 if(len == 0) return rv;
1994 while(len--) 1992 while(len--)
1995 { 1993 {
1996 if( !isalnum(str[len]) ) 1994 if( !LLStringOps::isAlnum((char)str[len]) )
1997 { 1995 {
1998 rv = FALSE; 1996 rv = FALSE;
1999 break; 1997 break;
@@ -2012,7 +2010,7 @@ BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str)
2012 if(len == 0) return rv; 2010 if(len == 0) return rv;
2013 while(len--) 2011 while(len--)
2014 { 2012 {
2015 if(!(isalnum(str[len]) || (' ' == str[len]))) 2013 if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len])))
2016 { 2014 {
2017 rv = FALSE; 2015 rv = FALSE;
2018 break; 2016 break;
@@ -2034,7 +2032,7 @@ BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str)
2034 rv = FALSE; 2032 rv = FALSE;
2035 break; 2033 break;
2036 } 2034 }
2037 if(!((' ' == str[len]) || isalnum(str[len]) || ispunct(str[len]))) 2035 if(!((' ' == str[len]) || LLStringOps::isAlnum((char)str[len]) || LLStringOps::isPunct((char)str[len])))
2038 { 2036 {
2039 rv = FALSE; 2037 rv = FALSE;
2040 break; 2038 break;
@@ -2052,12 +2050,13 @@ BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str)
2052 if(len == 0) return rv; 2050 if(len == 0) return rv;
2053 while(len--) 2051 while(len--)
2054 { 2052 {
2055 if(iswspace(str[len])) 2053 if(LLStringOps::isSpace(str[len]))
2056 { 2054 {
2057 rv = FALSE; 2055 rv = FALSE;
2058 break; 2056 break;
2059 } 2057 }
2060 if( !(isalnum(str[len]) || ispunct(str[len]) ) ) 2058 if( !(LLStringOps::isAlnum((char)str[len]) ||
2059 LLStringOps::isPunct((char)str[len]) ) )
2061 { 2060 {
2062 rv = FALSE; 2061 rv = FALSE;
2063 break; 2062 break;
@@ -2282,7 +2281,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
2282} 2281}
2283 2282
2284//static 2283//static
2285void LLLineEditor::cleanupClass() 2284void LLLineEditor::cleanupLineEditor()
2286{ 2285{
2287 sImage = NULL; 2286 sImage = NULL;
2288} 2287}