From 844d8d0b276b3bcc9baceb1627acaaac9e93592a Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 29 Dec 2010 15:36:35 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37037 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/Inset.h | 2 ++ src/mathed/InsetMath.h | 2 ++ src/rowpainter.cpp | 7 ++++++- status.16x | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 777bbd48ad..1230017307 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -121,6 +121,8 @@ public: /// 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? diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index 3c2f0c79f9..bf0dc7b1a0 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -96,6 +96,8 @@ public: 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; } diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index 070b529249..f66668ce3c 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -40,6 +40,8 @@ #include "insets/InsetText.h" +#include "mathed/InsetMath.h" + #include "support/debug.h" #include "support/textutils.h" @@ -687,7 +689,10 @@ void RowPainter::paintOnlyInsets() // 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() diff --git a/status.16x b/status.16x index 1e9c6cbe8b..b85623b72f 100644 --- a/status.16x +++ b/status.16x @@ -120,6 +120,9 @@ What's new (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).