[LyX/master] Tell updateBuffer whether an inset is deleted.

Juergen Spitzmueller spitz at lyx.org
Fri Mar 6 12:04:29 UTC 2020


commit d94b708a0fec6ade04fc9d09bd86afd73e72fac7
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Mar 6 13:23:01 2020 +0100

    Tell updateBuffer whether an inset is deleted.
    
    Fixes #11747
---
 src/Buffer.cpp                  |    4 ++--
 src/Buffer.h                    |    2 +-
 src/insets/Inset.h              |    2 +-
 src/insets/InsetArgument.cpp    |    4 ++--
 src/insets/InsetArgument.h      |    2 +-
 src/insets/InsetBibitem.cpp     |    2 +-
 src/insets/InsetBibitem.h       |    2 +-
 src/insets/InsetBibtex.cpp      |    2 +-
 src/insets/InsetBibtex.h        |    2 +-
 src/insets/InsetBranch.cpp      |    4 ++--
 src/insets/InsetBranch.h        |    2 +-
 src/insets/InsetCaption.cpp     |    8 ++++++--
 src/insets/InsetCaption.h       |    2 +-
 src/insets/InsetCaptionable.cpp |    4 ++--
 src/insets/InsetCaptionable.h   |    2 +-
 src/insets/InsetCitation.cpp    |    2 +-
 src/insets/InsetCitation.h      |    2 +-
 src/insets/InsetFlex.cpp        |    4 ++--
 src/insets/InsetFlex.h          |    2 +-
 src/insets/InsetFoot.cpp        |    4 ++--
 src/insets/InsetFoot.h          |    2 +-
 src/insets/InsetInclude.cpp     |    4 ++--
 src/insets/InsetInclude.h       |    2 +-
 src/insets/InsetIndex.cpp       |    2 +-
 src/insets/InsetIndex.h         |    2 +-
 src/insets/InsetInfo.cpp        |    4 ++--
 src/insets/InsetInfo.h          |    2 +-
 src/insets/InsetLabel.cpp       |    2 +-
 src/insets/InsetLabel.h         |    2 +-
 src/insets/InsetQuotes.cpp      |    2 +-
 src/insets/InsetQuotes.h        |    2 +-
 src/insets/InsetRef.cpp         |    2 +-
 src/insets/InsetRef.h           |    2 +-
 src/insets/InsetTabular.cpp     |    2 +-
 src/insets/InsetTabular.h       |    2 +-
 src/insets/InsetText.cpp        |    6 +++---
 src/insets/InsetText.h          |    2 +-
 src/insets/InsetWrap.cpp        |    4 ++--
 src/insets/InsetWrap.h          |    2 +-
 src/mathed/InsetMathGrid.cpp    |    4 ++--
 src/mathed/InsetMathGrid.h      |    2 +-
 src/mathed/InsetMathHull.cpp    |    6 +++---
 src/mathed/InsetMathHull.h      |    2 +-
 src/mathed/InsetMathNest.cpp    |    4 ++--
 src/mathed/InsetMathNest.h      |    2 +-
 src/mathed/MathData.cpp         |    4 ++--
 src/mathed/MathData.h           |    2 +-
 47 files changed, 68 insertions(+), 64 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index e20c78a..11241af 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -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();
 		}
 
diff --git a/src/Buffer.h b/src/Buffer.h
index 7b965de..e717e46 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -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
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index ab35584..457ff44 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -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;
diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp
index 5dd8644..00484f7 100644
--- a/src/insets/InsetArgument.cpp
+++ b/src/insets/InsetArgument.cpp
@@ -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);
 }
 
 
diff --git a/src/insets/InsetArgument.h b/src/insets/InsetArgument.h
index 5c63702..15d3b85 100644
--- a/src/insets/InsetArgument.h
+++ b/src/insets/InsetArgument.h
@@ -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 { }
 	///
diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp
index 1c1962c..c70e92e 100644
--- a/src/insets/InsetBibitem.cpp
+++ b/src/insets/InsetBibitem.cpp
@@ -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();
diff --git a/src/insets/InsetBibitem.h b/src/insets/InsetBibitem.h
index ba33732..eda3a46 100644
--- a/src/insets/InsetBibitem.h
+++ b/src/insets/InsetBibitem.h
@@ -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
diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index 5ed6ff3..e2b88ca 100644
--- a/src/insets/InsetBibtex.cpp
+++ b/src/insets/InsetBibtex.cpp
@@ -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
diff --git a/src/insets/InsetBibtex.h b/src/insets/InsetBibtex.h
index fd447f8..a466193 100644
--- a/src/insets/InsetBibtex.h
+++ b/src/insets/InsetBibtex.h
@@ -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;
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 6afa0c7..ad7cbc5 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -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);
 }
 
 
diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h
index 6ac8a67..be926d9 100644
--- a/src/insets/InsetBranch.h
+++ b/src/insets/InsetBranch.h
@@ -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.
diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp
index 43147ff..6b20876 100644
--- a/src/insets/InsetCaption.cpp
+++ b/src/insets/InsetCaption.cpp
@@ -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();
 }
diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h
index 6cd6aa4..a1d1465 100644
--- a/src/insets/InsetCaption.h
+++ b/src/insets/InsetCaption.h
@@ -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;
 	///
diff --git a/src/insets/InsetCaptionable.cpp b/src/insets/InsetCaptionable.cpp
index 467106f..1a2e5f0 100644
--- a/src/insets/InsetCaptionable.cpp
+++ b/src/insets/InsetCaptionable.cpp
@@ -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)
diff --git a/src/insets/InsetCaptionable.h b/src/insets/InsetCaptionable.h
index 8d0b486..8704898 100644
--- a/src/insets/InsetCaptionable.h
+++ b/src/insets/InsetCaptionable.h
@@ -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:
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index 1071d52..7285009 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -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;
diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h
index 9ac4e0b..b2a738c 100644
--- a/src/insets/InsetCitation.h
+++ b/src/insets/InsetCitation.h
@@ -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;
diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp
index 05c48f6..c91d65e 100644
--- a/src/insets/InsetFlex.cpp
+++ b/src/insets/InsetFlex.cpp
@@ -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();
 }
diff --git a/src/insets/InsetFlex.h b/src/insets/InsetFlex.h
index 0844246..f4d091a 100644
--- a/src/insets/InsetFlex.h
+++ b/src/insets/InsetFlex.h
@@ -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:
 	///
diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp
index 3331184..5b11527 100644
--- a/src/insets/InsetFoot.cpp
+++ b/src/insets/InsetFoot.cpp
@@ -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();
 }
diff --git a/src/insets/InsetFoot.h b/src/insets/InsetFoot.h
index 04e03fd..194661a 100644
--- a/src/insets/InsetFoot.h
+++ b/src/insets/InsetFoot.h
@@ -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;
 	///
diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp
index 09d4be3..9912695 100644
--- a/src/insets/InsetInclude.cpp
+++ b/src/insets/InsetInclude.cpp
@@ -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()) {
diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h
index 69c778e..6ba8b63 100644
--- a/src/insets/InsetInclude.h
+++ b/src/insets/InsetInclude.h
@@ -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;
 	//@}
diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index f3fafce..5e375e9 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -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"));
diff --git a/src/insets/InsetIndex.h b/src/insets/InsetIndex.h
index 01bf709..504eb84 100644
--- a/src/insets/InsetIndex.h
+++ b/src/insets/InsetIndex.h
@@ -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.
diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp
index f0f731b..db64a2d 100644
--- a/src/insets/InsetInfo.cpp
+++ b/src/insets/InsetInfo.cpp
@@ -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);
 }
 
 
diff --git a/src/insets/InsetInfo.h b/src/insets/InsetInfo.h
index fa3cfda..bed5744 100644
--- a/src/insets/InsetInfo.h
+++ b/src/insets/InsetInfo.h
@@ -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;
 	///
diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp
index 897b73f..7850e5e 100644
--- a/src/insets/InsetLabel.cpp
+++ b/src/insets/InsetLabel.cpp
@@ -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");
 
diff --git a/src/insets/InsetLabel.h b/src/insets/InsetLabel.h
index ef4fed9..ab54e5e 100644
--- a/src/insets/InsetLabel.h
+++ b/src/insets/InsetLabel.h
@@ -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;
diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp
index d34efa4..f7045c8 100644
--- a/src/insets/InsetQuotes.cpp
+++ b/src/insets/InsetQuotes.cpp
@@ -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());
diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h
index 362a0e2..ea33b0e 100644
--- a/src/insets/InsetQuotes.h
+++ b/src/insets/InsetQuotes.h
@@ -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;
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index de0a531..fbcea45 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -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.
diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h
index 37a7c3e..91c9244 100644
--- a/src/insets/InsetRef.h
+++ b/src/insets/InsetRef.h
@@ -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;
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 7b4db19..e1ee36d 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -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();
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index 067141e..3e8a6bc 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -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;
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 47b9fc3..3d7de48 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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);
 	}
 }
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index 3e535cb..6c9790b 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -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);
 	///
diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp
index b06ea4f..fe56091 100644
--- a/src/insets/InsetWrap.cpp
+++ b/src/insets/InsetWrap.cpp
@@ -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);
 }
 
 
diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h
index 588a3bc..3bf8378 100644
--- a/src/insets/InsetWrap.h
+++ b/src/insets/InsetWrap.h
@@ -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);
 	///
diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 34fb53d..bd9088f 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -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);
 }
 
 
diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h
index 425a98a..89c8e7f 100644
--- a/src/mathed/InsetMathGrid.h
+++ b/src/mathed/InsetMathGrid.h
@@ -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,<,>
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index b15594e..7754e4d 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -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);
 }
 
 
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index 672685d..9c27e0e 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -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;
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 4f6d150..907d7d4 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -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);
 }
 
 
diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h
index a009bd3..703d2d8 100644
--- a/src/mathed/InsetMathNest.h
+++ b/src/mathed/InsetMathNest.h
@@ -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
diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index 9bfd558..a2b044c 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -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);
 	}
 }
 
diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h
index 3c93421..fa6e80d 100644
--- a/src/mathed/MathData.h
+++ b/src/mathed/MathData.h
@@ -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);
 


More information about the lyx-cvs mailing list