mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-25 01:26:51 +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
|
// Use the master text class also for child documents
|
||||||
Buffer const * const master = masterBuffer();
|
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.
|
// 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.
|
// via an InsetInclude). The remaining ones in the set need still be updated.
|
||||||
static std::set<Buffer const *> bufToUpdate;
|
static std::set<Buffer const *> bufToUpdate;
|
||||||
if (!childonly) {
|
if (scope == UpdateMaster) {
|
||||||
// If this is a child document start with the master
|
// If this is a child document start with the master
|
||||||
if (master != this) {
|
if (master != this) {
|
||||||
bufToUpdate.insert(this);
|
bufToUpdate.insert(this);
|
||||||
master->updateLabels(false);
|
master->updateLabels();
|
||||||
// Do this here in case the master has no gui associated with it. Then,
|
// 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).
|
// the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
|
||||||
if (!master->gui_)
|
if (!master->gui_)
|
||||||
@ -2778,7 +2778,7 @@ void Buffer::updateLabels(bool childonly) const
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
cbuf.tocBackend().update();
|
cbuf.tocBackend().update();
|
||||||
if (!childonly)
|
if (scope == UpdateMaster)
|
||||||
cbuf.structureChanged();
|
cbuf.structureChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,9 +476,12 @@ public:
|
|||||||
void setInsetLabel(docstring const & label, InsetLabel const * il);
|
void setInsetLabel(docstring const & label, InsetLabel const * il);
|
||||||
InsetLabel const * insetLabel(docstring const & label) const;
|
InsetLabel const * insetLabel(docstring const & label) const;
|
||||||
|
|
||||||
// FIXME: buf should should be const because updateLabels() modifies
|
enum UpdateScope {
|
||||||
// the contents of the paragraphs.
|
UpdateMaster,
|
||||||
void updateLabels(bool childonly = false) const;
|
UpdateChildOnly
|
||||||
|
};
|
||||||
|
///
|
||||||
|
void updateLabels(UpdateScope = UpdateMaster) const;
|
||||||
///
|
///
|
||||||
void updateLabels(ParIterator & parit) const;
|
void updateLabels(ParIterator & parit) const;
|
||||||
|
|
||||||
|
@ -301,12 +301,12 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
|||||||
pit = last_paste;
|
pit = last_paste;
|
||||||
pos = pars[last_paste].size();
|
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
|
// Set paragraph buffers. It's important to do this right away
|
||||||
// before something calls Inset::buffer() and causes a crash.
|
// before something calls Inset::buffer() and causes a crash.
|
||||||
for (pit_type p = startpit; p <= pit; ++p)
|
for (pit_type p = startpit; p <= pit; ++p)
|
||||||
pars[p].setBuffer(const_cast<Buffer &>(buffer));
|
pars[p].setBuffer(const_cast<Buffer &>(buffer));
|
||||||
|
|
||||||
|
|
||||||
// Join (conditionally) last pasted paragraph with next one, i.e.,
|
// Join (conditionally) last pasted paragraph with next one, i.e.,
|
||||||
// the tail of the spliced document paragraph
|
// the tail of the spliced document paragraph
|
||||||
if (!empty && last_paste + 1 != pit_type(pars.size())) {
|
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)
|
while (!stack.empty() && stack.top().group_id == gid)
|
||||||
doTextUndoOrRedo(cur, stack, otherstack);
|
doTextUndoOrRedo(cur, stack, otherstack);
|
||||||
|
|
||||||
// Addapt the new material to current buffer.
|
// Adapt the new material to current buffer.
|
||||||
buffer_.updateLabels();
|
buffer_.updateLabels();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ void GuiInfo::applyView()
|
|||||||
|
|
||||||
dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
|
dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
|
||||||
// FIXME: update the inset contents
|
// FIXME: update the inset contents
|
||||||
bufferview()->buffer().updateLabels(false);
|
bufferview()->buffer().updateLabels();
|
||||||
BufferView * bv = const_cast<BufferView *>(bufferview());
|
BufferView * bv = const_cast<BufferView *>(bufferview());
|
||||||
bv->updateMetrics();
|
bv->updateMetrics();
|
||||||
bv->buffer().changed();
|
bv->buffer().changed();
|
||||||
|
@ -952,7 +952,7 @@ void InsetInclude::updateLabels(ParIterator const & it)
|
|||||||
{
|
{
|
||||||
Buffer const * const childbuffer = getChildBuffer(buffer());
|
Buffer const * const childbuffer = getChildBuffer(buffer());
|
||||||
if (childbuffer) {
|
if (childbuffer) {
|
||||||
childbuffer->updateLabels(true);
|
childbuffer->updateLabels(Buffer::UpdateChildOnly);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isListings(params()))
|
if (!isListings(params()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user