diff -r 3142ebd0bc5a -r 20b912670e0d doc/contributions.txt --- a/doc/contributions.txt Tue Apr 24 08:38:38 2012 -0400 +++ b/doc/contributions.txt Mon May 14 06:04:02 2012 +0100 @@ -489,6 +489,8 @@ STORM-959 STORM-1175 STORM-1708 + STORM-1855 + VWR-20553 Imnotgoing Sideways Inma Rau Innula Zenovka @@ -1004,6 +1006,7 @@ Satomi Ahn STORM-501 STORM-229 + VWR-20553 VWR-24502 Scrim Pinion Scrippy Scofield diff -r 3142ebd0bc5a -r 20b912670e0d indra/llui/lltexteditor.h --- a/indra/llui/lltexteditor.h Tue Apr 24 08:38:38 2012 -0400 +++ b/indra/llui/lltexteditor.h Mon May 14 06:04:02 2012 +0100 @@ -239,7 +239,7 @@ // Undoable operations void addChar(llwchar c); // at mCursorPos S32 addChar(S32 pos, llwchar wc); - void addLineBreakChar(); + void addLineBreakChar(BOOL group_together = FALSE); S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); diff -r 3142ebd0bc5a -r 20b912670e0d indra/llui/lltexteditor.cpp --- a/indra/llui/lltexteditor.cpp Tue Apr 24 08:38:38 2012 -0400 +++ b/indra/llui/lltexteditor.cpp Mon May 14 06:04:02 2012 +0100 @@ -1093,7 +1093,8 @@ setCursorPos(mCursorPos + addChar( mCursorPos, wc )); } -void LLTextEditor::addLineBreakChar() + +void LLTextEditor::addLineBreakChar(BOOL group_together) { if( !getEnabled() ) { @@ -1111,7 +1112,7 @@ LLStyleConstSP sp(new LLStyle(LLStyle::Params())); LLTextSegmentPtr segment = new LLLineBreakTextSegment(sp, mCursorPos); - S32 pos = execute(new TextCmdAddChar(mCursorPos, FALSE, '\n', segment)); + S32 pos = execute(new TextCmdAddChar(mCursorPos, group_together, '\n', segment)); setCursorPos(mCursorPos + pos); } @@ -1442,21 +1443,28 @@ std::basic_string::size_type start = 0; std::basic_string::size_type pos = clean_string.find('\n',start); - while(pos!=-1) + while((pos != -1) && (pos != clean_string.length() -1)) { if(pos!=start) { std::basic_string str = std::basic_string(clean_string,start,pos-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + setCursorPos(mCursorPos + insert(mCursorPos, str, TRUE, LLTextSegmentPtr())); } - addLineBreakChar(); - + addLineBreakChar(TRUE); // Add a line break and group with the next addition. + start = pos+1; pos = clean_string.find('\n',start); } - std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + if (pos != start) + { + std::basic_string str = std::basic_string(clean_string,start,clean_string.length()-start); + setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + } + else + { + addLineBreakChar(FALSE); // Add a line break and end the grouping. + } deselect();