From 816344ab1d2a48ef406f60708b32f632f8e9ff60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 11 Oct 2002 10:45:28 +0000 Subject: [PATCH] Fix the "can't move out of nested text insets using pageup/down" and a few cases of the "can't scroll over large notes" annoyances. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5381 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/insets/ChangeLog | 9 +++++++-- src/insets/insettext.C | 24 ++++++++++++++++++++---- src/lyxtext.h | 8 ++++---- src/mathed/math_gridinset.C | 4 +++- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 863b380ef4..69a8e685b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-10-11 André Pönitz + + * lytext.h: make some functions public to allow access + from inset/lyxtext for handling LFUN_PRIOR/NEXT + 2002-10-09 Jean-Marc Lasgouttes * text3.C (dispatch): when changing layout, avoid an infinite loop diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 067cde79e0..b8cf39e25e 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,7 +1,12 @@ + +2002-10-11 André Pönitz + + * insettext.h: handle LFUN_PRIOR/NEXT + 2002-07-30 Juergen Spitzmueller - * insetfloat.C: fix bug with float settings - (document default != float default). + * insetfloat.C: fix bug with float settings + (document default != float default). 2002-09-24 Dekel Tsur diff --git a/src/insets/insettext.C b/src/insets/insettext.C index fc0822f160..d69f823f98 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1340,6 +1340,24 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev) lt->cursorEnd(bv); updwhat = CURSOR; break; + case LFUN_PRIOR: + if (!crow(bv)->previous()) + result = FINISHED_UP; + else { + lt->cursorPrevious(bv); + result = DISPATCHED_NOUPDATE; + } + updwhat = CURSOR; + break; + case LFUN_NEXT: + if (!crow(bv)->next()) + result = FINISHED_DOWN; + else { + lt->cursorNext(bv); + result = DISPATCHED_NOUPDATE; + } + updwhat = CURSOR; + break; case LFUN_BACKSPACE: { setUndo(bv, Undo::DELETE, lt->cursor.par(), lt->cursor.par()->next()); @@ -1896,8 +1914,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool front, } -Inset::RESULT -InsetText::moveUp(BufferView * bv) +Inset::RESULT InsetText::moveUp(BufferView * bv) { if (!crow(bv)->previous()) return FINISHED_UP; @@ -1906,8 +1923,7 @@ InsetText::moveUp(BufferView * bv) } -Inset::RESULT -InsetText::moveDown(BufferView * bv) +Inset::RESULT InsetText::moveDown(BufferView * bv) { if (!crow(bv)->next()) return FINISHED_DOWN; diff --git a/src/lyxtext.h b/src/lyxtext.h index 92893fa1b6..11cf4ff793 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -346,6 +346,10 @@ public: /// void cursorEnd(BufferView *) const; /// + void cursorPrevious(BufferView * bv); + /// + void cursorNext(BufferView * bv); + /// void cursorTab(BufferView *) const; /// void cursorTop(BufferView *) const; @@ -487,10 +491,6 @@ private: /// void cursorLeftOneWord(LyXCursor &) const; - /// - void cursorPrevious(BufferView * bv); - /// - void cursorNext(BufferView * bv); /// float getCursorX(BufferView *, Row *, lyx::pos_type pos, diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 908b644051..cc0f4264f3 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -26,7 +26,9 @@ string verboseHLine(int n) string res; for (int i = 0; i < n; ++i) res += "\\hline"; - return res + ' '; + if (n) + res += " "; + return res; } }