From: Vincent van Ravesteijn Date: Sun, 24 Oct 2010 19:24:36 +0000 (+0000) Subject: setMouseHover() functions can be const. X-Git-Tag: 2.0.0~2280 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a77d991e2403ae76f5d7b1bcad82ec1a4c9bf26a;p=features.git setMouseHover() functions can be const. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35802 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 5ff1d53275..baf58bf773 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -286,7 +286,8 @@ public: { return false; } /// is called when the mouse enters or leaves this inset /// return true if this inset needs a repaint - virtual bool setMouseHover(BufferView const *, bool) { return false; } + virtual bool setMouseHover(BufferView const *, bool) const + { return false; } /// return true if this inset is hovered (under mouse) /// This is by now only used by mathed to draw corners /// (Inset::drawMarkers() and Inset::drawMarkers2()). diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index ccb26a5dff..48ae8a8df0 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -238,6 +238,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const bool InsetCollapsable::setMouseHover(BufferView const * bv, bool mouse_hover) + const { mouse_hover_[bv] = mouse_hover; return true; diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index 3bdac33998..5a317bdba7 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -127,7 +127,7 @@ public: /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// - bool setMouseHover(BufferView const * bv, bool mouse_hover); + bool setMouseHover(BufferView const * bv, bool mouse_hover) const; /// ColorCode backgroundColor(PainterInfo const &) const { return getLayout().bgcolor(); } diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index f02477afab..feed4dbe4b 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -86,6 +86,7 @@ void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const bool InsetCommand::setMouseHover(BufferView const * bv, bool mouse_hover) + const { mouse_hover_[bv] = mouse_hover; return true; diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index 911ddf3042..990ac2abd2 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -101,7 +101,7 @@ private: /// RenderButton & button() const { return button_; } /// - bool setMouseHover(BufferView const * bv, bool mouse_hover); + bool setMouseHover(BufferView const * bv, bool mouse_hover) const; /// Return parameter information for command cmdName. /// Not implemented here. Must be implemented in derived class. static ParamInfo const & findInfo(std::string const & cmdName);