From 75b485d11034232d3b335e68387d02bc82485386 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 13 Oct 2003 01:35:47 +0000 Subject: [PATCH] DISPATCH -> dispatch_result git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7900 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/insets/ChangeLog | 33 +++++++++++++++++++++++++++------ src/insets/inset.h | 3 --- src/insets/insetcollapsable.C | 4 ++-- src/insets/insetcollapsable.h | 2 +- src/insets/insetert.C | 4 ++-- src/insets/insetert.h | 2 +- src/insets/insettabular.C | 12 ++++++------ src/insets/insettabular.h | 10 +++++----- src/insets/insettext.C | 16 ++++++++-------- src/insets/insettext.h | 14 +++++++------- src/insets/updatableinset.C | 2 +- src/insets/updatableinset.h | 2 +- src/lyxfunc.C | 2 +- src/lyxtext.h | 2 +- src/mathed/ChangeLog | 8 ++++++-- src/mathed/formulabase.C | 2 +- src/text3.C | 5 +++-- 18 files changed, 79 insertions(+), 50 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dea28c94be..ce26823259 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-10-13 Lars Gullik Bjønnes + + * lyxfunc.C (dispatch): RESULT -> dispatch_result + * lyxtext.h: ditto + * text3.C (dispatch): ditto + 2003-10-13 Lars Gullik Bjønnes * lyxserver.C (callback): adjust diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 761f360f58..d8d11b9102 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,8 +1,29 @@ +2003-10-13 Lars Gullik Bjønnes + + * inset.h: get rid of RESULT typedef for dispatch_result + + * insetcollapsable.[Ch] (localDispatch): RESULT -> dispatch_result + * insetert.[Ch] (localDispatch): ditto + * insettabular.[Ch] (localDispatch): ditto + (moveRight): ditto + (moveLeft): ditto + (moveUp): ditto + (moveDown): ditto + * insettext.[Ch] (localDispatch): ditto + (moveRight): ditto + (moveLeft): ditto + (moveRightIntern): ditto + (moveLeftIntern): ditto + (moveUp): ditto + (moveDown): ditto + * updatableinset.[Ch] (localDispatch): ditto + 2003-10-12 Angus Leeming * renderbase.h (view, view_): removed. * renderbase.C: removed. - * Makefile.am: remove render_base.C. The shortest lived file in history? + * Makefile.am: remove render_base.C. The shortest lived file in + history? * renderbutton.C (draw): * render_graphic.C (draw): don't cache the BufferView. @@ -113,11 +134,11 @@ * Makefile.am: add new files. - * insetexternal.[Ch]: InsetExternal::Params -> InsetExternalParams, - allowing the class to be forward declared. (Also consistent with - all other Params classes.) - (write): moved out of the class. Move this function and those in - namespace anon to ExternalSupport.[Ch]. + * insetexternal.[Ch]: InsetExternal::Params -> InsetExternalParams, + allowing the class to be forward declared. (Also consistent with + all other Params classes.) + (write): moved out of the class. Move this function and those in + namespace anon to ExternalSupport.[Ch]. 2003-10-07 Angus Leeming diff --git a/src/insets/inset.h b/src/insets/inset.h index cad92c891f..5e8cd824be 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -152,9 +152,6 @@ public: HIGHLY_EDITABLE }; - /// - typedef dispatch_result RESULT; - /// InsetOld(); /// diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 59c66883b2..c54f763e4f 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -271,7 +271,7 @@ bool InsetCollapsable::hitButton(FuncRequest const & cmd) const } -InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd) +dispatch_result InsetCollapsable::localDispatch(FuncRequest const & cmd) { //lyxerr << "InsetCollapsable::localDispatch: " // << cmd.action << " '" << cmd.argument << "'\n"; @@ -343,7 +343,7 @@ InsetOld::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd) return DISPATCHED; default: - UpdatableInset::RESULT result = inset.localDispatch(cmd); + dispatch_result result = inset.localDispatch(cmd); if (result >= FINISHED) bv->unlockInset(this); first_after_edit = false; diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index e455544895..37e61f70f1 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -68,7 +68,7 @@ public: /// int insetInInsetY() const; /// - RESULT localDispatch(FuncRequest const &); + dispatch_result localDispatch(FuncRequest const &); /// int latex(Buffer const &, std::ostream &, LatexRunParams const &) const; diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 5ef362e02e..3c611f7f18 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -415,9 +415,9 @@ int InsetERT::docbook(Buffer const &, ostream & os, bool) const } -InsetOld::RESULT InsetERT::localDispatch(FuncRequest const & cmd) +dispatch_result InsetERT::localDispatch(FuncRequest const & cmd) { - InsetOld::RESULT result = UNDISPATCHED; + dispatch_result result = UNDISPATCHED; BufferView * bv = cmd.view(); if (inset.paragraphs.begin()->empty()) { diff --git a/src/insets/insetert.h b/src/insets/insetert.h index d6c342ff66..d2fa963148 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -76,7 +76,7 @@ public: /// void validate(LaTeXFeatures &) const {} /// - RESULT localDispatch(FuncRequest const &); + dispatch_result localDispatch(FuncRequest const &); /// bool checkInsertChar(LyXFont &); /// diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 7e280a424f..232ada36a4 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -625,12 +625,12 @@ void InsetTabular::lfunMouseMotion(FuncRequest const & cmd) } -InsetOld::RESULT InsetTabular::localDispatch(FuncRequest const & cmd) +dispatch_result InsetTabular::localDispatch(FuncRequest const & cmd) { // We need to save the value of the_locking_inset as the call to // the_locking_inset->localDispatch might unlock it. old_locking_inset = the_locking_inset; - RESULT result = UpdatableInset::localDispatch(cmd); + dispatch_result result = UpdatableInset::localDispatch(cmd); BufferView * bv = cmd.view(); if (cmd.action == LFUN_INSET_EDIT) { @@ -1353,7 +1353,7 @@ void InsetTabular::resetPos(BufferView * bv) const } -InsetOld::RESULT InsetTabular::moveRight(BufferView * bv, bool lock) +dispatch_result InsetTabular::moveRight(BufferView * bv, bool lock) { if (lock && !old_locking_inset) { if (activateCellInset(bv)) @@ -1371,7 +1371,7 @@ InsetOld::RESULT InsetTabular::moveRight(BufferView * bv, bool lock) } -InsetOld::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock) +dispatch_result InsetTabular::moveLeft(BufferView * bv, bool lock) { bool moved = isRightToLeft(bv) ? moveNextCell(bv) : movePrevCell(bv); if (!moved) @@ -1385,7 +1385,7 @@ InsetOld::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock) } -InsetOld::RESULT InsetTabular::moveUp(BufferView * bv, bool lock) +dispatch_result InsetTabular::moveUp(BufferView * bv, bool lock) { int const ocell = actcell; actcell = tabular.getCellAbove(actcell); @@ -1406,7 +1406,7 @@ InsetOld::RESULT InsetTabular::moveUp(BufferView * bv, bool lock) } -InsetOld::RESULT InsetTabular::moveDown(BufferView * bv, bool lock) +dispatch_result InsetTabular::moveDown(BufferView * bv, bool lock) { int const ocell = actcell; actcell = tabular.getCellBelow(actcell); diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 3a5629a41a..7878be10d1 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -105,7 +105,7 @@ public: /// bool display() const { return tabular.isLongTabular(); } /// - RESULT localDispatch(FuncRequest const &); + dispatch_result localDispatch(FuncRequest const &); /// int latex(Buffer const &, std::ostream &, LatexRunParams const &) const; @@ -229,13 +229,13 @@ private: /// void setPos(BufferView *, int x, int y) const; /// - RESULT moveRight(BufferView *, bool lock = true); + dispatch_result moveRight(BufferView *, bool lock = true); /// - RESULT moveLeft(BufferView *, bool lock = true); + dispatch_result moveLeft(BufferView *, bool lock = true); /// - RESULT moveUp(BufferView *, bool lock = true); + dispatch_result moveUp(BufferView *, bool lock = true); /// - RESULT moveDown(BufferView *, bool lock = true); + dispatch_result moveDown(BufferView *, bool lock = true); /// bool moveNextCell(BufferView *, bool lock = false); /// diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 6b3bede4da..6224d2099a 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -588,7 +588,7 @@ void InsetText::lfunMouseMotion(FuncRequest const & cmd) } -InsetOld::RESULT InsetText::localDispatch(FuncRequest const & cmd) +dispatch_result InsetText::localDispatch(FuncRequest const & cmd) { BufferView * bv = cmd.view(); setViewCache(bv); @@ -668,7 +668,7 @@ InsetOld::RESULT InsetText::localDispatch(FuncRequest const & cmd) bool was_empty = paragraphs.begin()->empty() && paragraphs.size() == 1; no_selection = false; - RESULT result = UpdatableInset::localDispatch(cmd); + dispatch_result result = UpdatableInset::localDispatch(cmd); if (result != UNDISPATCHED) return DISPATCHED; @@ -1177,7 +1177,7 @@ void InsetText::fitInsetCursor(BufferView * bv) const } -InsetOld::RESULT InsetText::moveRight(BufferView * bv) +dispatch_result InsetText::moveRight(BufferView * bv) { if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params())) return moveLeftIntern(bv, false, true, false); @@ -1186,7 +1186,7 @@ InsetOld::RESULT InsetText::moveRight(BufferView * bv) } -InsetOld::RESULT InsetText::moveLeft(BufferView * bv) +dispatch_result InsetText::moveLeft(BufferView * bv) { if (text_.cursorPar()->isRightToLeftPar(bv->buffer()->params())) return moveRightIntern(bv, true, true, false); @@ -1195,7 +1195,7 @@ InsetOld::RESULT InsetText::moveLeft(BufferView * bv) } -InsetOld::RESULT +dispatch_result InsetText::moveRightIntern(BufferView * bv, bool front, bool activate_inset, bool selecting) { @@ -1212,7 +1212,7 @@ InsetText::moveRightIntern(BufferView * bv, bool front, } -InsetOld::RESULT +dispatch_result InsetText::moveLeftIntern(BufferView * bv, bool front, bool activate_inset, bool selecting) { @@ -1227,7 +1227,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool front, } -InsetOld::RESULT InsetText::moveUp(BufferView * bv) +dispatch_result InsetText::moveUp(BufferView * bv) { if (crow() == text_.firstRow()) return FINISHED_UP; @@ -1237,7 +1237,7 @@ InsetOld::RESULT InsetText::moveUp(BufferView * bv) } -InsetOld::RESULT InsetText::moveDown(BufferView * bv) +dispatch_result InsetText::moveDown(BufferView * bv) { if (crow() == text_.lastRow()) return FINISHED_DOWN; diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 8e21176b03..614e8f996e 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -80,7 +80,7 @@ public: bool unlockInsetInInset(BufferView *, UpdatableInset *, bool lr = false); /// - RESULT localDispatch(FuncRequest const &); + dispatch_result localDispatch(FuncRequest const &); /// int latex(Buffer const &, std::ostream &, LatexRunParams const &) const; @@ -218,22 +218,22 @@ private: void lfunMouseMotion(FuncRequest const &); /// - RESULT moveRight(BufferView *); + dispatch_result moveRight(BufferView *); /// - RESULT moveLeft(BufferView *); + dispatch_result moveLeft(BufferView *); /// - RESULT moveRightIntern(BufferView *, bool front, + dispatch_result moveRightIntern(BufferView *, bool front, bool activate_inset = true, bool selecting = false); /// - RESULT moveLeftIntern(BufferView *, bool front, + dispatch_result moveLeftIntern(BufferView *, bool front, bool activate_inset = true, bool selecting = false); /// - RESULT moveUp(BufferView *); + dispatch_result moveUp(BufferView *); /// - RESULT moveDown(BufferView *); + dispatch_result moveDown(BufferView *); /// void setCharFont(Buffer const &, int pos, LyXFont const & font); /// diff --git a/src/insets/updatableinset.C b/src/insets/updatableinset.C index fd5f6f5ffb..fd022a71b5 100644 --- a/src/insets/updatableinset.C +++ b/src/insets/updatableinset.C @@ -108,7 +108,7 @@ void UpdatableInset::scroll(BufferView * bv, int offset) const /// An updatable inset could handle lyx editing commands -InsetOld::RESULT UpdatableInset::localDispatch(FuncRequest const & ev) +dispatch_result UpdatableInset::localDispatch(FuncRequest const & ev) { if (ev.action == LFUN_MOUSE_RELEASE) return (editable() == IS_EDITABLE) ? DISPATCHED : UNDISPATCHED; diff --git a/src/insets/updatableinset.h b/src/insets/updatableinset.h index a27cf2d85c..ba795e8759 100644 --- a/src/insets/updatableinset.h +++ b/src/insets/updatableinset.h @@ -82,7 +82,7 @@ public: bool /*lr*/ = false) { return false; } /// An updatable inset could handle lyx editing commands - virtual RESULT localDispatch(FuncRequest const & cmd); + virtual dispatch_result localDispatch(FuncRequest const & cmd); // We need this method to not clobber the real method in Inset int scroll(bool recursive = true) const { return InsetOld::scroll(recursive); } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 25f67589a5..5378660bc8 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -889,7 +889,7 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose) if (view()->available() && view()->theLockingInset()) { - InsetOld::RESULT result; + dispatch_result result; if (action > 1 || (action == LFUN_UNKNOWN_ACTION && !keyseq.deleted())) { diff --git a/src/lyxtext.h b/src/lyxtext.h index 5e9ec5cb72..9492ca92ff 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -153,7 +153,7 @@ public: void metrics(MetricsInfo & mi, Dimension & dim); /// - InsetOld::RESULT dispatch(FuncRequest const & cmd); + dispatch_result dispatch(FuncRequest const & cmd); BufferView * bv(); diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index c182932080..bc811f88e5 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2003-10-13 Lars Gullik Bjønnes + + * formulabase.C (localDispatch): DISPATCH -> dispatch_result + 2003-10-12 Angus Leeming * formulabase.[Ch] (cache): added. @@ -31,7 +35,7 @@ * formula.[Ch]: mods to PreviewImpl due to the changes to PreviewedInset. - + 2003-10-09 Angus Leeming * formula.C (metrics, draw): pass a buffer arg to PreviewedInset's @@ -97,7 +101,7 @@ add #include "LColor.h". * math_data.C, math_scriptinset.C: add #include * math_exintinset.C: add #include - + 2003-09-15 Lars Gullik Bjønnes * command_inset.C diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index ffdd3e4726..62f94bd749 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -379,7 +379,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd) return UNDISPATCHED; string argument = cmd.argument; - RESULT result = DISPATCHED; + dispatch_result result = DISPATCHED; bool sel = false; bool was_macro = mathcursor->inMacroMode(); bool was_selection = mathcursor->selection(); diff --git a/src/text3.C b/src/text3.C index 6411492163..35380d1f27 100644 --- a/src/text3.C +++ b/src/text3.C @@ -389,9 +389,10 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd, } } -} +} // anon namespace + -InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd) +dispatch_result LyXText::dispatch(FuncRequest const & cmd) { lyxerr[Debug::ACTION] << "LyXText::dispatch: action[" << cmd.action <<"] arg[" << cmd.argument << ']' << "xy[" << -- 2.39.2