[LyX/master] Use real counter in deleted footnotes

Juergen Spitzmueller spitz at lyx.org
Fri Mar 6 16:57:34 UTC 2020


commit b8cac52759f77564d35f40e479896c4266d9b9ac
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Mar 6 18:16:34 2020 +0100

    Use real counter in deleted footnotes
---
 src/insets/InsetFoot.cpp |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp
index 5b11527..5459f45 100644
--- a/src/insets/InsetFoot.cpp
+++ b/src/insets/InsetFoot.cpp
@@ -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);


More information about the lyx-cvs mailing list