From: Jürgen Spitzmüller Date: Thu, 8 Jan 2009 07:59:37 +0000 (+0000) Subject: * GuiDocument.cpp (dispatchParams): X-Git-Tag: 2.0.0~7481 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=454a2d48325fc1e123c811c963b9632dd54e4e42;p=features.git * GuiDocument.cpp (dispatchParams): - do not set master buffer and warn if the master does not include child - issue warning if the master could not be loaded. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28033 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 0ad171b5aa..23baa30ce6 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2365,7 +2365,19 @@ void GuiDocument::dispatchParams() support::onlyPath(buffer().absFileName())); if (isLyXFilename(master_file.absFilename())) { Buffer * master = checkAndLoadLyXFile(master_file); - const_cast(buffer()).setParent(master); + if (master) { + if (master->isChild(const_cast(&buffer()))) + const_cast(buffer()).setParent(master); + else + Alert::warning(_("Assigned master does not include this file"), + bformat(_("You must include this file in the document\n" + "'%1$s' in order to use the master document\n" + "feature."), from_utf8(params().master))); + } else + Alert::warning(_("Could not load master"), + bformat(_("The master file '%1$s'\n" + "could not be loaded."), + from_utf8(params().master))); } }