}
-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, /**/);
// 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();
}
/// \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
/// 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;
}
-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 ?
}
setButtonLabel();
- InsetCollapsible::updateBuffer(it, utype);
+ InsetCollapsible::updateBuffer(it, utype, deleted);
}
///
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 { }
///
// 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();
///
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
}
-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
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;
}
-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);
}
///
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.
}
-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();
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())
}
// Do the real work now.
- InsetText::updateBuffer(it, utype);
+ InsetText::updateBuffer(it, utype, deleted);
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
///
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;
///
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();
// 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)
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:
}
-void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
+void InsetCitation::updateBuffer(ParIterator const &, UpdateType, bool const /*deleted*/)
{
if (!cache.recalculate && buffer().citeLabelsValid())
return;
///
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;
}
-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();
// need a layout flag
cnts.saveLastCounter();
}
- InsetCollapsible::updateBuffer(it, utype);
+ InsetCollapsible::updateBuffer(it, utype, deleted);
if (save_counter)
cnts.restoreLastCounter();
}
///
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:
///
}
-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();
custom_label_ += ' ' + from_ascii("#");
setLabel(custom_label_);
- InsetCollapsible::updateBuffer(it, utype);
+ InsetCollapsible::updateBuffer(it, utype, deleted);
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
///
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;
///
}
-void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
{
file_exist_ = includedFileExist();
return;
if (label_)
- label_->updateBuffer(it, utype);
+ label_->updateBuffer(it, utype, deleted);
InsetListingsParams const par(to_utf8(params()["lstparams"]));
if (par.getParamValue("caption").empty()) {
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;
//@}
}
-void InsetPrintIndex::updateBuffer(ParIterator const &, UpdateType)
+void InsetPrintIndex::updateBuffer(ParIterator const &, UpdateType, bool const /*deleted*/)
{
Index const * index =
buffer().masterParams().indiceslist().findShortcut(getParam("type"));
///
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.
}
-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.
// Just to do something with that string
LYXERR(Debug::INFO, "info inset text: " << gui);
- InsetCollapsible::updateBuffer(it, utype);
+ InsetCollapsible::updateBuffer(it, utype, deleted);
}
///
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;
///
}
-void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype)
+void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype, bool const /*deleted*/)
{
docstring const & label = getParam("name");
///
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;
}
-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());
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;
}
-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.
///
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;
}
-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();
/// 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;
}
-void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
{
ParIterator it2 = it;
it2.forwardPos();
cnt.clearLastLayout();
// FIXME cnt.saveLastCounter()?
}
- buffer().updateBuffer(it2, utype);
+ buffer().updateBuffer(it2, utype, deleted);
if (save_layouts) {
// LYXERR0("Exiting " << name());
cnt.restoreLastLayout();
// 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);
}
}
{ 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);
///
}
-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);
}
///
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);
///
}
-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);
}
///
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,<,>
} // 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
// 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);
}
///
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;
}
-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);
}
/// 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
}
-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);
}
}
/// 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);