author | waspe <waspe> | 2004-02-22 12:57:58 (UTC) |
---|---|---|
committer | waspe <waspe> | 2004-02-22 12:57:58 (UTC) |
commit | 5bc4dbd932fcfa64773b6e17fe57c665bdcd50b8 (patch) (unidiff) | |
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 | |||
@@ -510,6 +510,10 @@ ca* TEScreen::getCookedImage() | |||
510 | ca* merged = (ca*)malloc(lines*columns*sizeof(ca)); | 510 | ca* merged = (ca*)malloc(lines*columns*sizeof(ca)); |
511 | ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION); | 511 | ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION); |
512 | 512 | ||
513 | if (histCursor > hist.getLines()) { | ||
514 | histCursor = hist.getLines(); | ||
515 | } | ||
516 | |||
513 | for (y = 0; (y < lines) && (y < (hist.getLines()-histCursor)); y++) | 517 | for (y = 0; (y < lines) && (y < (hist.getLines()-histCursor)); y++) |
514 | { | 518 | { |
515 | int len = QMIN(columns,hist.getLineLen(y+histCursor)); | 519 | int len = QMIN(columns,hist.getLineLen(y+histCursor)); |
@@ -558,7 +562,7 @@ ca* TEScreen::getCookedImage() | |||
558 | 562 | ||
559 | void TEScreen::reset() | 563 | void TEScreen::reset() |
560 | { | 564 | { |
561 | Config cfg("Konsole"); | 565 | Config cfg("Qkonsole"); |
562 | cfg.setGroup("ScrollBar"); | 566 | cfg.setGroup("ScrollBar"); |
563 | if( !cfg.readBoolEntry("HorzScroll",0) ) | 567 | if( !cfg.readBoolEntry("HorzScroll",0) ) |
564 | setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin | 568 | setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin |
@@ -971,6 +975,9 @@ void TEScreen::clearSelection() | |||
971 | 975 | ||
972 | void TEScreen::setSelBeginXY(const int x, const int y) | 976 | void TEScreen::setSelBeginXY(const int x, const int y) |
973 | { | 977 | { |
978 | if (histCursor > hist.getLines()) { | ||
979 | histCursor = hist.getLines(); | ||
980 | } | ||
974 | sel_begin = loc(x,y+histCursor) ; | 981 | sel_begin = loc(x,y+histCursor) ; |
975 | sel_BR = sel_begin; | 982 | sel_BR = sel_begin; |
976 | sel_TL = sel_begin; | 983 | sel_TL = sel_begin; |
@@ -979,6 +986,9 @@ void TEScreen::setSelBeginXY(const int x, const int y) | |||
979 | void TEScreen::setSelExtentXY(const int x, const int y) | 986 | void TEScreen::setSelExtentXY(const int x, const int y) |
980 | { | 987 | { |
981 | if (sel_begin == -1) return; | 988 | if (sel_begin == -1) return; |
989 | if (histCursor > hist.getLines()) { | ||
990 | histCursor = hist.getLines(); | ||
991 | } | ||
982 | int l = loc(x,y + histCursor); | 992 | int l = loc(x,y + histCursor); |
983 | 993 | ||
984 | if (l < sel_begin) | 994 | if (l < sel_begin) |
@@ -1185,6 +1195,12 @@ void TEScreen::addHistLine() | |||
1185 | void TEScreen::setHistCursor(int cursor) | 1195 | void TEScreen::setHistCursor(int cursor) |
1186 | { | 1196 | { |
1187 | histCursor = cursor; //FIXME:rangecheck | 1197 | histCursor = cursor; //FIXME:rangecheck |
1198 | if (histCursor > hist.getLines()) { | ||
1199 | histCursor = hist.getLines(); | ||
1200 | } | ||
1201 | if (histCursor < 0) { | ||
1202 | histCursor = 0; | ||
1203 | } | ||
1188 | } | 1204 | } |
1189 | 1205 | ||
1190 | void TEScreen::setHorzCursor(int cursor) | 1206 | void TEScreen::setHorzCursor(int cursor) |