summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
36f5607)
51 files changed:
{
LaTeXFeatures features(*this, params(), runparams);
validate(features);
{
LaTeXFeatures features(*this, params(), runparams);
validate(features);
- updateLabels(UpdateMaster, OutputUpdate);
+ updateBuffer(UpdateMaster, OutputUpdate);
checkBibInfoCache();
d->bibinfo_.makeCitationLabels(*this);
updateMacros();
checkBibInfoCache();
d->bibinfo_.makeCitationLabels(*this);
updateMacros();
-void Buffer::updateLabels(UpdateScope scope, UpdateType utype) const
+void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
{
// Use the master text class also for child documents
Buffer const * const master = masterBuffer();
{
// Use the master text class also for child documents
Buffer const * const master = masterBuffer();
// If this is a child document start with the master
if (master != this) {
bufToUpdate.insert(this);
// If this is a child document start with the master
if (master != this) {
bufToUpdate.insert(this);
- master->updateLabels(UpdateMaster, utype);
+ master->updateBuffer(UpdateMaster, utype);
// Do this here in case the master has no gui associated with it. Then,
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
if (!master->d->gui_)
// Do this here in case the master has no gui associated with it. Then,
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
if (!master->d->gui_)
// do the real work
ParIterator parit = cbuf.par_iterator_begin();
// do the real work
ParIterator parit = cbuf.par_iterator_begin();
- updateLabels(parit, utype);
+ updateBuffer(parit, utype);
if (master != this)
// TocBackend update will be done later.
if (master != this)
// TocBackend update will be done later.
-void Buffer::updateLabels(ParIterator & parit, UpdateType utype) const
+void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
{
LASSERT(parit.pit() == 0, /**/);
{
LASSERT(parit.pit() == 0, /**/);
InsetList::const_iterator end = parit->insetList().end();
for (; iit != end; ++iit) {
parit.pos() = iit->pos;
InsetList::const_iterator end = parit->insetList().end();
for (; iit != end; ++iit) {
parit.pos() = iit->pos;
- iit->inset->updateLabels(parit, utype);
+ iit->inset->updateBuffer(parit, utype);
bool const success = loadLyXFile(d->filename);
if (success) {
bool const success = loadLyXFile(d->filename);
if (success) {
changed(true);
markClean();
message(bformat(_("Document %1$s reloaded."), disp_fn));
changed(true);
markClean();
message(bformat(_("Document %1$s reloaded."), disp_fn));
/// Updates the cached bibliography information.
/// Note that you MUST call this method to update the cache. It will
/// not happen otherwise. (Currently, it is called at the start of
/// Updates the cached bibliography information.
/// Note that you MUST call this method to update the cache. It will
/// not happen otherwise. (Currently, it is called at the start of
- /// updateLabels() and from GuiCitation.)
+ /// updateBuffer() and from GuiCitation.)
void checkBibInfoCache() const;
/// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child.
void checkBibInfoCache() const;
/// \return the bibliography information for this buffer's master,
/// or just for it, if it isn't a child.
/// 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.
/// 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 updateLabels() const { updateLabels(UpdateMaster, InternalUpdate); }
+ void updateBuffer() const { updateBuffer(UpdateMaster, InternalUpdate); }
/// \param scope: whether to start with the master document or just
/// do this one.
/// \param output: whether we are preparing for output.
/// \param scope: whether to start with the master document or just
/// do this one.
/// \param output: whether we are preparing for output.
- void updateLabels(UpdateScope scope, UpdateType utype) const;
+ void updateBuffer(UpdateScope scope, UpdateType utype) const;
- void updateLabels(ParIterator & parit, UpdateType utype) const;
+ void updateBuffer(ParIterator & parit, UpdateType utype) const;
/// Spellcheck starting from \p from.
/// \p from initial position, will then points to the next misspelled
/// Spellcheck starting from \p from.
/// \p from initial position, will then points to the next misspelled
setCursor(backcur.asDocIterator(&buffer_));
buffer_.errors("Class Switch");
setCursor(backcur.asDocIterator(&buffer_));
buffer_.errors("Class Switch");
- buffer_.updateLabels();
+ buffer_.updateBuffer();
}
/** Return the change status at cursor position, taking in account the
}
/** Return the change status at cursor position, taking in account the
- buffer_.updateLabels();
+ buffer_.updateBuffer();
buffer_.changed(true);
return true;
}
buffer_.changed(true);
return true;
}
/// We're trying to track \refstepcounter in LaTeX, more or less.
/// Note that this may be empty.
docstring currentCounter() const;
/// We're trying to track \refstepcounter in LaTeX, more or less.
/// Note that this may be empty.
docstring currentCounter() const;
- /// Called during update labels as we go through various paragraphs,
+ /// Called during updateBuffer() as we go through various paragraphs,
/// to track the layouts as we go through.
void setActiveLayout(Layout const & lay);
/// to track the layouts as we go through.
void setActiveLayout(Layout const & lay);
- /// Also for updateLabels().
+ /// Also for updateBuffer().
/// Call this when entering things like footnotes, where there is now
/// no "last layout" and we want to restore the "last layout" on exit.
void clearLastLayout() { layout_stack_.push_back(0); }
/// Call this when entering things like footnotes, where there is now
/// no "last layout" and we want to restore the "last layout" on exit.
void clearLastLayout() { layout_stack_.push_back(0); }
cap::eraseSelection(*this);
cell().insert(pos(), ar);
pos() += ar.size();
cap::eraseSelection(*this);
cell().insert(pos(), ar);
pos() += ar.size();
- // FIXME audit setBuffer/updateLabels calls
+ // FIXME audit setBuffer/updateBuffer calls
inset().setBuffer(bv_->buffer());
}
inset().setBuffer(bv_->buffer());
}
static_cast<InsetMathHull &>(*itt);
// this is necessary to prevent an uninitialized
// buffer when the RefInset is in a MathBox.
static_cast<InsetMathHull &>(*itt);
// this is necessary to prevent an uninitialized
// buffer when the RefInset is in a MathBox.
- // FIXME audit setBuffer/updateLabels calls
+ // FIXME audit setBuffer/updateBuffer calls
mi.setBuffer(const_cast<Buffer &>(buffer));
if (mi.asRefInset()->getTarget() == oldname)
mi.asRefInset()->changeTarget(newname);
mi.setBuffer(const_cast<Buffer &>(buffer));
if (mi.asRefInset()->getTarget() == oldname)
mi.asRefInset()->changeTarget(newname);
static_cast<InsetMathHull &>(*itt);
// this is necessary to prevent an uninitialized
// buffer when the RefInset is in a MathBox.
static_cast<InsetMathHull &>(*itt);
// this is necessary to prevent an uninitialized
// buffer when the RefInset is in a MathBox.
- // FIXME audit setBuffer/updateLabels calls
+ // FIXME audit setBuffer/updateBuffer calls
mi.setBuffer(const_cast<Buffer &>(buffer));
if (mi.asRefInset()->getTarget() == oldname)
mi.asRefInset()->changeTarget(newname);
mi.setBuffer(const_cast<Buffer &>(buffer));
if (mi.asRefInset()->getTarget() == oldname)
mi.asRefInset()->changeTarget(newname);
pit = last_paste;
pos = pars[last_paste].size();
pit = last_paste;
pos = pars[last_paste].size();
- // FIXME Should we do it here, or should we let updateLabels() do it?
+ // FIXME Should we do it here, or should we let updateBuffer() do it?
// Set paragraph buffers. It's important to do this right away
// before something calls Inset::buffer() and causes a crash.
for (pit_type p = startpit; p <= pit; ++p)
// Set paragraph buffers. It's important to do this right away
// before something calls Inset::buffer() and causes a crash.
for (pit_type p = startpit; p <= pit; ++p)
// need a valid cursor. (Lgb)
cur.clearSelection();
// need a valid cursor. (Lgb)
cur.clearSelection();
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
// tell tabular that a recent copy happened
dirtyTabularStack(false);
// tell tabular that a recent copy happened
dirtyTabularStack(false);
boost::tie(ppp, endpit) =
pasteSelectionHelper(cur, parlist, docclass, errorList);
boost::tie(ppp, endpit) =
pasteSelectionHelper(cur, parlist, docclass, errorList);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
cur.clearSelection();
text->setCursor(cur, ppp.first, ppp.second);
}
cur.clearSelection();
text->setCursor(cur, ppp.first, ppp.second);
}
break; // the character couldn't be deleted physically due to change tracking
}
break; // the character couldn't be deleted physically due to change tracking
}
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
// A singlePar update is not enough in this case.
cur.updateFlags(Update::Force);
// A singlePar update is not enough in this case.
cur.updateFlags(Update::Force);
cur.clearSelection();
setCursorIntern(cur, begPit, begPos);
cur.updateFlags(Update::Force);
cur.clearSelection();
setCursorIntern(cur, begPit, begPos);
cur.updateFlags(Update::Force);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
mergeParagraph(bufparams, cur.text()->paragraphs(),
prevcur.pit());
cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
mergeParagraph(bufparams, cur.text()->paragraphs(),
prevcur.pit());
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
setCursorIntern(cur, prevcur.pit(), prevcur.pos());
cur.updateFlags(Update::Force);
return true;
setCursorIntern(cur, prevcur.pit(), prevcur.pos());
cur.updateFlags(Update::Force);
return true;
cur.top().forwardPos();
if (was_inset)
cur.top().forwardPos();
if (was_inset)
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
else
cur.checkBufferStructure();
needsUpdate = true;
else
cur.checkBufferStructure();
needsUpdate = true;
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
setCursorIntern(cur, prevcur.pit(), prevcur.pos());
}
setCursorIntern(cur, prevcur.pit(), prevcur.pos());
}
bool const was_inset = cur.paragraph().isInset(cur.pos());
cur.paragraph().eraseChar(cur.pos(), cur.buffer()->params().trackChanges);
if (was_inset)
bool const was_inset = cur.paragraph().isInset(cur.pos());
cur.paragraph().eraseChar(cur.pos(), cur.buffer()->params().trackChanges);
if (was_inset)
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
else
cur.checkBufferStructure();
}
else
cur.checkBufferStructure();
}
} else
// this is the least that needs to be done (bug 6003)
// in the above case, pasteParagraphList handles this
} else
// this is the least that needs to be done (bug 6003)
// in the above case, pasteParagraphList handles this
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
// Ensure the current language is set correctly (bug 6292)
cur.text()->setCursor(cur, cur.pit(), cur.pos());
// Ensure the current language is set correctly (bug 6292)
cur.text()->setCursor(cur, cur.pit(), cur.pos());
pit_type undopit = undoSpan(end - 1);
recUndo(cur, start, undopit - 1);
setLayout(start, end, layout);
pit_type undopit = undoSpan(end - 1);
recUndo(cur, start, undopit - 1);
setLayout(start, end, layout);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
}
// this handles the counter labels, and also fixes up
// depth values for follow-on (child) paragraphs
}
// this handles the counter labels, and also fixes up
// depth values for follow-on (child) paragraphs
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
recUndo(cur, pit, pit + 1);
cur.finishUndo();
pars_.swap(pit, pit + 1);
recUndo(cur, pit, pit + 1);
cur.finishUndo();
pars_.swap(pit, pit + 1);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
needsUpdate = true;
++cur.pit();
break;
needsUpdate = true;
++cur.pit();
break;
recUndo(cur, pit - 1, pit);
cur.finishUndo();
pars_.swap(pit, pit - 1);
recUndo(cur, pit - 1, pit);
cur.finishUndo();
pars_.swap(pit, pit - 1);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
--cur.pit();
needsUpdate = true;
break;
--cur.pit();
needsUpdate = true;
break;
par.params().startOfAppendix(start);
// we can set the refreshing parameters now
par.params().startOfAppendix(start);
// we can set the refreshing parameters now
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
cur.posForward();
// Some insets are numbered, others are shown in the outline pane so
// let's update the labels and the toc backend.
cur.posForward();
// Some insets are numbered, others are shown in the outline pane so
// let's update the labels and the toc backend.
- bv->buffer().updateLabels();
+ bv->buffer().updateBuffer();
break;
case LFUN_TABULAR_INSERT:
break;
case LFUN_TABULAR_INSERT:
// date metrics.
FuncRequest cmd_caption(LFUN_CAPTION_INSERT);
doInsertInset(cur, cur.text(), cmd_caption, true, false);
// date metrics.
FuncRequest cmd_caption(LFUN_CAPTION_INSERT);
doInsertInset(cur, cur.text(), cmd_caption, true, false);
- bv->buffer().updateLabels();
+ bv->buffer().updateBuffer();
cur.updateFlags(Update::Force);
// FIXME: When leaving the Float (or Wrap) inset we should
// delete any empty paragraph left above or below the
cur.updateFlags(Update::Force);
// FIXME: When leaving the Float (or Wrap) inset we should
// delete any empty paragraph left above or below the
case LFUN_OUTLINE_UP:
outline(OutlineUp, cur);
setCursor(cur, cur.pit(), 0);
case LFUN_OUTLINE_UP:
outline(OutlineUp, cur);
setCursor(cur, cur.pit(), 0);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
needsUpdate = true;
break;
case LFUN_OUTLINE_DOWN:
outline(OutlineDown, cur);
setCursor(cur, cur.pit(), 0);
needsUpdate = true;
break;
case LFUN_OUTLINE_DOWN:
outline(OutlineDown, cur);
setCursor(cur, cur.pit(), 0);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
needsUpdate = true;
break;
case LFUN_OUTLINE_IN:
outline(OutlineIn, cur);
needsUpdate = true;
break;
case LFUN_OUTLINE_IN:
outline(OutlineIn, cur);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
needsUpdate = true;
break;
case LFUN_OUTLINE_OUT:
outline(OutlineOut, cur);
needsUpdate = true;
break;
case LFUN_OUTLINE_OUT:
outline(OutlineOut, cur);
- cur.buffer()->updateLabels();
+ cur.buffer()->updateBuffer();
needsUpdate = true;
break;
needsUpdate = true;
break;
dim_.asc = 10;
dim_.des = 10;
dim_.asc = 10;
dim_.des = 10;
- //text_->updateLabels(bv->buffer());
+ //text_->updateBuffer(bv->buffer());
LYXERR(Debug::INFO, "MacroContext not initialised!"
<< " Going through the buffer again and hope"
<< " the context is better then.");
LYXERR(Debug::INFO, "MacroContext not initialised!"
<< " Going through the buffer again and hope"
<< " the context is better then.");
- bv_->buffer().updateLabels();
+ bv_->buffer().updateBuffer();
parPos = text_->macrocontextPosition();
LASSERT(!parPos.empty(), /**/);
parPos.pit() = pit;
parPos = text_->macrocontextPosition();
LASSERT(!parPos.empty(), /**/);
parPos.pit() = pit;
// Adapt the new material to current buffer.
buffer_.setBuffersForInsets(); // FIXME This shouldn't be here.
// Adapt the new material to current buffer.
buffer_.setBuffersForInsets(); // FIXME This shouldn't be here.
- buffer_.updateLabels();
+ buffer_.updateBuffer();
#ifndef DEVEL_VERSION
buf->setReadonly(true);
#endif
#ifndef DEVEL_VERSION
buf->setReadonly(true);
#endif
buf->errors("Parse");
}
break;
buf->errors("Parse");
}
break;
GuiWorkArea * wa = workArea(*newBuffer);
if (wa == 0) {
GuiWorkArea * wa = workArea(*newBuffer);
if (wa == 0) {
- newBuffer->masterBuffer()->updateLabels();
+ newBuffer->masterBuffer()->updateBuffer();
wa = addWorkArea(*newBuffer);
} else {
//Disconnect the old buffer...there's no new one.
wa = addWorkArea(*newBuffer);
} else {
//Disconnect the old buffer...there's no new one.
docstring str2;
Buffer * buf = loadDocument(fullname);
if (buf) {
docstring str2;
Buffer * buf = loadDocument(fullname);
if (buf) {
setBuffer(buf);
buf->errors("Parse");
str2 = bformat(_("Document %1$s opened."), disp_fn);
setBuffer(buf);
buf->errors("Parse");
str2 = bformat(_("Document %1$s opened."), disp_fn);
Buffer * buf = lv->loadDocument(lyxfile);
if (!buf)
return false;
Buffer * buf = lv->loadDocument(lyxfile);
if (!buf)
return false;
lv->setBuffer(buf);
buf->errors("Parse");
} else {
lv->setBuffer(buf);
buf->errors("Parse");
} else {
// This makes insertion of citations and references in the child work,
// when the target is in the parent or another child document.
child->setParent(&buffer);
// This makes insertion of citations and references in the child work,
// when the target is in the parent or another child document.
child->setParent(&buffer);
- child->masterBuffer()->updateLabels();
+ child->masterBuffer()->updateBuffer();
setBuffer(child);
if (parsed)
child->errors("Parse");
setBuffer(child);
if (parsed)
child->errors("Parse");
buf = theBufferList().getBuffer(s);
else if (s.exists()) {
buf = loadDocument(s);
buf = theBufferList().getBuffer(s);
else if (s.exists()) {
buf = loadDocument(s);
buf->errors("Parse");
} else {
message(bformat(
buf->errors("Parse");
} else {
message(bformat(
void Inset::initView()
{
if (isLabeled())
void Inset::initView()
{
if (isLabeled())
- buffer().updateLabels();
+ buffer().updateBuffer();
/**
* This is typically used after this inset is created interactively.
* Intented purpose is to sanitize internal state with regard to current
/**
* This is typically used after this inset is created interactively.
* Intented purpose is to sanitize internal state with regard to current
- * Buffer. The default implementation calls buffer().updateLabels() if
+ * Buffer. The default implementation calls buffer().updateBuffer() if
* the inset is labeled.
*
* \sa isLabeled()
* the inset is labeled.
*
* \sa isLabeled()
/// Update the counters of this inset and of its contents.
/// The boolean indicates whether we are preparing for output, e.g.,
/// of XHTML.
/// 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 updateLabels(ParIterator const &, UpdateType) {}
+ virtual void updateBuffer(ParIterator const &, UpdateType) {}
/// Updates the inset's dialog
virtual Buffer const * updateFrontend() const;
/// Updates the inset's dialog
virtual Buffer const * updateFrontend() const;
- buffer().updateLabels();
+ buffer().updateBuffer();
// Update the counters of this inset and of its contents
// Update the counters of this inset and of its contents
-void InsetBibitem::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype)
{
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & counters = bp.documentClass().counters();
{
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & counters = bp.documentClass().counters();
///
virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
/// Update the counter of this inset
///
virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
/// Update the counter of this inset
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void updateCommand(docstring const & new_key, bool dummy = false);
///
///
void updateCommand(docstring const & new_key, bool dummy = false);
///
Inset * clone() const { return new InsetBibitem(*this); }
friend docstring bibitemWidest(Buffer const & buffer, OutputParams const &);
Inset * clone() const { return new InsetBibitem(*this); }
friend docstring bibitemWidest(Buffer const & buffer, OutputParams const &);
- /// The label that is set by updateLabels
+ /// The label that is set by updateBuffer
docstring autolabel_;
///
static int key_counter;
docstring autolabel_;
///
static int key_counter;
-void InsetCaption::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype)
{
Buffer const & master = *buffer().masterBuffer();
DocumentClass const & tclass = master.params().documentClass();
{
Buffer const & master = *buffer().masterBuffer();
DocumentClass const & tclass = master.params().documentClass();
}
// Do the real work now.
}
// Do the real work now.
- InsetText::updateLabels(it, utype);
+ InsetText::updateBuffer(it, utype);
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
// Update the counters of this inset and of its contents
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
// Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
int latex(odocstream & os, OutputParams const &) const;
///
///
int latex(odocstream & os, OutputParams const &) const;
///
-void InsetCitation::updateLabels(ParIterator const &, UpdateType)
+void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
{
CiteEngine const engine = buffer().params().citeEngine();
if (cache.params == params() && cache.engine == engine)
{
CiteEngine const engine = buffer().params().citeEngine();
if (cache.params == params() && cache.engine == engine)
///
void validate(LaTeXFeatures &) const;
///
///
void validate(LaTeXFeatures &) const;
///
- void updateLabels(ParIterator const & it, UpdateType);
+ void updateBuffer(ParIterator const & it, UpdateType);
///
void addToToc(DocIterator const &);
///
void addToToc(DocIterator const &);
setNewLabel();
if (params_.type != params.type) {
params_.type = params.type;
setNewLabel();
if (params_.type != params.type) {
params_.type = params.type;
- buffer().updateLabels();
+ buffer().updateBuffer();
-void InsetFloat::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetFloat::updateBuffer(ParIterator const & it, UpdateType utype)
{
Counters & cnts =
buffer().masterBuffer()->params().documentClass().counters();
{
Counters & cnts =
buffer().masterBuffer()->params().documentClass().counters();
cnts.current_float(params().type);
cnts.isSubfloat(subflt);
cnts.current_float(params().type);
cnts.isSubfloat(subflt);
- InsetCollapsable::updateLabels(it, utype);
+ InsetCollapsable::updateBuffer(it, utype);
//reset afterwards
cnts.current_float(saveflt);
//reset afterwards
cnts.current_float(saveflt);
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
// Update the counters of this inset and of its contents
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
// Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
-void InsetFoot::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype)
{
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & cnts = bp.documentClass().counters();
{
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & cnts = bp.documentClass().counters();
+ ' ' + cnts.theCounter(count, outer.getParLanguage(bp)->code());
setLabel(custom_label_);
}
+ ' ' + cnts.theCounter(count, outer.getParLanguage(bp)->code());
setLabel(custom_label_);
}
- InsetCollapsable::updateLabels(it, utype);
+ InsetCollapsable::updateBuffer(it, utype);
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
if (utype == OutputUpdate)
cnts.restoreLastCounter();
}
///
int docbook(odocstream &, OutputParams const &) const;
/// Update the counters of this inset and of its contents
///
int docbook(odocstream &, OutputParams const &) const;
/// Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void addToToc(DocIterator const &);
///
///
void addToToc(DocIterator const &);
///
-void InsetInclude::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype)
{
Buffer const * const childbuffer = getChildBuffer();
if (childbuffer) {
{
Buffer const * const childbuffer = getChildBuffer();
if (childbuffer) {
- childbuffer->updateLabels(Buffer::UpdateChildOnly, utype);
+ childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype);
return;
}
if (!isListings(params()))
return;
if (label_)
return;
}
if (!isListings(params()))
return;
if (label_)
- label_->updateLabels(it, utype);
+ label_->updateBuffer(it, utype);
InsetListingsParams const par(to_utf8(params()["lstparams"]));
if (par.getParamValue("caption").empty()) {
InsetListingsParams const par(to_utf8(params()["lstparams"]));
if (par.getParamValue("caption").empty()) {
///
void updateCommand();
///
///
void updateCommand();
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
static ParamInfo const & findInfo(std::string const &);
///
///
static ParamInfo const & findInfo(std::string const &);
///
buffer().undo().endUndoGroup();
// We need an update of the Buffer reference cache. This is achieved by
buffer().undo().endUndoGroup();
// We need an update of the Buffer reference cache. This is achieved by
- // updateLabels().
- buffer().updateLabels();
+ // updateBuffer().
+ buffer().updateBuffer();
-void InsetLabel::updateLabels(ParIterator const & par, UpdateType utype)
+void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype)
{
docstring const & label = getParam("name");
if (buffer().insetLabel(label)) {
{
docstring const & label = getParam("name");
if (buffer().insetLabel(label)) {
static bool isCompatibleCommand(std::string const & s)
{ return s == "label"; }
///
static bool isCompatibleCommand(std::string const & s)
{ return s == "label"; }
///
- void updateLabels(ParIterator const & it, UpdateType);
+ void updateBuffer(ParIterator const & it, UpdateType);
///
void addToToc(DocIterator const &);
///
///
void addToToc(DocIterator const &);
///
-void InsetListings::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetListings::updateBuffer(ParIterator const & it, UpdateType utype)
{
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
string const saveflt = cnts.current_float();
{
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
cnts.current_float("listing");
// Tell to captions what the current float is
cnts.current_float("listing");
- InsetCollapsable::updateLabels(it, utype);
+ InsetCollapsable::updateBuffer(it, utype);
//reset afterwards
cnts.current_float(saveflt);
//reset afterwards
cnts.current_float(saveflt);
///
docstring name() const { return from_ascii("Listings"); }
// Update the counters of this inset and of its contents
///
docstring name() const { return from_ascii("Listings"); }
// Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void write(std::ostream & os) const;
///
///
void write(std::ostream & os) const;
///
-void InsetRef::updateLabels(ParIterator const & it, UpdateType)
+void InsetRef::updateBuffer(ParIterator const & it, UpdateType)
{
docstring const & ref = getParam("reference");
// register this inset into the buffer reference cache.
{
docstring const & ref = getParam("reference");
// register this inset into the buffer reference cache.
///
static bool isCompatibleCommand(std::string const & s);
///
///
static bool isCompatibleCommand(std::string const & s);
///
- void updateLabels(ParIterator const & it, UpdateType);
+ void updateBuffer(ParIterator const & it, UpdateType);
///
void addToToc(DocIterator const &);
protected:
///
void addToToc(DocIterator const &);
protected:
-void InsetTabular::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetTabular::updateBuffer(ParIterator const & it, UpdateType utype)
{
// In a longtable, tell captions what the current float is
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
{
// In a longtable, tell captions what the current float is
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
it2.forwardPos();
size_t const end = it2.nargs();
for ( ; it2.idx() < end; it2.top().forwardIdx())
it2.forwardPos();
size_t const end = it2.nargs();
for ( ; it2.idx() < end; it2.top().forwardIdx())
- buffer().updateLabels(it2, utype);
+ buffer().updateBuffer(it2, utype);
//reset afterwards
if (tabular.is_long_tabular)
//reset afterwards
if (tabular.is_long_tabular)
/// 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
/// 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 updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void addToToc(DocIterator const &);
///
void addToToc(DocIterator const &);
-void InsetText::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
{
ParIterator it2 = it;
it2.forwardPos();
{
ParIterator it2 = it;
it2.forwardPos();
cnt.clearLastLayout();
// FIXME cnt.saveLastCounter()?
}
cnt.clearLastLayout();
// FIXME cnt.saveLastCounter()?
}
- buffer().updateLabels(it2, utype);
+ buffer().updateBuffer(it2, utype);
if (save_layouts) {
// LYXERR0("Exiting " << name());
cnt.restoreLastLayout();
if (save_layouts) {
// LYXERR0("Exiting " << name());
cnt.restoreLastLayout();
// tclass.counters().clearLastLayout()
// since we are saving and restoring the existing counters, etc.
Counters const savecnt = tclass.counters();
// tclass.counters().clearLastLayout()
// since we are saving and restoring the existing counters, etc.
Counters const savecnt = tclass.counters();
- buffer().updateLabels(it2, utype);
+ buffer().updateBuffer(it2, utype);
tclass.counters() = savecnt;
}
}
tclass.counters() = savecnt;
}
}
{ return getLayout().allowParagraphCustomization(); }
/// Update the counters of this inset and of its contents
{ return getLayout().allowParagraphCustomization(); }
/// Update the counters of this inset and of its contents
- virtual void updateLabels(ParIterator const &, UpdateType);
+ virtual void updateBuffer(ParIterator const &, UpdateType);
/// the string that is passed to the TOC
void tocString(odocstream &) const;
///
/// the string that is passed to the TOC
void tocString(odocstream &) const;
///
-void InsetWrap::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetWrap::updateBuffer(ParIterator const & it, UpdateType utype)
{
setLabel(_("wrap: ") + floatName(params_.type));
Counters & cnts =
{
setLabel(_("wrap: ") + floatName(params_.type));
Counters & cnts =
// Tell to captions what the current float is
cnts.current_float(params().type);
// Tell to captions what the current float is
cnts.current_float(params().type);
- InsetCollapsable::updateLabels(it, utype);
+ InsetCollapsable::updateBuffer(it, utype);
// reset afterwards
cnts.current_float(saveflt);
// reset afterwards
cnts.current_float(saveflt);
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
/// Update the counters of this inset and of its contents
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
/// Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
bv->putSelectionAt(doc_iterator_begin(&buf), 0, false);
if (num)
buf.markDirty();
bv->putSelectionAt(doc_iterator_begin(&buf), 0, false);
if (num)
buf.markDirty();
-void InsetMathGrid::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetMathGrid::updateBuffer(ParIterator const & it, UpdateType utype)
{
// pass down
for (idx_type idx = 0; idx < nargs(); ++idx)
{
// pass down
for (idx_type idx = 0; idx < nargs(); ++idx)
- cell(idx).updateLabels(it, utype);
+ cell(idx).updateBuffer(it, utype);
cell(i).append(grid.cell(grid.index(r, c)));
}
cur.clearSelection(); // bug 393
cell(i).append(grid.cell(grid.index(r, c)));
}
cur.clearSelection(); // bug 393
- // FIXME audit setBuffer/updateLabels calls
+ // FIXME audit setBuffer/updateBuffer calls
cur.inset().setBuffer(*buffer_);
cur.inset().setBuffer(*buffer_);
- // FIXME audit setBuffer/updateLabels calls
- cur.buffer()->updateLabels();
+ // FIXME audit setBuffer/updateBuffer calls
+ cur.buffer()->updateBuffer();
cur.finishUndo();
break;
}
cur.finishUndo();
break;
}
///
void drawT(TextPainter & pi, int x, int y) const;
///
///
void drawT(TextPainter & pi, int x, int y) const;
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
/// extract number of columns from alignment string
static col_type guessColumns(docstring const & halign);
/// accepts some LaTeX column codes: p,m,!,@,M,<,>
/// extract number of columns from alignment string
static col_type guessColumns(docstring const & halign);
/// accepts some LaTeX column codes: p,m,!,@,M,<,>
-void InsetMathHull::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetMathHull::updateBuffer(ParIterator const & it, UpdateType utype)
{
if (!buffer_) {
//FIXME: buffer_ should be set at creation for this inset! Problem is
{
if (!buffer_) {
//FIXME: buffer_ should be set at creation for this inset! Problem is
}
for (size_t i = 0; i != label_.size(); ++i) {
if (label_[i])
}
for (size_t i = 0; i != label_.size(); ++i) {
if (label_[i])
- label_[i]->updateLabels(it, utype);
+ label_[i]->updateBuffer(it, utype);
- InsetMathGrid::updateLabels(it, utype);
+ InsetMathGrid::updateBuffer(it, utype);
delete label_[row];
label_[row] = dummy_pointer;
// We need an update of the Buffer reference cache.
delete label_[row];
label_[row] = dummy_pointer;
// We need an update of the Buffer reference cache.
- // This is achieved by updateLabels().
+ // This is achieved by updateBuffer().
- buffer().updateLabels();
+ buffer().updateBuffer();
} else {
if (buffer_)
label_[row]->updateCommand(label);
} else {
if (buffer_)
label_[row]->updateCommand(label);
return;
}
// We need an update of the Buffer reference cache.
return;
}
// We need an update of the Buffer reference cache.
- // This is achieved by updateLabels().
- buffer().updateLabels();
+ // This is achieved by updateBuffer().
+ buffer().updateBuffer();
///
void setBuffer(Buffer &);
///
///
void setBuffer(Buffer &);
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
void addToToc(DocIterator const &);
///
///
void addToToc(DocIterator const &);
///
-void InsetMathNest::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetMathNest::updateBuffer(ParIterator const & it, UpdateType utype)
{
for (idx_type i = 0, n = nargs(); i != n; ++i)
{
for (idx_type i = 0, n = nargs(); i != n; ++i)
- cell(i).updateLabels(it, utype);
+ cell(i).updateBuffer(it, utype);
}
cur.niceInsert(topaste, parseflg, false);
cur.clearSelection(); // bug 393
}
cur.niceInsert(topaste, parseflg, false);
cur.clearSelection(); // bug 393
- // FIXME audit setBuffer/updateLabels calls
- cur.buffer()->updateLabels();
+ // FIXME audit setBuffer/updateBuffer calls
+ cur.buffer()->updateBuffer();
cur.finishUndo();
break;
}
cur.finishUndo();
break;
}
// Prevent stale position >= size crash
// Probably not necessary anymore, see eraseSelection (gb 2005-10-09)
cur.normalize();
// Prevent stale position >= size crash
// Probably not necessary anymore, see eraseSelection (gb 2005-10-09)
cur.normalize();
- // FIXME audit setBuffer/updateLabels calls
- cur.buffer()->updateLabels();
+ // FIXME audit setBuffer/updateBuffer calls
+ cur.buffer()->updateBuffer();
cur.posBackward();
cur.pushBackward(*cur.nextInset());
cur.niceInsert(save_selection);
cur.posBackward();
cur.pushBackward(*cur.nextInset());
cur.niceInsert(save_selection);
- // FIXME audit setBuffer/updateLabels calls
- cur.buffer()->updateLabels();
+ // FIXME audit setBuffer/updateBuffer calls
+ cur.buffer()->updateBuffer();
#else
if (currentMode() == Inset::TEXT_MODE) {
cur.recordUndoSelection();
#else
if (currentMode() == Inset::TEXT_MODE) {
cur.recordUndoSelection();
if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
cur.recordUndoSelection();
cur.insert(ar);
if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
cur.recordUndoSelection();
cur.insert(ar);
- // FIXME audit setBuffer/updateLabels calls
- cur.buffer()->updateLabels();
+ // FIXME audit setBuffer/updateBuffer calls
+ cur.buffer()->updateBuffer();
} else
cur.undispatched();
break;
} else
cur.undispatched();
break;
void drawDecoration(PainterInfo & pi, int x, int y) const
{ drawMarkers(pi, x, y); }
///
void drawDecoration(PainterInfo & pi, int x, int y) const
{ drawMarkers(pi, x, y); }
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
/// identifies NestInsets
InsetMathNest * asNestInset() { return this; }
/// identifies NestInsets
/// identifies NestInsets
InsetMathNest * asNestInset() { return this; }
/// identifies NestInsets
-void InsetMathRef::updateLabels(ParIterator const & it, UpdateType /*utype*/)
+void InsetMathRef::updateBuffer(ParIterator const & it, UpdateType /*utype*/)
- LYXERR0("InsetMathRef::updateLabels: no buffer_!");
+ LYXERR0("InsetMathRef::updateBuffer: no buffer_!");
return;
}
// register this inset into the buffer reference cache.
return;
}
// register this inset into the buffer reference cache.
if (createInsetMath_fromDialogStr(
from_utf8(InsetCommand::params2string("ref", icp)), ar)) {
*this = *ar[0].nucleus()->asRefInset();
if (createInsetMath_fromDialogStr(
from_utf8(InsetCommand::params2string("ref", icp)), ar)) {
*this = *ar[0].nucleus()->asRefInset();
- // FIXME audit setBuffer/updateLabels calls
+ // FIXME audit setBuffer/updateBuffer calls
///
explicit InsetMathRef(Buffer * buf, docstring const & data);
///
///
explicit InsetMathRef(Buffer * buf, docstring const & data);
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
///
//void write(WriteStream & os) const;
///
///
//void write(WriteStream & os) const;
///
-void MathData::updateLabels(ParIterator const & it, UpdateType utype)
+void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
{
// pass down
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom & at = operator[](i);
{
// pass down
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom & at = operator[](i);
- at.nucleus()->updateLabels(it, utype);
+ at.nucleus()->updateBuffer(it, utype);
/// stay visually at the same position (cur==0 is allowed)
void updateMacros(Cursor * cur, MacroContext const & mc);
///
/// stay visually at the same position (cur==0 is allowed)
void updateMacros(Cursor * cur, MacroContext const & mc);
///
- void updateLabels(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType);
protected:
/// cached values for super/subscript placement
protected:
/// cached values for super/subscript placement
///
typedef std::map<std::string, docstring> TranslationCache;
/// Internal cache for gettext translated strings.
///
typedef std::map<std::string, docstring> TranslationCache;
/// Internal cache for gettext translated strings.
- /// This is needed for performance reason within \c updateLabels()
+ /// This is needed for performance reason within \c updateBuffer()
/// under Windows.
mutable TranslationCache cache_;
};
/// under Windows.
mutable TranslationCache cache_;
};