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.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index 51f7ad6..6e5cdc4 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -951,7 +951,14 @@ S32 LLTextEditor::getLineStart( S32 line ) const
951 S32 segoffset = mLineStartList[line].mOffset; 951 S32 segoffset = mLineStartList[line].mOffset;
952 LLTextSegment* seg = mSegments[segidx]; 952 LLTextSegment* seg = mSegments[segidx];
953 S32 res = seg->getStart() + segoffset; 953 S32 res = seg->getStart() + segoffset;
954 if (res > seg->getEnd()) llerrs << "wtf" << llendl; 954 if (res > seg->getEnd())
955 {
956 //llerrs << "wtf" << llendl;
957 // This happens when creating a new notecard using the AO on certain opensims.
958 // Play it safe instead of bringing down the viewer - MC
959 llwarns << "BAD JOOJOO! Text length (" << res << ") greater than text end (" << seg->getEnd() << "). Setting line start to " << seg->getEnd() << llendl;
960 res = seg->getEnd();
961 }
955 return res; 962 return res;
956} 963}
957 964
@@ -1079,6 +1086,11 @@ S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL rou
1079 1086
1080void LLTextEditor::setCursor(S32 row, S32 column) 1087void LLTextEditor::setCursor(S32 row, S32 column)
1081{ 1088{
1089 // Make sure we're not trying to set the cursor anywhere
1090 // it can't go by always setting the min to 0 -- MC
1091 row = (row < 0) ? 0 : row;
1092 column = (column < 0) ? 0 : column;
1093
1082 const llwchar* doc = mWText.c_str(); 1094 const llwchar* doc = mWText.c_str();
1083 const char CR = 10; 1095 const char CR = 10;
1084 while(row--) 1096 while(row--)