]> git.lyx.org Git - features.git/commitdiff
Fix bug #3900: Mathed corners displayed without mouse hover.
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 30 Apr 2010 14:55:37 +0000 (14:55 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 30 Apr 2010 14:55:37 +0000 (14:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34348 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/BufferView.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetCommand.cpp
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathNest.h

index 0a4e11bcb1c85ee91f38800ae5e52f0b79c97b07..0d852f500e11da857257b974340d76f17a946c3c 100644 (file)
@@ -403,11 +403,6 @@ bool BufferView::fitCursor()
 
 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)
@@ -1926,6 +1921,16 @@ void BufferView::updateHoveredInset() const
 }
 
 
+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;
index b9f19b1a3187a1200297ba274e991c2ab4f9c9d7..eaf063182bf4b6715a2d0e9dd797e1493af40104 100644 (file)
@@ -308,6 +308,8 @@ public:
        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
index e84d2432d9827ba18b531f3de8f0191896c16aa6..f68546275f8155cc6832503d0efc369e1ea0e002 100644 (file)
@@ -63,6 +63,16 @@ InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs)
 }
 
 
+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)
index d93ddae12a760e5d55b4766a079c5ece2bf6c64a..0ec354be7460e7e4b8c545e84a8a7e0401042516 100644 (file)
@@ -37,6 +37,8 @@ public:
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
        ///
+       ~InsetCollapsable();
+       ///
        InsetCollapsable * asInsetCollapsable() { return this; }
        ///
        InsetCollapsable const * asInsetCollapsable() const { return this; }
index d99ccd6c8df8189332c7886b183afcf081969db7..03d94422274e2166fade69aca7ff02ee8c2b29b1 100644 (file)
@@ -63,6 +63,11 @@ InsetCommand::~InsetCommand()
 {
        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);
 }
 
 
index 4fae4f5ba5d55928152750e93969a5045e8becf0..21b16a7258f9d8b640a2ca9a329e59a42e24b993 100644 (file)
@@ -91,6 +91,16 @@ InsetMathNest::InsetMathNest(InsetMathNest const & inset)
 {}
 
 
+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_;
index 39fa62b630c1482a7b62336533a312d5ef63336f..d9c1f09f428462e50800f76fd27c6fe3701cabe4 100644 (file)
@@ -31,7 +31,7 @@ public:
        /// nestinsets have a fixed size to start with
        InsetMathNest(Buffer * buf, idx_type ncells);
        ///
-       virtual ~InsetMathNest() {}
+       virtual ~InsetMathNest();
        ///
        void setBuffer(Buffer &);