aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/lltexteditor.cpp')
-rw-r--r--linden/indra/llui/lltexteditor.cpp51
1 files changed, 25 insertions, 26 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index 513670b..f49b2db 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -103,9 +103,9 @@ BOOL LLTextCmd::hasExtCharValue( llwchar value )
103} 103}
104 104
105// Utility funcs 105// Utility funcs
106S32 LLTextCmd::insert(LLTextEditor* editor, S32 pos, const LLWString &utf8str) 106S32 LLTextCmd::insert(LLTextEditor* editor, S32 pos, const LLWString &wstr)
107{ 107{
108 return editor->insertStringNoUndo( pos, utf8str ); 108 return editor->insertStringNoUndo( pos, wstr );
109} 109}
110S32 LLTextCmd::remove(LLTextEditor* editor, S32 pos, S32 length) 110S32 LLTextCmd::remove(LLTextEditor* editor, S32 pos, S32 length)
111{ 111{
@@ -122,29 +122,29 @@ class LLTextCmdInsert : public LLTextCmd
122{ 122{
123public: 123public:
124 LLTextCmdInsert(S32 pos, BOOL group_with_next, const LLWString &ws) 124 LLTextCmdInsert(S32 pos, BOOL group_with_next, const LLWString &ws)
125 : LLTextCmd(pos, group_with_next), mString(ws) 125 : LLTextCmd(pos, group_with_next), mWString(ws)
126 { 126 {
127 } 127 }
128 virtual BOOL execute( LLTextEditor* editor, S32* delta ) 128 virtual BOOL execute( LLTextEditor* editor, S32* delta )
129 { 129 {
130 *delta = insert(editor, mPos, mString ); 130 *delta = insert(editor, mPos, mWString );
131 LLWString::truncate(mString, *delta); 131 LLWString::truncate(mWString, *delta);
132 //mString = wstring_truncate(mString, *delta); 132 //mWString = wstring_truncate(mWString, *delta);
133 return (*delta != 0); 133 return (*delta != 0);
134 } 134 }
135 virtual S32 undo( LLTextEditor* editor ) 135 virtual S32 undo( LLTextEditor* editor )
136 { 136 {
137 remove(editor, mPos, mString.length() ); 137 remove(editor, mPos, mWString.length() );
138 return mPos; 138 return mPos;
139 } 139 }
140 virtual S32 redo( LLTextEditor* editor ) 140 virtual S32 redo( LLTextEditor* editor )
141 { 141 {
142 insert(editor, mPos, mString ); 142 insert(editor, mPos, mWString );
143 return mPos + mString.length(); 143 return mPos + mWString.length();
144 } 144 }
145 145
146private: 146private:
147 LLWString mString; 147 LLWString mWString;
148}; 148};
149 149
150/////////////////////////////////////////////////////////////////// 150///////////////////////////////////////////////////////////////////
@@ -153,7 +153,7 @@ class LLTextCmdAddChar : public LLTextCmd
153{ 153{
154public: 154public:
155 LLTextCmdAddChar( S32 pos, BOOL group_with_next, llwchar wc) 155 LLTextCmdAddChar( S32 pos, BOOL group_with_next, llwchar wc)
156 : LLTextCmd(pos, group_with_next), mString(1, wc), mBlockExtensions(FALSE) 156 : LLTextCmd(pos, group_with_next), mWString(1, wc), mBlockExtensions(FALSE)
157 { 157 {
158 } 158 }
159 virtual void blockExtensions() 159 virtual void blockExtensions()
@@ -162,13 +162,13 @@ public:
162 } 162 }
163 virtual BOOL canExtend(S32 pos) 163 virtual BOOL canExtend(S32 pos)
164 { 164 {
165 return !mBlockExtensions && (pos == mPos + (S32)mString.length()); 165 return !mBlockExtensions && (pos == mPos + (S32)mWString.length());
166 } 166 }
167 virtual BOOL execute( LLTextEditor* editor, S32* delta ) 167 virtual BOOL execute( LLTextEditor* editor, S32* delta )
168 { 168 {
169 *delta = insert(editor, mPos, mString); 169 *delta = insert(editor, mPos, mWString);
170 LLWString::truncate(mString, *delta); 170 LLWString::truncate(mWString, *delta);
171 //mString = wstring_truncate(mString, *delta); 171 //mWString = wstring_truncate(mWString, *delta);
172 return (*delta != 0); 172 return (*delta != 0);
173 } 173 }
174 virtual BOOL extendAndExecute( LLTextEditor* editor, S32 pos, llwchar wc, S32* delta ) 174 virtual BOOL extendAndExecute( LLTextEditor* editor, S32 pos, llwchar wc, S32* delta )
@@ -179,23 +179,23 @@ public:
179 *delta = insert(editor, pos, ws); 179 *delta = insert(editor, pos, ws);
180 if( *delta > 0 ) 180 if( *delta > 0 )
181 { 181 {
182 mString += wc; 182 mWString += wc;
183 } 183 }
184 return (*delta != 0); 184 return (*delta != 0);
185 } 185 }
186 virtual S32 undo( LLTextEditor* editor ) 186 virtual S32 undo( LLTextEditor* editor )
187 { 187 {
188 remove(editor, mPos, mString.length() ); 188 remove(editor, mPos, mWString.length() );
189 return mPos; 189 return mPos;
190 } 190 }
191 virtual S32 redo( LLTextEditor* editor ) 191 virtual S32 redo( LLTextEditor* editor )
192 { 192 {
193 insert(editor, mPos, mString ); 193 insert(editor, mPos, mWString );
194 return mPos + mString.length(); 194 return mPos + mWString.length();
195 } 195 }
196 196
197private: 197private:
198 LLWString mString; 198 LLWString mWString;
199 BOOL mBlockExtensions; 199 BOOL mBlockExtensions;
200 200
201}; 201};
@@ -242,14 +242,14 @@ public:
242 } 242 }
243 virtual BOOL execute( LLTextEditor* editor, S32* delta ) 243 virtual BOOL execute( LLTextEditor* editor, S32* delta )
244 { 244 {
245 mString = editor->getWSubString(mPos, mLen); 245 mWString = editor->getWSubString(mPos, mLen);
246 *delta = remove(editor, mPos, mLen ); 246 *delta = remove(editor, mPos, mLen );
247 return (*delta != 0); 247 return (*delta != 0);
248 } 248 }
249 virtual S32 undo( LLTextEditor* editor ) 249 virtual S32 undo( LLTextEditor* editor )
250 { 250 {
251 insert(editor, mPos, mString ); 251 insert(editor, mPos, mWString );
252 return mPos + mString.length(); 252 return mPos + mWString.length();
253 } 253 }
254 virtual S32 redo( LLTextEditor* editor ) 254 virtual S32 redo( LLTextEditor* editor )
255 { 255 {
@@ -257,7 +257,7 @@ public:
257 return mPos; 257 return mPos;
258 } 258 }
259private: 259private:
260 LLWString mString; 260 LLWString mWString;
261 S32 mLen; 261 S32 mLen;
262}; 262};
263 263
@@ -3013,8 +3013,7 @@ void LLTextEditor::draw()
3013 if( getVisible() ) 3013 if( getVisible() )
3014 { 3014 {
3015 { 3015 {
3016 LLGLEnable scissor_test(GL_SCISSOR_TEST); 3016 LLLocalClipRect clip(LLRect(0, mRect.getHeight(), mRect.getWidth() - (mScrollbar->getVisible() ? SCROLLBAR_SIZE : 0), 0));
3017 LLUI::setScissorRegionLocal(LLRect(0, mRect.getHeight(), mRect.getWidth() - (mScrollbar->getVisible() ? SCROLLBAR_SIZE : 0), 0));
3018 3017
3019 bindEmbeddedChars( mGLFont ); 3018 bindEmbeddedChars( mGLFont );
3020 3019