The problem was that, if the master is not opened, no respective guiDelegate exists, and the functions that update the toc do not trigger. The fix is to update the child's toc backend and toc items directly in such cases.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28551
a592a061-630c-0410-9148-
cb99ea01b6c8
}
+bool Buffer::hasGuiDelegate() const
+{
+ return gui_;
+}
+
+
void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
{
gui_ = gui;
if (master != this) {
bufToUpdate.insert(this);
master->updateLabels(false);
+ // 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_)
+ structureChanged();
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
if (bufToUpdate.find(this) == bufToUpdate.end())
///
void message(docstring const & msg) const;
+ ///
void setGuiDelegate(frontend::GuiBufferDelegate * gui);
+ ///
+ bool Buffer::hasGuiDelegate() const;
///
void autoSave() const;
{
Buffer const * master = buffer()->masterBuffer();
master->tocBackend().updateItem(*this);
+ if (master != buffer() && !master->hasGuiDelegate())
+ // In case the master has no gui associated with it,
+ // the TocItem is not updated (part of bug 5699).
+ buffer()->tocBackend().updateItem(*this);
}