commit 20d5851fb7ad2d03e499f7f59f022a771cee9a93
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Jul 25 22:13:35 2022 +0200

    Regenerate equations previews when their numbering changes.
    
    Time will tell whether this is too expensive (because most equations
    after this on will change too, unless equations are numbered by
    section).
    
    Related to bug #11535.
---
 src/mathed/InsetMathHull.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 8ea552d..a9dd9fd 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -257,6 +257,7 @@ void InsetMathHull::updateBuffer(ParIterator const & it, 
UpdateType utype, bool
                docstring const eqstr = from_ascii("equation");
                if (cnts.hasCounter(eqstr)) {
                        for (size_t i = 0; i != label_.size(); ++i) {
+                               docstring const oldnumber = numbers_[i];
                                if (numbered(i)) {
                                        Paragraph const & par = it.paragraph();
                                        if (!par.isDeleted(it.pos())) {
@@ -266,6 +267,12 @@ void InsetMathHull::updateBuffer(ParIterator const & it, 
UpdateType utype, bool
                                                numbers_[i] = from_ascii("#");
                                } else
                                        numbers_[i] = empty_docstring();
+                               // If the numbering has changed, trigger a new 
preview
+                               if (oldnumber != numbers_[i] && 
RenderPreview::previewMath()) {
+                                       // Do we need to remove it first?
+                                       //preview_->removePreview(*buffer_);
+                                       preparePreview(it);
+                               }
                        }
                }
        }
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to