]> git.lyx.org Git - features.git/commitdiff
Fix the assertion assert introduced in r34348 which got fired when eg. deselecting...
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 1 May 2010 23:04:08 +0000 (23:04 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 1 May 2010 23:04:08 +0000 (23:04 +0000)
- we have to have a copy constructor in InsetCommand to clear the mouse_hover_ map and not to copy it,
- there is no need to have mouse_hover_() in the initialisation list,
- there is no need to copy the auto_open_ map.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34353 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp
src/insets/InsetCommand.cpp
src/insets/InsetCommand.h

index f68546275f8155cc6832503d0efc369e1ea0e002..74c53ef61bac6c8166621e5de7ded38822f5b0d0 100644 (file)
@@ -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();
index 15c990c8801fb60a613b8ad73e24c67bad0868f6..30a66d35b51f4b400b054f2d25dd110489cd87e6 100644 (file)
@@ -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())
index 57c9c0443a4d0c77cc8ad04d6ac08b0291ad8795..5952b33dae1ffbb11b2405c573ef1a424d370290 100644 (file)
@@ -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