void BufferView::processUpdateFlags(Update::flags flags)
{
- // last_inset_ points to the last visited inset. This pointer may become
- // invalid because of keyboard editing. Since all such operations
- // causes screen update(), I reset last_inset_ to avoid such a problem.
- d->last_inset_ = 0;
-
// This is close to a hot-path.
LYXERR(Debug::DEBUG, "BufferView::processUpdateFlags()"
<< "[fitcursor = " << (flags & Update::FitCursor)
}
+void BufferView::clearLastInset(Inset * inset) const
+{
+ if (d->last_inset_ != inset) {
+ LYXERR0("Wrong last_inset!");
+ LASSERT(false, /**/);
+ }
+ d->last_inset_ = 0;
+}
+
+
void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
{
//lyxerr << "[ cmd0 " << cmd0 << "]" << endl;
Inset * editedInset(std::string const & name) const;
/// Associate an inset associated with given dialog name.
void editInset(std::string const & name, Inset * inset);
+ ///
+ void clearLastInset(Inset * inset) const;
private:
/// noncopyable
}
+InsetCollapsable::~InsetCollapsable()
+{
+ map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
+ map<BufferView const *, bool>::iterator end = mouse_hover_.end();
+ for (; it != end; ++it)
+ if (it->second)
+ it->first->clearLastInset(this);
+}
+
+
InsetCollapsable::CollapseStatus InsetCollapsable::status(BufferView const & bv) const
{
if (decoration() == InsetLayout::CONGLOMERATE)
///
InsetCollapsable(InsetCollapsable const & rhs);
///
+ ~InsetCollapsable();
+ ///
InsetCollapsable * asInsetCollapsable() { return this; }
///
InsetCollapsable const * asInsetCollapsable() const { return this; }
{
if (!mailer_name_.empty())
hideDialogs(mailer_name_, this);
+ map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
+ map<BufferView const *, bool>::iterator end = mouse_hover_.end();
+ for (; it != end; ++it)
+ if (it->second)
+ it->first->clearLastInset(this);
}
{}
+InsetMathNest::~InsetMathNest()
+{
+ map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
+ map<BufferView const *, bool>::iterator end = mouse_hover_.end();
+ for (; it != end; ++it)
+ if (it->second)
+ it->first->clearLastInset(this);
+}
+
+
InsetMathNest & InsetMathNest::operator=(InsetMathNest const & inset)
{
cells_ = inset.cells_;
/// nestinsets have a fixed size to start with
InsetMathNest(Buffer * buf, idx_type ncells);
///
- virtual ~InsetMathNest() {}
+ virtual ~InsetMathNest();
///
void setBuffer(Buffer &);