]> 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>
Tue, 4 Aug 2020 14:52:58 +0000 (16:52 +0200)
Fixes #11920

src/Buffer.cpp
src/Paragraph.cpp

index c8c18f2beef7c05f9c16cf462e3a6b3440b4cfa6..dff7faec2f474d3e65a6a3c6eb1d82ab4d9b9216 100644 (file)
@@ -5242,11 +5242,6 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype, bool const dele
        // 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();
        bool changed = false;
index f2d97fe7c97cb9dbc60eac15e39e056391b14ec8..1c8f03057ae9f2331488edcf5569f22dfb4a222f 100644 (file)
@@ -4065,7 +4065,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;
@@ -4097,6 +4097,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;
        }