Changed GetStringFromRegion() to not insert '\n' for soft line breaks.

Fixes bug #2515.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-07-12 01:28:57 +00:00
parent 731b9ac77c
commit bb69160b48
2 changed files with 7 additions and 5 deletions

View File

@ -320,7 +320,9 @@ BasicTerminalBuffer::GetStringFromRegion(BString& string, const TermPos& start,
// get all but the last line
while (pos.y < end.y) {
if (_GetPartialLineString(string, pos.y, pos.x, fWidth))
TerminalLine* line = _GetPartialLineString(string, pos.y, pos.x,
fWidth);
if (line != NULL && !line->softBreak)
string.Append('\n', 1);
pos.x = 0;
pos.y++;
@ -1347,14 +1349,14 @@ BasicTerminalBuffer::_InsertGap(int32 width)
/*! \a endColumn is not inclusive.
*/
bool
TerminalLine*
BasicTerminalBuffer::_GetPartialLineString(BString& string, int32 row,
int32 startColumn, int32 endColumn) const
{
TerminalLine* lineBuffer = ALLOC_LINE_ON_STACK(fWidth);
TerminalLine* line = _HistoryLineAt(row, lineBuffer);
if (line == NULL)
return false;
return NULL;
if (endColumn > line->length)
endColumn = line->length;
@ -1367,7 +1369,7 @@ BasicTerminalBuffer::_GetPartialLineString(BString& string, int32 row,
x++;
}
return true;
return line;
}

View File

@ -160,7 +160,7 @@ protected:
void _PadLineToCursor();
static void _TruncateLine(TerminalLine* line, int32 length);
void _InsertGap(int32 width);
bool _GetPartialLineString(BString& string,
TerminalLine* _GetPartialLineString(BString& string,
int32 row, int32 startColumn,
int32 endColumn) const;
bool _PreviousChar(TermPos& pos, UTF8Char& c) const;