+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
* bufferview_funcs.[Ch]: introduce coordOffset, getPos, status,
CurStatus enum.
-
+
* coordcache.[Ch]: add paragraph cache and helpers
* CursorSlice.[Ch]: rename CursorSlice::par to CursorSlice::pit,
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
+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
/// 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;
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) {
default:
if (!cur.getStatus(cmd, flag))
- flag = view()->getStatus(cmd);
+ flag |= view()->getStatus(cmd);
}
if (!enable)
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;
}
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;
break;
default:
- enable = false;
- break;
+ return false;
}
flag.enabled(enable);
return true;