mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
More debug mode work.
- some cursor movement - selection git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8122 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7dd8cd705b
commit
6832f63f96
@ -1,5 +1,12 @@
|
|||||||
2003-11-22 Lars Gullik Bjonnes <larsbj@gullik.net>
|
2003-11-22 Lars Gullik Bjonnes <larsbj@gullik.net>
|
||||||
|
|
||||||
|
* text3.C (cursorPrevious): make sure that we do not compare
|
||||||
|
iterators form different containers.
|
||||||
|
(cursorNext): ditto
|
||||||
|
|
||||||
|
* rowpainter.C (paintSelection): make sure that we do not compare
|
||||||
|
iterators from different containers.
|
||||||
|
|
||||||
* text3.C (dispatch): [PRIOR] make sure that we do not compare
|
* text3.C (dispatch): [PRIOR] make sure that we do not compare
|
||||||
iterators from different ParagraphList containers.
|
iterators from different ParagraphList containers.
|
||||||
[NEXT] ditto
|
[NEXT] ditto
|
||||||
|
@ -394,7 +394,8 @@ void RowPainter::paintSelection()
|
|||||||
int x;
|
int x;
|
||||||
int y = yo_;
|
int y = yo_;
|
||||||
int w;
|
int w;
|
||||||
if (startrow == rit_ && endrow == rit_) {
|
if ((startpit == pit_ && startrow == rit_) &&
|
||||||
|
(endpit == pit_ && endrow == rit_)) {
|
||||||
if (startx < endx) {
|
if (startx < endx) {
|
||||||
x = int(xo_) + startx;
|
x = int(xo_) + startx;
|
||||||
w = endx - startx;
|
w = endx - startx;
|
||||||
@ -403,11 +404,11 @@ void RowPainter::paintSelection()
|
|||||||
w = startx - endx;
|
w = startx - endx;
|
||||||
}
|
}
|
||||||
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
||||||
} else if (startrow == rit_) {
|
} else if (startpit == pit_ && startrow == rit_) {
|
||||||
int const x = is_rtl ? int(xo_) : int(xo_ + startx);
|
int const x = is_rtl ? int(xo_) : int(xo_ + startx);
|
||||||
int const w = is_rtl ? startx : (width_ - startx);
|
int const w = is_rtl ? startx : (width_ - startx);
|
||||||
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
||||||
} else if (endrow == rit_) {
|
} else if (endpit == pit_ && endrow == rit_) {
|
||||||
int const x = is_rtl ? int(xo_ + endx) : int(xo_);
|
int const x = is_rtl ? int(xo_ + endx) : int(xo_);
|
||||||
int const w = is_rtl ? (width_ - endx) : endx;
|
int const w = is_rtl ? (width_ - endx) : endx;
|
||||||
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
pain_.fillRectangle(x, y, w, h, LColor::selection);
|
||||||
@ -418,7 +419,8 @@ void RowPainter::paintSelection()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startrow != rit_ && endrow != rit_) {
|
if ((startpit != pit_ && startrow != rit_) &&
|
||||||
|
(endpit != pit_ && endrow != rit_)) {
|
||||||
if (y_ > starty && y_ < endy) {
|
if (y_ > starty && y_ < endy) {
|
||||||
int w = width_;
|
int w = width_;
|
||||||
pain_.fillRectangle(int(xo_), yo_, w, h, LColor::selection);
|
pain_.fillRectangle(int(xo_), yo_, w, h, LColor::selection);
|
||||||
@ -426,7 +428,7 @@ void RowPainter::paintSelection()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((startrow != rit_ && !is_rtl) || (endrow != rit_ && is_rtl))
|
if ((startpit != pit_ && startrow != rit_ && !is_rtl) || (endpit != pit_ && endrow != rit_ && is_rtl))
|
||||||
pain_.fillRectangle(int(xo_), yo_,
|
pain_.fillRectangle(int(xo_), yo_,
|
||||||
int(x_), h, LColor::selection);
|
int(x_), h, LColor::selection);
|
||||||
|
|
||||||
@ -459,15 +461,16 @@ void RowPainter::paintSelection()
|
|||||||
tmpx += separator_;
|
tmpx += separator_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((startrow != rit_ || text_.selection.start.pos() <= pos) &&
|
if (((startpit != pit_ && startrow != rit_) || text_.selection.start.pos() <= pos) &&
|
||||||
(endrow != rit_ || pos < text_.selection.end.pos())) {
|
((endpit != pit_ && endrow != rit_) || pos < text_.selection.end.pos())) {
|
||||||
// Here we do not use x_ as xo_ was added to x_.
|
// Here we do not use x_ as xo_ was added to x_.
|
||||||
pain_.fillRectangle(int(old_tmpx), yo_,
|
pain_.fillRectangle(int(old_tmpx), yo_,
|
||||||
int(tmpx - old_tmpx + 1), h, LColor::selection);
|
int(tmpx - old_tmpx + 1), h, LColor::selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((startrow != rit_ && is_rtl) || (endrow != rit_ && !is_rtl)) {
|
if ((startpit != pit_ && startrow != rit_ && is_rtl) ||
|
||||||
|
(endpit != pit_ && endrow != rit_ && !is_rtl)) {
|
||||||
pain_.fillRectangle(int(xo_ + tmpx),
|
pain_.fillRectangle(int(xo_ + tmpx),
|
||||||
yo_, int(bv_.workWidth() - tmpx), h, LColor::selection);
|
yo_, int(bv_.workWidth() - tmpx), h, LColor::selection);
|
||||||
}
|
}
|
||||||
|
@ -365,12 +365,13 @@ void LyXText::cursorPrevious()
|
|||||||
{
|
{
|
||||||
|
|
||||||
RowList::iterator crit = cursorRow();
|
RowList::iterator crit = cursorRow();
|
||||||
|
ParagraphList::iterator cpar = cursorPar();
|
||||||
|
|
||||||
int x = bv()->x_target() - xo_;
|
int x = bv()->x_target() - xo_;
|
||||||
int y = bv()->top_y() - yo_;
|
int y = bv()->top_y() - yo_;
|
||||||
setCursorFromCoordinates(x, y);
|
setCursorFromCoordinates(x, y);
|
||||||
|
|
||||||
if (crit == cursorRow()) {
|
if (cpar == cursorPar() && crit == cursorRow()) {
|
||||||
// we have a row which is taller than the workarea. The
|
// we have a row which is taller than the workarea. The
|
||||||
// simplest solution is to move to the previous row instead.
|
// simplest solution is to move to the previous row instead.
|
||||||
cursorUp(true);
|
cursorUp(true);
|
||||||
@ -384,12 +385,13 @@ void LyXText::cursorPrevious()
|
|||||||
void LyXText::cursorNext()
|
void LyXText::cursorNext()
|
||||||
{
|
{
|
||||||
RowList::iterator crit = cursorRow();
|
RowList::iterator crit = cursorRow();
|
||||||
|
ParagraphList::iterator cpar = cursorPar();
|
||||||
|
|
||||||
int x = bv()->x_target() - xo_;
|
int x = bv()->x_target() - xo_;
|
||||||
int y = bv()->top_y() + bv()->workHeight() - yo_;
|
int y = bv()->top_y() + bv()->workHeight() - yo_;
|
||||||
setCursorFromCoordinates(x, y);
|
setCursorFromCoordinates(x, y);
|
||||||
|
|
||||||
if (crit == cursorRow()) {
|
if (cpar == cursorPar() && crit == cursorRow()) {
|
||||||
// we have a row which is taller than the workarea. The
|
// we have a row which is taller than the workarea. The
|
||||||
// simplest solution is to move to the next row instead.
|
// simplest solution is to move to the next row instead.
|
||||||
cursorDown(true);
|
cursorDown(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user