Fix selection in insettext.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1474 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-02-09 17:53:20 +00:00
parent bc1edc19c7
commit 371c6ba3ba
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-02-09 Dekel Tsur <dekelts@tau.ac.il>
* insettext.C (moveRightIntern): Update the selection cursor.
(moveLeftIntern): Ditto.
2001-02-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2001-02-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* Makefile.am: remove BoundingBox.h * Makefile.am: remove BoundingBox.h

View File

@ -843,7 +843,6 @@ InsetText::LocalDispatch(BufferView * bv,
result = moveRight(bv); result = moveRight(bv);
bv->text->FinishUndo(); bv->text->FinishUndo();
TEXT(bv)->ClearSelection(); TEXT(bv)->ClearSelection();
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
UpdateLocal(bv, CURSOR, false); UpdateLocal(bv, CURSOR, false);
break; break;
case LFUN_LEFTSEL: case LFUN_LEFTSEL:
@ -856,7 +855,6 @@ InsetText::LocalDispatch(BufferView * bv,
bv->text->FinishUndo(); bv->text->FinishUndo();
result = moveLeft(bv); result = moveLeft(bv);
TEXT(bv)->ClearSelection(); TEXT(bv)->ClearSelection();
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
UpdateLocal(bv, CURSOR, false); UpdateLocal(bv, CURSOR, false);
break; break;
case LFUN_DOWNSEL: case LFUN_DOWNSEL:
@ -1260,24 +1258,28 @@ InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
UpdatableInset::RESULT UpdatableInset::RESULT
InsetText::moveRightIntern(BufferView * bv, bool behind, InsetText::moveRightIntern(BufferView * bv, bool behind,
bool activate_inset, bool /*selecting*/) bool activate_inset, bool selecting)
{ {
if (!cpar(bv)->next && (cpos(bv) >= cpar(bv)->Last())) if (!cpar(bv)->next && (cpos(bv) >= cpar(bv)->Last()))
return FINISHED; return FINISHED;
if (activate_inset && checkAndActivateInset(bv, behind)) if (activate_inset && checkAndActivateInset(bv, behind))
return DISPATCHED; return DISPATCHED;
TEXT(bv)->CursorRight(bv); TEXT(bv)->CursorRight(bv);
if (!selecting)
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
return DISPATCHED_NOUPDATE; return DISPATCHED_NOUPDATE;
} }
UpdatableInset::RESULT UpdatableInset::RESULT
InsetText::moveLeftIntern(BufferView * bv, bool behind, InsetText::moveLeftIntern(BufferView * bv, bool behind,
bool activate_inset, bool /*selecting*/) bool activate_inset, bool selecting)
{ {
if (!cpar(bv)->previous && (cpos(bv) <= 0)) if (!cpar(bv)->previous && (cpos(bv) <= 0))
return FINISHED; return FINISHED;
TEXT(bv)->CursorLeft(bv); TEXT(bv)->CursorLeft(bv);
if (!selecting)
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
if (activate_inset && checkAndActivateInset(bv, behind)) if (activate_inset && checkAndActivateInset(bv, behind))
return DISPATCHED; return DISPATCHED;
return DISPATCHED_NOUPDATE; return DISPATCHED_NOUPDATE;