]> git.lyx.org Git - features.git/commitdiff
Fixup f3a0e8ff: costly thinko
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 9 Apr 2021 16:15:31 +0000 (18:15 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 9 Apr 2021 16:15:31 +0000 (18:15 +0200)
When the buffer stuff has been updated, the Buffer::needUpdate()
should be reset to false. This was forgotten in f3a0e8ff.

Fixes performance issues with MergedManuals, for example. UpdateBuffer
would be run again and again when selecting text.

src/Buffer.cpp
src/Buffer.h

index c66b730d9d1ddcdcd6c59d586ef68615f88aae0a..c3d1276b8468d92f03f9d1dfe4c09d6035811f3d 100644 (file)
@@ -4914,6 +4914,13 @@ void Buffer::bufferRefs(TeXErrors const & terr, ErrorList & errorList) const
 }
 
 
+void Buffer::updateBuffer() const
+{
+       updateBuffer(UpdateMaster, InternalUpdate);
+       d->need_update = false;
+}
+
+
 void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
 {
        LBUFERR(!text().paragraphs().empty());
index 6d4f77c3fdaa15a2e923097cc060df63f998a8a1..e342199b254705e033cc8e4310ea8ca6e71a5cd0 100644 (file)
@@ -728,7 +728,7 @@ public:
        /// Updates screen labels and some other information associated with
        /// insets and paragraphs. Actually, it's more like a general "recurse
        /// through the Buffer" routine, that visits all the insets and paragraphs.
-       void updateBuffer() const { updateBuffer(UpdateMaster, InternalUpdate); }
+       void updateBuffer() const;
        /// \param scope: whether to start with the master document or just
        /// do this one.
        /// \param output: whether we are preparing for output.