diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index f68546275f..74c53ef61b 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -50,17 +50,15 @@ InsetCollapsable::InsetCollapsable(Buffer * buf, InsetText::UsePlain ltype) } +// The sole purpose of this copy constructor is to make sure +// that the mouse_hover_ map is not copied and remains empty. InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs) : InsetText(rhs), status_(rhs.status_), labelstring_(rhs.labelstring_), button_dim(rhs.button_dim), - openinlined_(rhs.openinlined_), - auto_open_(rhs.auto_open_), - // the sole purpose of this copy constructor - mouse_hover_() -{ -} + openinlined_(rhs.openinlined_) +{} InsetCollapsable::~InsetCollapsable() @@ -182,7 +180,7 @@ Dimension InsetCollapsable::dimensionCollapsed(BufferView const & bv) const void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const { - auto_open_[mi.base.bv] = mi.base.bv->cursor().isInside(this); + auto_open_[mi.base.bv] = mi.base.bv->cursor().isInside(this); FontInfo tmpfont = mi.base.font; mi.base.font = getLayout().font(); @@ -250,7 +248,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const { BufferView const & bv = *pi.base.bv; - auto_open_[&bv] = bv.cursor().isInside(this); + auto_open_[&bv] = bv.cursor().isInside(this); FontInfo tmpfont = pi.base.font; pi.base.font = getLayout().font(); diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 15c990c880..30a66d35b5 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -59,6 +59,13 @@ InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p, {} +// The sole purpose of this copy constructor is to make sure +// that the mouse_hover_ map is not copied and remains empty. +InsetCommand::InsetCommand(InsetCommand const & rhs) + : Inset(rhs), p_(rhs.p_), mailer_name_(rhs.mailer_name_) +{} + + InsetCommand::~InsetCommand() { if (!mailer_name_.empty()) diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index 57c9c0443a..5952b33dae 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -38,6 +38,8 @@ public: InsetCommand(Buffer *, InsetCommandParams const &, std::string const & mailer_name); /// + InsetCommand(InsetCommand const & rhs); + /// ~InsetCommand(); /// returns true if params are successfully read