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; } }