mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Move the default module loading from makeDocumentClass() to setBaseClass().
This makes the Document>Settings dialog behave better. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25882 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2bb93b6c54
commit
a28c584064
@ -1428,11 +1428,8 @@ bool BufferParams::setBaseClass(string const & classname)
|
|||||||
bcl.addEmptyClass(classname);
|
bcl.addEmptyClass(classname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bcl[classname].load()) {
|
bool const success = bcl[classname].load();
|
||||||
pimpl_->baseClass_ = classname;
|
if (!success) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
docstring s =
|
docstring s =
|
||||||
bformat(_("The document class %1$s could not be loaded."),
|
bformat(_("The document class %1$s could not be loaded."),
|
||||||
from_utf8(classname));
|
from_utf8(classname));
|
||||||
@ -1440,28 +1437,7 @@ bool BufferParams::setBaseClass(string const & classname)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pimpl_->baseClass_ = classname;
|
||||||
LayoutFile const * BufferParams::baseClass() const
|
|
||||||
{
|
|
||||||
if (LayoutFileList::get().haveClass(pimpl_->baseClass_))
|
|
||||||
return &(LayoutFileList::get()[pimpl_->baseClass_]);
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LayoutFileIndex const & BufferParams::baseClassID() const
|
|
||||||
{
|
|
||||||
return pimpl_->baseClass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BufferParams::makeDocumentClass()
|
|
||||||
{
|
|
||||||
if (!baseClass())
|
|
||||||
return;
|
|
||||||
|
|
||||||
doc_class_ = &(DocumentClassBundle::get().newClass(*baseClass()));
|
|
||||||
|
|
||||||
// add any required modules not already in use
|
// add any required modules not already in use
|
||||||
set<string> const & mods = baseClass()->defaultModules();
|
set<string> const & mods = baseClass()->defaultModules();
|
||||||
@ -1497,6 +1473,31 @@ void BufferParams::makeDocumentClass()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LayoutFile const * BufferParams::baseClass() const
|
||||||
|
{
|
||||||
|
if (LayoutFileList::get().haveClass(pimpl_->baseClass_))
|
||||||
|
return &(LayoutFileList::get()[pimpl_->baseClass_]);
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LayoutFileIndex const & BufferParams::baseClassID() const
|
||||||
|
{
|
||||||
|
return pimpl_->baseClass_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BufferParams::makeDocumentClass()
|
||||||
|
{
|
||||||
|
if (!baseClass())
|
||||||
|
return;
|
||||||
|
|
||||||
|
doc_class_ = &(DocumentClassBundle::get().newClass(*baseClass()));
|
||||||
|
|
||||||
// FIXME It might be worth loading the children's modules here,
|
// FIXME It might be worth loading the children's modules here,
|
||||||
// just as we load their bibliographies and such, instead of just
|
// just as we load their bibliographies and such, instead of just
|
||||||
|
@ -1323,6 +1323,11 @@ void GuiDocument::classChanged()
|
|||||||
bp_.useClassDefaults();
|
bp_.useClassDefaults();
|
||||||
paramsToDialog(bp_);
|
paramsToDialog(bp_);
|
||||||
}
|
}
|
||||||
|
// FIXME There's a little bug here connected with auto_reset, namely,
|
||||||
|
// that, if the preceding is skipped and the user has changed the
|
||||||
|
// modules before changing the class, those changes will be lost on
|
||||||
|
// update. But maybe that's what we want?
|
||||||
|
updateSelectedModules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user