]> git.lyx.org Git - features.git/commitdiff
Use real counter in deleted footnotes
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 17:16:34 +0000 (18:16 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 17:16:34 +0000 (18:16 +0100)
src/insets/InsetFoot.cpp

index 5b1152754ce49cab7b9dfaf68b3bcd1a3c2c3812..5459f457c978970fdbd192df1c4d886e0aeebc35 100644 (file)
@@ -85,13 +85,13 @@ void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
        docstring const & count = il.counter();
        custom_label_ = translateIfPossible(il.labelstring());
 
-       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("#");
+       int val = cnts.value(count);
+       if (cnts.hasCounter(count))
+               cnts.step(count, utype);
+       custom_label_ += ' ' + cnts.theCounter(count, lang->code());
+       if (deleted)
+               // un-step after deleted counter
+               cnts.set(count, val);
        setLabel(custom_label_);
 
        InsetCollapsible::updateBuffer(it, utype, deleted);