]> git.lyx.org Git - features.git/commitdiff
Fix bug #6280: Wrong context menu is opened in an auto-opened inset.
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 24 Oct 2009 00:02:41 +0000 (00:02 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 24 Oct 2009 00:02:41 +0000 (00:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31697 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/insets/Inset.h
src/insets/InsetCaption.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetTabular.h

index 82399c77b74ac6b176b9378dfa835e846493a44e..70ce4b8ce5738897b7a0e8c4fa2dc59b7ea52e62 100644 (file)
@@ -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;
index 33e0c59fa31cc49fb647d24513d70b5f8a76dbf1..10e1f4a28c940b68aa3c35fd11963db8f405da94 100644 (file)
@@ -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
index acbd7c9ea91ef6265ee74854ea7cae65162ca132..84e17adac06f2e0599cfbf6ee5730a752215e6cd 100644 (file)
@@ -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;
        ///
index 7727729d0016b3d5c0f07965a74110b8b8e679ce..b49b97a590f7d83e4a6fecedccfb29975a5795cb 100644 (file)
@@ -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;
 }
 
 
index d692ce91c984684c3ed0c11d9d1275b2da58d8e1..b693f6bec1b57a76eb372bf4c08c686178188b45 100644 (file)
@@ -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);
        ///
index 9ac05fa489cbaac663ff102dad1779e5f54516b3..6311d7d6f8cb3512466033b8c64fbde85537edbc 100644 (file)
@@ -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 &);