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
This commit is contained in:
Vincent van Ravesteijn 2009-10-24 00:02:41 +00:00
parent 42546d3f2c
commit f09a4ac03c
6 changed files with 7 additions and 7 deletions

View 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;

View 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

View 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;
///

View 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;
}

View 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);
///

View 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 &);