[LyX/2.3.x] Revert [9370135c3e/lyxgit] and fix #8499 properly

Juergen Spitzmueller spitz at lyx.org
Thu Aug 6 14:33:36 UTC 2020


commit 0994a9612dd2cfccfe36328cb0e2c00169ae20a2
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Aug 4 16:52:58 2020 +0200

    Revert [9370135c3e/lyxgit] and fix #8499 properly
    
    Fixes #11920
    
    (cherry picked from commit 7250aad280ceee21200b07c3e1e7cf52849c8e2d)
---
 src/Buffer.cpp    |    5 -----
 src/Paragraph.cpp |    4 +++-
 status.23x        |    2 ++
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 3a8fae7..4006a95 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -5267,11 +5267,6 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
 	// to resolve macros in it.
 	parit.text()->setMacrocontextPosition(parit);
 
-	// Reset bibitem counter in master (#8499)
-	Buffer const * const master = masterBuffer();
-	if (master == this && !d->ignore_parent)
-		master->params().documentClass().counters().reset(from_ascii("bibitem"));
-
 	depth_type maxdepth = 0;
 	pit_type const lastpit = parit.lastpit();
 	for ( ; parit.pit() <= lastpit ; ++parit.pit()) {
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 5b5a944..c77fbf9 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3705,7 +3705,7 @@ bool Paragraph::brokenBiblio() const
 int Paragraph::fixBiblio(Buffer const & buffer)
 {
 	// FIXME: when there was already an inset at 0, the return value is 1,
-	// which does not tell whether another inset has been remove; the
+	// which does not tell whether another inset has been removed; the
 	// cursor cannot be correctly updated.
 
 	bool const track_changes = buffer.params().track_changes;
@@ -3737,6 +3737,8 @@ int Paragraph::fixBiblio(Buffer const & buffer)
 		// than keep the first? (JMarc)
 		Inset * inset = releaseInset(bibitem_pos);
 		d->insetlist_.begin()->inset = inset;
+		// This needs to be done to update the counter (#8499)
+		buffer.updateBuffer();
 		return -bibitem_pos;
 	}
 
diff --git a/status.23x b/status.23x
index 080634f..7433362 100644
--- a/status.23x
+++ b/status.23x
@@ -80,6 +80,8 @@ What's new
 
 - Fix positioning of super- and subscripts with integral signs.
 
+- Fix counter in bibliography inset (bug 11920).
+
 
 * INTERNALS
 


More information about the lyx-cvs mailing list