mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Use an enum to make things a little clearer here.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28756 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d757c34e79
commit
3aecc2c4ff
@ -2729,7 +2729,7 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
|
||||
}
|
||||
|
||||
|
||||
void Buffer::updateLabels(bool childonly) const
|
||||
void Buffer::updateLabels(UpdateScope scope) const
|
||||
{
|
||||
// Use the master text class also for child documents
|
||||
Buffer const * const master = masterBuffer();
|
||||
@ -2739,11 +2739,11 @@ void Buffer::updateLabels(bool childonly) const
|
||||
// master comes back we can see which of them were actually seen (i.e.
|
||||
// via an InsetInclude). The remaining ones in the set need still be updated.
|
||||
static std::set<Buffer const *> bufToUpdate;
|
||||
if (!childonly) {
|
||||
if (scope == UpdateMaster) {
|
||||
// If this is a child document start with the master
|
||||
if (master != this) {
|
||||
bufToUpdate.insert(this);
|
||||
master->updateLabels(false);
|
||||
master->updateLabels();
|
||||
// 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->gui_)
|
||||
@ -2778,7 +2778,7 @@ void Buffer::updateLabels(bool childonly) const
|
||||
return;
|
||||
|
||||
cbuf.tocBackend().update();
|
||||
if (!childonly)
|
||||
if (scope == UpdateMaster)
|
||||
cbuf.structureChanged();
|
||||
}
|
||||
|
||||
|
@ -476,9 +476,12 @@ public:
|
||||
void setInsetLabel(docstring const & label, InsetLabel const * il);
|
||||
InsetLabel const * insetLabel(docstring const & label) const;
|
||||
|
||||
// FIXME: buf should should be const because updateLabels() modifies
|
||||
// the contents of the paragraphs.
|
||||
void updateLabels(bool childonly = false) const;
|
||||
enum UpdateScope {
|
||||
UpdateMaster,
|
||||
UpdateChildOnly
|
||||
};
|
||||
///
|
||||
void updateLabels(UpdateScope = UpdateMaster) const;
|
||||
///
|
||||
void updateLabels(ParIterator & parit) const;
|
||||
|
||||
|
@ -301,12 +301,12 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
pit = last_paste;
|
||||
pos = pars[last_paste].size();
|
||||
|
||||
// FIXME Should we do it here, or should we let updateLabels() 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)
|
||||
pars[p].setBuffer(const_cast<Buffer &>(buffer));
|
||||
|
||||
|
||||
// Join (conditionally) last pasted paragraph with next one, i.e.,
|
||||
// the tail of the spliced document paragraph
|
||||
if (!empty && last_paste + 1 != pit_type(pars.size())) {
|
||||
|
@ -426,7 +426,7 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
|
||||
while (!stack.empty() && stack.top().group_id == gid)
|
||||
doTextUndoOrRedo(cur, stack, otherstack);
|
||||
|
||||
// Addapt the new material to current buffer.
|
||||
// Adapt the new material to current buffer.
|
||||
buffer_.updateLabels();
|
||||
return true;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void GuiInfo::applyView()
|
||||
|
||||
dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
|
||||
// FIXME: update the inset contents
|
||||
bufferview()->buffer().updateLabels(false);
|
||||
bufferview()->buffer().updateLabels();
|
||||
BufferView * bv = const_cast<BufferView *>(bufferview());
|
||||
bv->updateMetrics();
|
||||
bv->buffer().changed();
|
||||
|
@ -952,7 +952,7 @@ void InsetInclude::updateLabels(ParIterator const & it)
|
||||
{
|
||||
Buffer const * const childbuffer = getChildBuffer(buffer());
|
||||
if (childbuffer) {
|
||||
childbuffer->updateLabels(true);
|
||||
childbuffer->updateLabels(Buffer::UpdateChildOnly);
|
||||
return;
|
||||
}
|
||||
if (!isListings(params()))
|
||||
|
Loading…
Reference in New Issue
Block a user