-rw-r--r-- | noncore/apps/opie-console/TEScreen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/TEScreen.cpp b/noncore/apps/opie-console/TEScreen.cpp index 2675d31..8e91532 100644 --- a/noncore/apps/opie-console/TEScreen.cpp +++ b/noncore/apps/opie-console/TEScreen.cpp @@ -1070,98 +1070,98 @@ QString TEScreen::getSelText(const BOOL preserve_line_breaks) { while ((eol > s) && isspace(image[eol - hist_BR].c)) { eol--; } } else { eol = sel_BR; } while (s <= eol) { m[d++] = image[s++ - hist_BR].c; } if (eol < sel_BR) { // eol processing see below ... if ((eol + 1) % columns == 0) { if (image[eol - hist_BR].c == ' ') { m[d++] = ' '; } } else { m[d++] = ((preserve_line_breaks || ((eol % columns) == 0)) ? '\n' : ' '); } } s = (eol / columns + 1) * columns; } } QChar* qc = new QChar[d]; for (int i = 0; i < d; i++) { qc[i] = m[i]; } QString res(qc, d); - delete m; - delete qc; + delete [] m; + delete [] qc; return res; } QString TEScreen::getHistory() { sel_begin = 0; sel_BR = sel_begin; sel_TL = sel_begin; setSelExtentXY(columns-1,lines-1); QString tmp=getSelText(true); while (tmp.at(tmp.length()-2).unicode()==10 && tmp.at(tmp.length()-1).unicode()==10) tmp.truncate(tmp.length()-1); return tmp; } /* above ... end of line processing for selection -- psilva cases: 1) (eol+1)%columns == 0 --> the whole line is filled. If the last char is a space, insert (preserve) space. otherwise leave the text alone, so that words that are broken by linewrap are preserved. FIXME: * this suppresses \n for command output that is sized to the exact column width of the screen. 2) eol%columns == 0 --> blank line. insert a \n unconditionally. Do it either you would because you are in preserve_line_break mode, or because it's an ASCII paragraph delimiter, so even when not preserving line_breaks, you want to preserve paragraph breaks. 3) else --> partially filled line insert a \n in preserve line break mode, else a space The space prevents concatenation of the last word of one line with the first of the next. */ void TEScreen::addHistLine() { assert(hasScroll() || histCursor == 0); // add to hist buffer // we have to take care about scrolling, too... if (hasScroll()) { ca dft; |