author | waspe <waspe> | 2004-02-22 12:57:58 (UTC) |
---|---|---|
committer | waspe <waspe> | 2004-02-22 12:57:58 (UTC) |
commit | 5bc4dbd932fcfa64773b6e17fe57c665bdcd50b8 (patch) (side-by-side diff) | |
tree | b97f5281b807b4218f437150a4e9082694e7a642 /core/apps/embeddedkonsole/TEScreen.cpp | |
parent | 908f9c9f0c68d1c3e5a620a69bbf0d05684e2ab3 (diff) | |
download | opie-5bc4dbd932fcfa64773b6e17fe57c665bdcd50b8.zip opie-5bc4dbd932fcfa64773b6e17fe57c665bdcd50b8.tar.gz opie-5bc4dbd932fcfa64773b6e17fe57c665bdcd50b8.tar.bz2 |
merged changes form qkonsole back into opie-embeddedkonsole (most likely not bugfree !)
Diffstat (limited to 'core/apps/embeddedkonsole/TEScreen.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/TEScreen.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/TEScreen.cpp b/core/apps/embeddedkonsole/TEScreen.cpp index a6cf6a1..4ebc28e 100644 --- a/core/apps/embeddedkonsole/TEScreen.cpp +++ b/core/apps/embeddedkonsole/TEScreen.cpp @@ -509,8 +509,12 @@ ca* TEScreen::getCookedImage() int x,y; ca* merged = (ca*)malloc(lines*columns*sizeof(ca)); ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION); + if (histCursor > hist.getLines()) { + histCursor = hist.getLines(); + } + for (y = 0; (y < lines) && (y < (hist.getLines()-histCursor)); y++) { int len = QMIN(columns,hist.getLineLen(y+histCursor)); int yp = y*columns; @@ -557,9 +561,9 @@ ca* TEScreen::getCookedImage() */ void TEScreen::reset() { - Config cfg("Konsole"); + Config cfg("Qkonsole"); cfg.setGroup("ScrollBar"); if( !cfg.readBoolEntry("HorzScroll",0) ) setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin @@ -970,16 +974,22 @@ void TEScreen::clearSelection() } void TEScreen::setSelBeginXY(const int x, const int y) { + if (histCursor > hist.getLines()) { + histCursor = hist.getLines(); + } sel_begin = loc(x,y+histCursor) ; sel_BR = sel_begin; sel_TL = sel_begin; } void TEScreen::setSelExtentXY(const int x, const int y) { if (sel_begin == -1) return; + if (histCursor > hist.getLines()) { + histCursor = hist.getLines(); + } int l = loc(x,y + histCursor); if (l < sel_begin) { @@ -1184,8 +1194,14 @@ void TEScreen::addHistLine() void TEScreen::setHistCursor(int cursor) { histCursor = cursor; //FIXME:rangecheck + if (histCursor > hist.getLines()) { + histCursor = hist.getLines(); + } + if (histCursor < 0) { + histCursor = 0; + } } void TEScreen::setHorzCursor(int cursor) { |