From: Vincent van Ravesteijn Date: Sat, 24 Oct 2009 00:02:41 +0000 (+0000) Subject: Fix bug #6280: Wrong context menu is opened in an auto-opened inset. X-Git-Tag: 2.0.0~5334 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f09a4ac03cbde4303afc9db3b404f7987e801d29;p=features.git Fix bug #6280: Wrong context menu is opened in an auto-opened inset. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31697 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 82399c77b7..70ce4b8ce5 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1950,7 +1950,7 @@ Inset const * BufferView::getCoveringInset(Text const & text, if (!inset) return 0; - if (!inset->descendable()) + if (!inset->descendable(*this)) // No need to go further down if the inset is not // descendable. return inset; diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 33e0c59fa3..10e1f4a28c 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -309,7 +309,7 @@ public: virtual bool hasSettings() const; /// can we go further down on mouse click? // true for InsetCaption, InsetCollapsables (not ButtonOnly), InsetTabular - virtual bool descendable() const { return false; } + virtual bool descendable(BufferView const &) const { return false; } /// is this an inset that can be moved into? /// FIXME: merge with editable() // true for InsetTabular & InsetText diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index acbd7c9ea9..84e17adac0 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -47,7 +47,7 @@ private: void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; /// - bool descendable() const { return true; } + bool descendable(BufferView const &) const { return true; } /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 7727729d00..b49b97a590 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -397,9 +397,9 @@ bool InsetCollapsable::editable() const } -bool InsetCollapsable::descendable() const +bool InsetCollapsable::descendable(BufferView const & bv) const { - return geometry() != ButtonOnly; + return geometry(bv) != ButtonOnly; } diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index d692ce91c9..b693f6bec1 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -67,7 +67,7 @@ public: /// bool hasSettings() const { return true; } /// can we go further down on mouse click? - bool descendable() const; + bool descendable(BufferView const & bv) const; /// void setLabel(docstring const & l); /// diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 9ac05fa489..6311d7d6f8 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -824,7 +824,7 @@ public: /// Inset * editXY(Cursor & cur, int x, int y); /// can we go further down on mouse click? - bool descendable() const { return true; } + bool descendable(BufferView const & bv) const { return true; } // Update the counters of this inset and of its contents void updateLabels(ParIterator const &);