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() | |||
509 | int x,y; | 509 | int x,y; |
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)); |
516 | int yp = y*columns; | 520 | int yp = y*columns; |
@@ -557,9 +561,9 @@ ca* TEScreen::getCookedImage() | |||
557 | */ | 561 | */ |
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 |
565 | 569 | ||
@@ -970,16 +974,22 @@ void TEScreen::clearSelection() | |||
970 | } | 974 | } |
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; |
977 | } | 984 | } |
978 | 985 | ||
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) |
985 | { | 995 | { |
@@ -1184,8 +1194,14 @@ void TEScreen::addHistLine() | |||
1184 | 1194 | ||
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) |
1191 | { | 1207 | { |