Author: forenr
Date: Wed Dec 29 16:36:35 2010
New Revision: 37037
URL: http://www.lyx.org/trac/changeset/37037

Log:
Fix bugs #7174 (Math selection broken)
and      #7193 (Math macro template painting problem)

No status.16x entry is necessary for #7174 as this fixes a regression
introduced during the 1.6.9svn cycle by the fix for #4889.

Modified:
   lyx-devel/branches/BRANCH_1_6_X/src/insets/Inset.h
   lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMath.h
   lyx-devel/branches/BRANCH_1_6_X/src/rowpainter.cpp
   lyx-devel/branches/BRANCH_1_6_X/status.16x

Modified: lyx-devel/branches/BRANCH_1_6_X/src/insets/Inset.h
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/insets/Inset.h  Wed Dec 29 15:25:15 
2010        (r37036)
+++ lyx-devel/branches/BRANCH_1_6_X/src/insets/Inset.h  Wed Dec 29 16:36:35 
2010        (r37037)
@@ -121,6 +121,8 @@
 
        /// identification as math inset
        virtual InsetMath * asInsetMath() { return 0; }
+       /// identification as math inset
+       virtual InsetMath const * asInsetMath() const { return 0; }
        /// true for 'math' math inset, but not for e.g. mbox
        virtual bool inMathed() const { return false; }
        /// is this inset based on the InsetText class?

Modified: lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMath.h
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMath.h      Wed Dec 29 
15:25:15 2010        (r37036)
+++ lyx-devel/branches/BRANCH_1_6_X/src/mathed/InsetMath.h      Wed Dec 29 
16:36:35 2010        (r37037)
@@ -96,6 +96,8 @@
        InsetMath(Buffer * buf = 0) : Inset(buf) {}
        /// identification as math inset
        InsetMath * asInsetMath() { return this; }
+       /// identification as math inset
+       InsetMath const * asInsetMath() const { return this; }
        /// this is overridden in math text insets (i.e. mbox)
        bool inMathed() const { return true; }
 

Modified: lyx-devel/branches/BRANCH_1_6_X/src/rowpainter.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/rowpainter.cpp  Wed Dec 29 15:25:15 
2010        (r37036)
+++ lyx-devel/branches/BRANCH_1_6_X/src/rowpainter.cpp  Wed Dec 29 16:36:35 
2010        (r37037)
@@ -40,6 +40,8 @@
 
 #include "insets/InsetText.h"
 
+#include "mathed/InsetMath.h"
+
 #include "support/debug.h"
 #include "support/textutils.h"
 
@@ -687,7 +689,10 @@
                // If outer row has changed, nested insets are repaint 
completely.
                Inset const * inset = par_.getInset(pos);
                bool const nested_inset = inset &&
-                       (inset->asInsetText() || inset->asInsetTabular());
+                               ((inset->asInsetMath() &&
+                                 !inset->asInsetMath()->asMacroTemplate())
+                                || inset->asInsetText()
+                                || inset->asInsetTabular());
                if (!nested_inset)
                        continue;
                if (x_ > pi_.base.bv->workWidth() 

Modified: lyx-devel/branches/BRANCH_1_6_X/status.16x
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/status.16x  Wed Dec 29 15:25:15 2010        
(r37036)
+++ lyx-devel/branches/BRANCH_1_6_X/status.16x  Wed Dec 29 16:36:35 2010        
(r37037)
@@ -120,6 +120,9 @@
   (such as quotation marks) as well as the description of a caption
   (bug 4889).
 
+- Fix painting of math-macro templates while moving the cursor or
+  performing a selection with the mouse (bug 7193).
+
 - Fix unexpected behavior when inserting big math delimiters around a
   matrix (bug 7088).
 

Reply via email to