commit 65b4c3fcd22cc14b58cc2d42ad61cd367481b08b
Author: Enrico Forestieri <[email protected]>
Date:   Sun Oct 2 14:59:03 2022 +0200

    Fix bug #12580
    
    This amends [4a7a1935/lyxgit]. Before 4a7a1935 it was assumed
    that a labeled row was also numbered. Hence, when unnumbering
    a row a label was also deleted. We now have to do this explicitly.
---
 src/mathed/InsetMathHull.cpp |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index ec5a58e..0ab06d2 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1825,11 +1825,22 @@ void InsetMathHull::doDispatch(Cursor & cur, 
FuncRequest & cmd)
                //lyxerr << "toggling all numbers" << endl;
                cur.recordUndoInset();
                bool old = numberedType();
-               if (type_ == hullMultline)
-                       numbered(nrows() - 1, !old);
-               else
-                       for (row_type row = 0; row < nrows(); ++row)
+               if (type_ == hullMultline) {
+                       row_type row = nrows() - 1;
+                       numbered(row, !old);
+                       if (old && label_[row]) {
+                               delete label_[row];
+                               label_[row] = 0;
+                       }
+               } else {
+                       for (row_type row = 0; row < nrows(); ++row) {
                                numbered(row, !old);
+                               if (old && label_[row]) {
+                                       delete label_[row];
+                                       label_[row] = 0;
+                               }
+                       }
+               }
 
                cur.message(old ? _("No number") : _("Number"));
                cur.forceBufferUpdate();
@@ -1842,6 +1853,10 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest 
& cmd)
                bool old = numbered(r);
                cur.message(old ? _("No number") : _("Number"));
                numbered(r, !old);
+               if (old && label_[r]) {
+                       delete label_[r];
+                       label_[r] = 0;
+               }
                cur.forceBufferUpdate();
                break;
        }
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to