Generate an error dialog if there are unknown layouts.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2247 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-07-16 14:11:35 +00:00
parent 017e942e85
commit 779de95709
2 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-07-13 Dekel Tsur <dekelts@tau.ac.il>
* buffer.C (readLyXformat2): Generate an error dialog if there are
unknown layouts.
2001-07-16 Juergen Vigna <jug@sad.it> 2001-07-16 Juergen Vigna <jug@sad.it>
* sp_spell.C: always compile ISpell part. * sp_spell.C: always compile ISpell part.

View File

@ -298,6 +298,7 @@ ErtComp ert_comp;
} // anon } // anon
set<string> unknown_layouts;
// candidate for move to BufferView // candidate for move to BufferView
// (at least some parts in the beginning of the func) // (at least some parts in the beginning of the func)
@ -309,6 +310,7 @@ ErtComp ert_comp;
// Returns false if "\the_end" is not read for formats >= 2.13. (Asger) // Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par) bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
{ {
unknown_layouts.clear();
#ifdef NO_LATEX #ifdef NO_LATEX
ert_comp.contents.erase(); ert_comp.contents.erase();
ert_comp.active = false; ert_comp.active = false;
@ -363,7 +365,20 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
first_par = par; first_par = par;
paragraph = first_par; paragraph = first_par;
if (!unknown_layouts.empty()) {
string list;
for (set<string>::const_iterator it = unknown_layouts.begin();
it != unknown_layouts.end(); ++it) {
if (it != unknown_layouts.begin())
list += ", ";
list += *it;
}
WriteAlert(_("Textclass Loading Error!"),
_("The following layouts are undefined:"),
list+".");
}
return the_end_read; return the_end_read;
} }
@ -505,6 +520,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// layout not found // layout not found
// use default layout "Standard" (0) // use default layout "Standard" (0)
par->layout = 0; par->layout = 0;
unknown_layouts.insert(layoutname);
} }
// Test whether the layout is obsolete. // Test whether the layout is obsolete.
LyXLayout const & layout = LyXLayout const & layout =