]> git.lyx.org Git - lyx.git/commitdiff
Tell updateBuffer whether an inset is deleted.
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 12:23:01 +0000 (13:23 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 12:23:01 +0000 (13:23 +0100)
Fixes #11747

47 files changed:
src/Buffer.cpp
src/Buffer.h
src/insets/Inset.h
src/insets/InsetArgument.cpp
src/insets/InsetArgument.h
src/insets/InsetBibitem.cpp
src/insets/InsetBibitem.h
src/insets/InsetBibtex.cpp
src/insets/InsetBibtex.h
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetCaptionable.cpp
src/insets/InsetCaptionable.h
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h
src/insets/InsetFlex.cpp
src/insets/InsetFlex.h
src/insets/InsetFoot.cpp
src/insets/InsetFoot.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetIndex.cpp
src/insets/InsetIndex.h
src/insets/InsetInfo.cpp
src/insets/InsetInfo.h
src/insets/InsetLabel.cpp
src/insets/InsetLabel.h
src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h
src/insets/InsetRef.cpp
src/insets/InsetRef.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.cpp
src/insets/InsetText.h
src/insets/InsetWrap.cpp
src/insets/InsetWrap.h
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathHull.h
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathNest.h
src/mathed/MathData.cpp
src/mathed/MathData.h

index e20c78a2fa1bcb022bb509622443f2691f2c7c16..11241afa4e962b923287935688eb86d9f34db4d8 100644 (file)
@@ -5219,7 +5219,7 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const
 }
 
 
-void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
+void Buffer::updateBuffer(ParIterator & parit, UpdateType utype, bool const deleted) const
 {
        // LASSERT: Is it safe to continue here, or should we just return?
        LASSERT(parit.pit() == 0, /**/);
@@ -5265,7 +5265,7 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
                // now the insets
                for (auto const & insit : parit->insetList()) {
                        parit.pos() = insit.pos;
-                       insit.inset->updateBuffer(parit, utype);
+                       insit.inset->updateBuffer(parit, utype, deleted || parit->isDeleted(insit.pos));
                        changed |= insit.inset->isChanged();
                }
 
index 7b965de7c24764ae130639e4886641c390307d82..e717e463bd08c0d9a80d296a0c9585327b98ca5b 100644 (file)
@@ -738,7 +738,7 @@ public:
        /// \param output: whether we are preparing for output.
        void updateBuffer(UpdateScope scope, UpdateType utype) const;
        ///
-       void updateBuffer(ParIterator & parit, UpdateType utype) const;
+       void updateBuffer(ParIterator & parit, UpdateType utype, bool const deleted = false) const;
 
        /// Spellcheck starting from \p from.
        /// \p from initial position, will then points to the next misspelled
index ab35584e126c06a830b3cee11fa294ec4008c474..457ff44cb916095218ec24ea255853c888268206 100644 (file)
@@ -560,7 +560,7 @@ public:
        /// Update the counters of this inset and of its contents.
        /// The boolean indicates whether we are preparing for output, e.g.,
        /// of XHTML.
-       virtual void updateBuffer(ParIterator const &, UpdateType) {}
+       virtual void updateBuffer(ParIterator const &, UpdateType, bool const) {}
 
        /// Updates the inset's dialog
        virtual Buffer const * updateFrontend() const;
index 5dd8644fa3131fe4c92a4d1cc9aabe2f6552f86c..00484f791f49154f617811b72e705fc54909d66e 100644 (file)
@@ -62,7 +62,7 @@ void InsetArgument::read(Lexer & lex)
 }
 
 
-void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        bool const insetlayout = !it.paragraph().layout().hasArgs();
        Layout::LaTeXArgMap const args = insetlayout ?
@@ -157,7 +157,7 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
        }
 
        setButtonLabel();
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
 }
 
 
index 5c63702262595a3295bd2b67104efd847386bbce..15d3b85fd254b43c8992dc5039451a88837c0d68 100644 (file)
@@ -48,7 +48,7 @@ public:
        ///
        docstring layoutName() const { return from_ascii("Argument"); }
        /// Update the label string of this inset
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void latex(otexstream &, OutputParams const &) const { }
        ///
index 1c1962c0e635c45246d2c0b9c336c04c2b6226d8..c70e92ea734866aa16ba6f0cc0a1cef80e0775f4 100644 (file)
@@ -327,7 +327,7 @@ void InsetBibitem::collectBibKeys(InsetIterator const & it, FileNameList & /*che
 
 
 // Update the counters of this inset and of its contents
-void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype, bool const /*deleted*/)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Counters & counters = bp.documentClass().counters();
index ba33732ad0b01d33a7ee6c6ce02d1df6235b508e..eda3a4626f8fee03a1fdc98e7902504bc67f873c 100644 (file)
@@ -62,7 +62,7 @@ public:
        ///
        void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
        /// update the counter of this inset
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///@}
 
        /// \name Static public methods obligated for InsetCommand derived classes
index 5ed6ff3d4271336b1fe26ff5083cbf640fba11b3..e2b88ca1a9673ebfc09912dc3999be4d79f66ec3 100644 (file)
@@ -899,7 +899,7 @@ void InsetBibtex::validate(LaTeXFeatures & features) const
 }
 
 
-void InsetBibtex::updateBuffer(ParIterator const &, UpdateType)
+void InsetBibtex::updateBuffer(ParIterator const &, UpdateType, bool const /*deleted*/)
 {
        buffer().registerBibfiles(getBibFiles());
        // record encoding of bib files for biblatex
index fd447f8cb35a87c1d45947740331542eacb236b2..a46619367bc4df2ab02f826f64ead6c8331d9939 100644 (file)
@@ -55,7 +55,7 @@ public:
        int plaintext(odocstringstream & ods, OutputParams const & op,
                      size_t max_length = INT_MAX) const;
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index 6afa0c72ea6f575491359a7949e5de09dc0e5d8c..ad7cbc5cdc21fb6f83efc517a2be06a1842790b8 100644 (file)
@@ -402,10 +402,10 @@ void InsetBranch::string2params(string const & in, InsetBranchParams & params)
 }
 
 
-void InsetBranch::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetBranch::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        setLabel(params_.branch + (params_.inverted ? " (-)" : ""));
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
 }
 
 
index 6ac8a6744083ff0794bfc0b4e9275dec0176f951..be926d99f5fac324410526672674777407ffdc7a 100644 (file)
@@ -88,7 +88,7 @@ private:
        ///
        std::string contextMenuName() const;
        ///
-       void updateBuffer(ParIterator const & it, UpdateType utype);
+       void updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted = false);
 
        /** \returns true if params_.branch is listed as 'selected' in
                \c buffer. \p child only checks within child documents.
index 43147ff8646ce03a9cf77ba541155fe174fc54ed..6b20876b5b0080bc8cd5ebfb5ac47f311cd9b8e7 100644 (file)
@@ -369,7 +369,7 @@ docstring InsetCaption::getCaptionAsHTML(XHTMLStream & xs,
 }
 
 
-void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        Buffer const & master = *buffer().masterBuffer();
        DocumentClass const & tclass = master.params().documentClass();
@@ -406,10 +406,14 @@ void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
                docstring const labelstring = isAscii(lstring) ?
                                master.B_(to_ascii(lstring)) : lstring;
                if (cnts.hasCounter(counter)) {
+                       int val = cnts.value(counter);
                        // for longtables, we step the counter upstream
                        if (!cnts.isLongtable())
                                cnts.step(counter, utype);
                        sec = cnts.theCounter(counter, lang);
+                       if (deleted && !cnts.isLongtable())
+                               // un-step after deleted counter
+                               cnts.set(counter, val);
                }
                if (labelstring != master.B_("standard")) {
                        if (!sec.empty())
@@ -423,7 +427,7 @@ void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
        }
 
        // Do the real work now.
-       InsetText::updateBuffer(it, utype);
+       InsetText::updateBuffer(it, utype, deleted);
        if (utype == OutputUpdate)
                cnts.restoreLastCounter();
 }
index 6cd6aa417dbd25403642c1f4e2994e32f506361f..a1d14659fbf387c143ce747e6aa26b2aca03b52d 100644 (file)
@@ -69,7 +69,7 @@ private:
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
        // Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted);
        ///
        void latex(otexstream & os, OutputParams const &) const;
        ///
index 467106fa43e3e10888b7d68e633a4ca03aa5e96a..1a2e5f0670f64ab07c1edd2b608c610e79d9ec38 100644 (file)
@@ -114,7 +114,7 @@ void InsetCaptionable::addToToc(DocIterator const & cpit, bool output_active,
        b.pop();
 }
 
-void InsetCaptionable::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetCaptionable::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        Counters & cnts =
                buffer().masterBuffer()->params().documentClass().counters();
@@ -131,7 +131,7 @@ void InsetCaptionable::updateBuffer(ParIterator const & it, UpdateType utype)
        // Tell captions what the current float is
        cnts.current_float(caption_type_);
        cnts.isSubfloat(subflt);
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
        // Restore counters
        cnts.current_float(saveflt);
        if (utype == OutputUpdate)
index 8d0b486bcff7b3ccdb569f6cc9eea58eaba5d0b2..870489888cae4e0239e3562514fae73f8fc8c69f 100644 (file)
@@ -45,7 +45,7 @@ protected:
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
        /// Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        bool insetAllowed(InsetCode) const;
 private:
index 1071d5280eb86d0503eb96e9c0ea079db16a2f3d..7285009b894e6d1c213e6796d703ec1fe372be5e 100644 (file)
@@ -463,7 +463,7 @@ docstring InsetCitation::screenLabel() const
 }
 
 
-void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
+void InsetCitation::updateBuffer(ParIterator const &, UpdateType, bool const /*deleted*/)
 {
        if (!cache.recalculate && buffer().citeLabelsValid())
                return;
index 9ac4e0bbd16a07dd26a2ede5a2ff555162ef5379..b2a738cd9e10af24a4e95ae91e55d18d0eef5b69 100644 (file)
@@ -64,7 +64,7 @@ public:
        ///
        void forOutliner(docstring &, size_t const, bool const) const;
        ///
-       void updateBuffer(ParIterator const & it, UpdateType);
+       void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index 05c48f68eceb2275eb5a45b872f2e7163fc9a448..c91d65ec377c07773a67f3e254e25f4113dd1115 100644 (file)
@@ -140,7 +140,7 @@ void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd)
 }
 
 
-void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        InsetLayout const & il = getLayout();
@@ -167,7 +167,7 @@ void InsetFlex::updateBuffer(ParIterator const & it, UpdateType utype)
                // need a layout flag
                cnts.saveLastCounter();
        }
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
        if (save_counter)
                cnts.restoreLastCounter();
 }
index 0844246769e7b76a344a855fa4fae68d4b942427..f4d091a1272ca18dcc7f37e80698816594f78129 100644 (file)
@@ -44,7 +44,7 @@ public:
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       void updateBuffer(ParIterator const & it, UpdateType utype);
+       void updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted = false);
 
 protected:
        ///
index 3331184887aa52ea0b6dc128b378ac0fff3bbf81..5b1152754ce49cab7b9dfaf68b3bcd1a3c2c3812 100644 (file)
@@ -49,7 +49,7 @@ docstring InsetFoot::layoutName() const
 }
 
 
-void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Counters & cnts = bp.documentClass().counters();
@@ -94,7 +94,7 @@ void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype)
                custom_label_ += ' ' + from_ascii("#");
        setLabel(custom_label_);
 
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
        if (utype == OutputUpdate)
                cnts.restoreLastCounter();
 }
index 04e03fde7b0fd0fc57fec11171e30dd26fd2f9e3..194661a9b2a22a2e336aea9071abcbaba41b3f92 100644 (file)
@@ -39,7 +39,7 @@ private:
        ///
        void validate(LaTeXFeatures & features) const;
        /// Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
index 09d4be3cc76c55a2dc9bb382800fda72d4db5fab..9912695c362317f076f9194ebe4480b08a2b9611 100644 (file)
@@ -1373,7 +1373,7 @@ void InsetInclude::updateCommand()
 }
 
 
-void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        file_exist_ = includedFileExist();
 
@@ -1388,7 +1388,7 @@ void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
                return;
 
        if (label_)
-               label_->updateBuffer(it, utype);
+               label_->updateBuffer(it, utype, deleted);
 
        InsetListingsParams const par(to_utf8(params()["lstparams"]));
        if (par.getParamValue("caption").empty()) {
index 69c778e2723d84db5281a1c74644886a8a08867a..6ba8b6398288af4c9d9d03cfc7600f9137336157 100644 (file)
@@ -104,7 +104,7 @@ public:
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        std::string contextMenuName() const;
        //@}
index f3fafce60b00d8af9d62813a074fa3314236634a..5e375e9fdbea0ca40911a228b391da94d96f29c6 100644 (file)
@@ -576,7 +576,7 @@ bool InsetPrintIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetPrintIndex::updateBuffer(ParIterator const &, UpdateType)
+void InsetPrintIndex::updateBuffer(ParIterator const &, UpdateType, bool const /*deleted*/)
 {
        Index const * index =
                buffer().masterParams().indiceslist().findShortcut(getParam("type"));
index 01bf7096b08b5d0b8f074b92103df8f2d2eb53e2..504eb84720a860b6107ec8634c5dc1c3cc04b8fa 100644 (file)
@@ -111,7 +111,7 @@ public:
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        ///
-       void updateBuffer(ParIterator const & it, UpdateType);
+       void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false);
        ///
        std::string contextMenuName() const;
        /// Updates needed features for this inset.
index f0f731bff2bfaa3ac98a5d9eda9aa0c762ac8920..db64a2d366a7366a207aff1e12d7bd3e59c6b549 100644 (file)
@@ -749,7 +749,7 @@ bool InsetInfo::forceLTR(OutputParams const &) const
 }
 
 
-void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
+void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted) {
        // If the Buffer is a clone, then we neither need nor want to do any
        // of what follows. We want, rather, just to inherit how things were
        // in the original Buffer. This is especially important for VCS.
@@ -1168,7 +1168,7 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
 
        // Just to do something with that string
        LYXERR(Debug::INFO, "info inset text: " << gui);
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
 }
 
 
index fa3cfda72899f653a77dd2ede20ecbfdbae47479..bed5744a480a4e33e8900471082190769608c3be 100644 (file)
@@ -200,7 +200,7 @@ public:
        ///
        void setInfo(std::string const & info);
        ///
-       void updateBuffer(ParIterator const & it, UpdateType utype);
+       void updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted = false);
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
index 897b73f61ee2d6229caf573560b51c7ae3967f06..7850e5e838f8ffb070a5139cd77db088a62dd66f 100644 (file)
@@ -161,7 +161,7 @@ docstring InsetLabel::screenLabel() const
 }
 
 
-void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype)
+void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype, bool const /*deleted*/)
 {
        docstring const & label = getParam("name");
 
index ef4fed9cac2ee20eb5a7d752ca5ba4e7c4f76c7c..ab54e5e959f4f24e8c3d917a3011502ed112fffd 100644 (file)
@@ -57,7 +57,7 @@ public:
        ///
        docstring xhtml(XHTMLStream &, OutputParams const &) const;
        ///
-       void updateBuffer(ParIterator const & it, UpdateType);
+       void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index d34efa48cd4ed07d920c8c4d969f41e9b286da04..f7045c8131584112017f32d076eed7a95f86a03f 100644 (file)
@@ -989,7 +989,7 @@ void InsetQuotes::forOutliner(docstring & os, size_t const, bool const) const
 }
 
 
-void InsetQuotes::updateBuffer(ParIterator const & it, UpdateType /* utype*/)
+void InsetQuotes::updateBuffer(ParIterator const & it, UpdateType /* utype*/, bool const /*deleted*/)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Font const & font = it.paragraph().getFontSettings(bp, it.pos());
index 362a0e2dfa3254f49b88057a4614d34438d7c7e1..ea33b0eea00cb56560f1971e858ea141443fb4fd 100644 (file)
@@ -154,7 +154,7 @@ public:
        void forOutliner(docstring &, size_t const maxlen, bool const) const;
 
        /// Update the contextual information of this inset
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
 
        ///
        void validate(LaTeXFeatures &) const;
index de0a531e9ce266fa69a32ddd6364c06fb4535c10..fbcea451051754542a0c995400cb37bb8c6ed985 100644 (file)
@@ -398,7 +398,7 @@ void InsetRef::forOutliner(docstring & os, size_t const, bool const) const
 }
 
 
-void InsetRef::updateBuffer(ParIterator const & it, UpdateType)
+void InsetRef::updateBuffer(ParIterator const & it, UpdateType, bool const /*deleted*/)
 {
        docstring const & ref = getParam("reference");
        // register this inset into the buffer reference cache.
index 37a7c3ec3cdc61cc82c7f4c5b37d066fe9923720..91c9244510b9e6215608de2356d022c4fe11d2cb 100644 (file)
@@ -73,7 +73,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       void updateBuffer(ParIterator const & it, UpdateType);
+       void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index 7b4db191732032526bf4d72872f749744a16025b..e1ee36d676fe3d0d30c4ea21867d4ede44ef1127 100644 (file)
@@ -4693,7 +4693,7 @@ void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
 }
 
 
-void InsetTabular::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetTabular::updateBuffer(ParIterator const & it, UpdateType utype, bool const /*deleted*/)
 {
        // In a longtable, tell captions what the current float is
        Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
index 067141edd12c74c1fbf8fa9d8aca05d49b5321c6..3e8a6bcfab5a711001dfc8defd949cb861d98582 100644 (file)
@@ -1037,7 +1037,7 @@ public:
        /// can we go further down on mouse click?
        bool descendable(BufferView const &) const { return true; }
        /// Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index 47b9fc3a4894e5e85bc3b9a81f0ee7ebb6b4282a..3d7de487f6d1b224327d4bc36a999e8079ed75a8 100644 (file)
@@ -815,7 +815,7 @@ bool InsetText::insetAllowed(InsetCode code) const
 }
 
 
-void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        ParIterator it2 = it;
        it2.forwardPos();
@@ -829,7 +829,7 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
                        cnt.clearLastLayout();
                        // FIXME cnt.saveLastCounter()?
                }
-               buffer().updateBuffer(it2, utype);
+               buffer().updateBuffer(it2, utype, deleted);
                if (save_layouts) {
                        // LYXERR0("Exiting " << name());
                        cnt.restoreLastLayout();
@@ -845,7 +845,7 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
                // we need float information even in note insets (#9760)
                tclass.counters().current_float(savecnt.current_float());
                tclass.counters().isSubfloat(savecnt.isSubfloat());
-               buffer().updateBuffer(it2, utype);
+               buffer().updateBuffer(it2, utype, deleted);
                tclass.counters() = move(savecnt);
        }
 }
index 3e535cb3c7b91cae63ea8e6abe8b5386743bfeb1..6c9790b13556edbe0014920162e29b5fc8fde332 100644 (file)
@@ -172,7 +172,7 @@ public:
                { return getLayout().forcelocalfontswitch(); }
 
        /// Update the counters of this inset and of its contents
-       virtual void updateBuffer(ParIterator const &, UpdateType);
+       virtual void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void setMacrocontextPositionRecursive(DocIterator const & pos);
        ///
index b06ea4f700c91eed2712a0994a73789961e6ef86..fe56091a75501992e30281450a58cb7a1c2254f1 100644 (file)
@@ -127,9 +127,9 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetWrap::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetWrap::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
-       InsetCaptionable::updateBuffer(it, utype);
+       InsetCaptionable::updateBuffer(it, utype, deleted);
 }
 
 
index 588a3bc1e16aee37b793ef86a68039a9589df6d9..3bf837876a237e53abe32eeac3061c1dc606bd8b 100644 (file)
@@ -82,7 +82,7 @@ private:
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        /// Update the label
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
index 34fb53dcee471524809aae86064afcde71600ba8..bd9088fb02f600780d1c26567dc4b8b8d72a0938 100644 (file)
@@ -767,12 +767,12 @@ void InsetMathGrid::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
 }
 
 
-void InsetMathGrid::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetMathGrid::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        // pass down
        for (idx_type idx = 0; idx < nargs(); ++idx)
                if (cellinfo_[idx].multi != CELL_PART_OF_MULTICOLUMN)
-                       cell(idx).updateBuffer(it, utype);
+                       cell(idx).updateBuffer(it, utype, deleted);
 }
 
 
index 425a98a324640a73bbc87e03add4ea7517dff619..89c8e7f07911852590f83851a22e0574bc13eb8e 100644 (file)
@@ -113,7 +113,7 @@ public:
        ///
        void drawT(TextPainter & pi, int x, int y) const;
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        /// extract number of columns from alignment string
        static col_type guessColumns(docstring const & halign);
        /// accepts some LaTeX column codes: p,m,!,@,M,<,>
index b15594e19a4f9a8c0d9d86c276454b330a31e2eb..7754e4dcd639d087649d09832bec69ccd84ba03d 100644 (file)
@@ -279,7 +279,7 @@ namespace {
 } // namespace
 
 
-void InsetMathHull::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetMathHull::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        if (!buffer_) {
                //FIXME: buffer_ should be set at creation for this inset! Problem is
@@ -327,10 +327,10 @@ void InsetMathHull::updateBuffer(ParIterator const & it, UpdateType utype)
        // now the labels
        for (size_t i = 0; i != label_.size(); ++i) {
                if (label_[i])
-                       label_[i]->updateBuffer(it, utype);
+                       label_[i]->updateBuffer(it, utype, deleted);
        }
        // pass down
-       InsetMathGrid::updateBuffer(it, utype);
+       InsetMathGrid::updateBuffer(it, utype, deleted);
 }
 
 
index 672685d0ba9605e7ef69018c36d9c24a9c99fd90..9c27e0e374c29ad9a2a6ab38140af5cf55df5423 100644 (file)
@@ -49,7 +49,7 @@ public:
        ///
        void setBuffer(Buffer &);
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void addToToc(DocIterator const & di, bool output_active,
                                  UpdateType utype, TocBackend & backend) const;
index 4f6d150d32d50fa6d3f26db02e7759c820eaef1e..907d7d460807ce3de3e1365ca998e4dfde5ab175 100644 (file)
@@ -185,10 +185,10 @@ void InsetMathNest::cellsMetrics(MetricsInfo const & mi) const
 }
 
 
-void InsetMathNest::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetMathNest::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        for (idx_type i = 0, n = nargs(); i != n; ++i)
-               cell(i).updateBuffer(it, utype);
+               cell(i).updateBuffer(it, utype, deleted);
 }
 
 
index a009bd3234b73ebb2b094c2140df2c7453a15f81..703d2d879d152c7d573f2e1f115e335b6a0a4d4d 100644 (file)
@@ -38,7 +38,7 @@ public:
        /// draw background if locked
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        /// identifies NestInsets
        InsetMathNest * asNestInset() { return this; }
        /// identifies NestInsets
index 9bfd558fe2856d8e1475648b8c9b1963255cf25a..a2b044cac0d712592e11b2caef472344e7a32fbb 100644 (file)
@@ -386,12 +386,12 @@ int MathData::kerning(BufferView const * bv) const
 }
 
 
-void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
+void MathData::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        // pass down
        for (size_t i = 0, n = size(); i != n; ++i) {
                MathAtom & at = operator[](i);
-               at.nucleus()->updateBuffer(it, utype);
+               at.nucleus()->updateBuffer(it, utype, deleted);
        }
 }
 
index 3c93421821230f6b78bd8b1f7af3dfad5b44f6e6..fa6e80d31b429acbb22375a2e6d2a97fc627e178 100644 (file)
@@ -178,7 +178,7 @@ public:
        /// stay visually at the same position (cur==0 is allowed)
        void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType, int nesting);
        ///
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        void setBuffer(Buffer & b);