]> git.lyx.org Git - lyx.git/commitdiff
Revert [9370135c3e/lyxgit] and fix #8499 properly
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 4 Aug 2020 14:52:58 +0000 (16:52 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 6 Aug 2020 14:58:46 +0000 (16:58 +0200)
Fixes #11920

(cherry picked from commit 7250aad280ceee21200b07c3e1e7cf52849c8e2d)

src/Buffer.cpp
src/Paragraph.cpp
status.23x

index 3a8fae7a57ade0753671936d2a9bbb3a967a88c0..4006a95c91137f79d9a8da79e358214bf7595768 100644 (file)
@@ -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()) {
index 5b5a94490cfd8a0de709ad2b71e5a9f9c50bf700..c77fbf974da8b48cd0eb1daffea106cf0f413b60 100644 (file)
@@ -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;
        }
 
index 080634f74e865b89c5baf09c6685fc6ca1895717..7433362e92568fbccd171f4cf4a67ea9503dbaf5 100644 (file)
@@ -80,6 +80,8 @@ What's new
 
 - Fix positioning of super- and subscripts with integral signs.
 
+- Fix counter in bibliography inset (bug 11920).
+
 
 * INTERNALS