]> git.lyx.org Git - lyx.git/commitdiff
fix recent bug where too many lfuns got disabled;fix minibuffer message when a comman...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 Dec 2004 11:32:14 +0000 (11:32 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 Dec 2004 11:32:14 +0000 (11:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9330 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/cursor.h
src/insets/ChangeLog
src/insets/insetbase.h
src/lyxfunc.C
src/text3.C

index 44351a0565c096015b4ebae3bbf5acdacf263415..0d6ed80ef71980a694695b432704b9c6c7679ef1 100644 (file)
@@ -1,3 +1,17 @@
+2004-12-01  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * lyxfunc.C (getStatus): do not lose previous information when
+       calling BufferView::getStatus; do not set a default "Command
+       disabled" message at the beginning, but just before returning.
+
+2004-11-30  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * cursor.h (getStatus): add better comment from src/cursor.C
+
+2004-11-30  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text3.C (getStatus): return false when the lfun is not handled
+
 2004-11-29  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * broken_headers.h: remove
@@ -21,7 +35,7 @@
 
        * bufferview_funcs.[Ch]: introduce coordOffset, getPos, status,
        CurStatus enum.
-       
+
        * coordcache.[Ch]: add paragraph cache and helpers
 
        * CursorSlice.[Ch]: rename CursorSlice::par to CursorSlice::pit,
index 01c4d82432cbe40861701e719e1d4ad3d3ce9c88..fa90fd6ad9b115e8a1e2a533f258b5dbfd15bb4e 100644 (file)
@@ -42,7 +42,12 @@ public:
        void dispatch(FuncRequest const & cmd);
        /// get the resut of the last dispatch
        DispatchResult result() const;
-       /// are we willing to handle this event?
+        /**
+        * \returns true if this function made a definitive decision on
+        * whether the inset at this cursor position wants to handle the
+        * request \p cmd or not. The result of this decision is put into
+        * \p status.
+        */
        bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
 
        /// add a new cursor slice
index 8757cc1f9f53a66b3947aca758ee1a2a20a9db3f..7dad33cc99c482acc0fbc2fe9b9105b3aa1f393f 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-30  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * insetbase.h (getStatus): add better comment from src/cursor.C
+
 2004-11-26  Alfredo Braunstein  <abraunst@lyx.org>
 
        * insettabular.[Ch]: adjust, introduce "do not draw
index 431d75c5b704c0acce8d2971909c652446e21577..dd79ee93e5eeebd93b02047758c86ad063e97f70 100644 (file)
@@ -79,9 +79,13 @@ public:
        /// true for 'math' math inset, but not for e.g. mbox
        virtual bool inMathed() const { return false; }
 
-       // the real dispatcher
+       /// the real dispatcher
        void dispatch(LCursor & cur, FuncRequest & cmd);
-       /// do we want to handle this event?
+       /**
+        * \returns true if this function made a definitive decision on
+        * whether the inset wants to handle the request \p cmd or not.
+        * The result of this decision is put into \p status.
+        */
        virtual bool getStatus(LCursor & cur, FuncRequest const & cmd,
                FuncStatus & status) const;
 
index 56a79f8ab69411f947b543d983fbac3ece7bace4..1e08a9708f362a4ad68899a65171e1b711518554 100644 (file)
@@ -308,10 +308,11 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                return flag;
        }
 
-       // the default error message if we disable the command
-       flag.message(N_("Command disabled"));
-       if (!flag.enabled())
+       if (!flag.enabled()) {
+               if (flag.message().empty())
+                       flag.message(N_("Command disabled"));
                return flag;
+       }
 
        // Check whether we need a buffer
        if (!lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer) && !buf) {
@@ -523,7 +524,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        default:
 
                if (!cur.getStatus(cmd, flag))
-                       flag = view()->getStatus(cmd);
+                       flag |= view()->getStatus(cmd);
        }
 
        if (!enable)
@@ -537,7 +538,10 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                flag.enabled(false);
        }
 
-       //lyxerr << "LyXFunc::getStatus: got: " << flag.enabled() << endl;
+       // the default error message if we disable the command
+       if (!flag.enabled() && flag.message().empty())
+               flag.message(N_("Command disabled"));
+
        return flag;
 }
 
index 11f4588bffa47016599df17531d852deb46422b3..5f37f7de5b21d9e6c091cb5fb5455a17f0d5bdff 100644 (file)
@@ -1627,7 +1627,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
 
 bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
-       FuncStatus & flag) const
+                       FuncStatus & flag) const
 {
        BOOST_ASSERT(cur.text() == this);
        LyXFont const & font = real_current_font;
@@ -1969,8 +1969,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
                break;
 
        default:
-               enable = false;
-               break;
+               return false;
        }
        flag.enabled(enable);
        return true;