aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lllineeditor.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp
index 9c8ee94..498ef26 100644
--- a/linden/indra/llui/lllineeditor.cpp
+++ b/linden/indra/llui/lllineeditor.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -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"
@@ -455,19 +456,19 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
455 BOOL doSelectAll = TRUE; 456 BOOL doSelectAll = TRUE;
456 457
457 // Select the word we're on 458 // Select the word we're on
458 if( isPartOfWord( wtext[mCursorPos] ) ) 459 if( LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
459 { 460 {
460 S32 old_selection_start = mLastSelectionStart; 461 S32 old_selection_start = mLastSelectionStart;
461 S32 old_selection_end = mLastSelectionEnd; 462 S32 old_selection_end = mLastSelectionEnd;
462 463
463 // Select word the cursor is over 464 // Select word the cursor is over
464 while ((mCursorPos > 0) && isPartOfWord( wtext[mCursorPos-1] )) 465 while ((mCursorPos > 0) && LLTextEditor::isPartOfWord( wtext[mCursorPos-1] ))
465 { // Find the start of the word 466 { // Find the start of the word
466 mCursorPos--; 467 mCursorPos--;
467 } 468 }
468 startSelection(); 469 startSelection();
469 470
470 while ((mCursorPos < (S32)wtext.length()) && isPartOfWord( wtext[mCursorPos] ) ) 471 while ((mCursorPos < (S32)wtext.length()) && LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
471 { // Find the end of the word 472 { // Find the end of the word
472 mCursorPos++; 473 mCursorPos++;
473 } 474 }
@@ -769,7 +770,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
769 { 770 {
770 cursorPos--; 771 cursorPos--;
771 } 772 }
772 while( (cursorPos > 0) && isPartOfWord( wtext[cursorPos-1] ) ) 773 while( (cursorPos > 0) && LLTextEditor::isPartOfWord( wtext[cursorPos-1] ) )
773 { 774 {
774 cursorPos--; 775 cursorPos--;
775 } 776 }
@@ -779,7 +780,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
779S32 LLLineEditor::nextWordPos(S32 cursorPos) const 780S32 LLLineEditor::nextWordPos(S32 cursorPos) const
780{ 781{
781 const LLWString& wtext = mText.getWString(); 782 const LLWString& wtext = mText.getWString();
782 while( (cursorPos < getLength()) && isPartOfWord( wtext[cursorPos] ) ) 783 while( (cursorPos < getLength()) && LLTextEditor::isPartOfWord( wtext[cursorPos] ) )
783 { 784 {
784 cursorPos++; 785 cursorPos++;
785 } 786 }
@@ -1427,7 +1428,7 @@ void LLLineEditor::draw()
1427#else // the old programmer art. 1428#else // the old programmer art.
1428 // drawing solids requires texturing be disabled 1429 // drawing solids requires texturing be disabled
1429 { 1430 {
1430 LLGLSNoTexture no_texture; 1431 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1431 // draw background for text 1432 // draw background for text
1432 if( !mReadOnly ) 1433 if( !mReadOnly )
1433 { 1434 {
@@ -1822,9 +1823,6 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str)
1822 return success; 1823 return success;
1823} 1824}
1824 1825
1825//static
1826BOOL LLLineEditor::isPartOfWord(llwchar c) { return (c == '_') || isalnum(c); }
1827
1828// static 1826// static
1829BOOL LLLineEditor::postvalidateFloat(const std::string &str) 1827BOOL LLLineEditor::postvalidateFloat(const std::string &str)
1830{ 1828{
@@ -1998,7 +1996,7 @@ BOOL LLLineEditor::prevalidateAlphaNum(const LLWString &str)
1998 if(len == 0) return rv; 1996 if(len == 0) return rv;
1999 while(len--) 1997 while(len--)
2000 { 1998 {
2001 if( !isalnum(str[len]) ) 1999 if( !LLStringOps::isAlnum((char)str[len]) )
2002 { 2000 {
2003 rv = FALSE; 2001 rv = FALSE;
2004 break; 2002 break;
@@ -2017,7 +2015,7 @@ BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str)
2017 if(len == 0) return rv; 2015 if(len == 0) return rv;
2018 while(len--) 2016 while(len--)
2019 { 2017 {
2020 if(!(isalnum(str[len]) || (' ' == str[len]))) 2018 if(!(LLStringOps::isAlnum((char)str[len]) || (' ' == str[len])))
2021 { 2019 {
2022 rv = FALSE; 2020 rv = FALSE;
2023 break; 2021 break;
@@ -2039,7 +2037,7 @@ BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str)
2039 rv = FALSE; 2037 rv = FALSE;
2040 break; 2038 break;
2041 } 2039 }
2042 if(!((' ' == str[len]) || isalnum(str[len]) || ispunct(str[len]))) 2040 if(!((' ' == str[len]) || LLStringOps::isAlnum((char)str[len]) || LLStringOps::isPunct((char)str[len])))
2043 { 2041 {
2044 rv = FALSE; 2042 rv = FALSE;
2045 break; 2043 break;
@@ -2057,12 +2055,13 @@ BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str)
2057 if(len == 0) return rv; 2055 if(len == 0) return rv;
2058 while(len--) 2056 while(len--)
2059 { 2057 {
2060 if(iswspace(str[len])) 2058 if(LLStringOps::isSpace(str[len]))
2061 { 2059 {
2062 rv = FALSE; 2060 rv = FALSE;
2063 break; 2061 break;
2064 } 2062 }
2065 if( !(isalnum(str[len]) || ispunct(str[len]) ) ) 2063 if( !(LLStringOps::isAlnum((char)str[len]) ||
2064 LLStringOps::isPunct((char)str[len]) ) )
2066 { 2065 {
2067 rv = FALSE; 2066 rv = FALSE;
2068 break; 2067 break;
@@ -2313,7 +2312,7 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
2313} 2312}
2314 2313
2315//static 2314//static
2316void LLLineEditor::cleanupClass() 2315void LLLineEditor::cleanupLineEditor()
2317{ 2316{
2318 sImage = NULL; 2317 sImage = NULL;
2319} 2318}