]> git.lyx.org Git - features.git/commitdiff
Do not step counters in deleted material.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Thu, 3 May 2018 03:56:41 +0000 (23:56 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Thu, 3 May 2018 03:56:41 +0000 (23:56 -0400)
Also, display the counter as "#" if the inset is deleted.

src/insets/InsetFlex.cpp
src/insets/InsetFoot.cpp

index 61e47d4c367f1737a4e69e821937b4abf09040a9..31828b615ffbd808ea7e972e2c3ecbd252114b35 100644 (file)
@@ -146,9 +146,13 @@ void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype)
        docstring const & count = il.counter();
        bool const have_counter = cnts.hasCounter(count);
        if (have_counter) {
-               cnts.step(count, utype);
-               custom_label += ' ' +
-                       cnts.theCounter(count, it.paragraph().getParLanguage(bp)->code());
+               Paragraph const & par = it.paragraph();
+               if (!par.isDeleted(it.pos())) {
+                       cnts.step(count, utype);
+                       custom_label += ' ' +
+                               cnts.theCounter(count, it.paragraph().getParLanguage(bp)->code());
+               } else
+                       custom_label += ' ' + from_ascii("#");
        }
        setLabel(custom_label);
 
index 29890d136523a4845b3ad3e91ef9d8b41d4ea190..3331184887aa52ea0b6dc128b378ac0fff3bbf81 100644 (file)
@@ -84,9 +84,14 @@ void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype)
        InsetLayout const & il = getLayout();
        docstring const & count = il.counter();
        custom_label_ = translateIfPossible(il.labelstring());
-       if (cnts.hasCounter(count))
-               cnts.step(count, utype);
-       custom_label_ += ' ' + cnts.theCounter(count, lang->code());
+
+       Paragraph const & par = it.paragraph();
+       if (!par.isDeleted(it.pos())) {
+               if (cnts.hasCounter(count))
+                       cnts.step(count, utype);
+               custom_label_ += ' ' + cnts.theCounter(count, lang->code());
+       } else
+               custom_label_ += ' ' + from_ascii("#");
        setLabel(custom_label_);
 
        InsetCollapsible::updateBuffer(it, utype);