mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 09:04:48 +00:00
Generate an error dialog if there are unknown layouts.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@2251 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
43474a59b4
commit
56c61c66ea
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2001-07-16 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
|
* src/buffer.C (parseSingleLyXformat2Token): Generate error insets
|
||||||
|
for unknown layouts.
|
||||||
|
|
||||||
|
2001-07-13 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
|
* src/buffer.C (readLyXformat2): Generate an error dialog if there are
|
||||||
|
unknown layouts.
|
||||||
|
|
||||||
2001-07-06 Dekel Tsur <dekelts@tau.ac.il>
|
2001-07-06 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* lib/layouts/IEEEtran.layout: Add qed box at the end of proof.
|
* lib/layouts/IEEEtran.layout: Add qed box at the end of proof.
|
||||||
|
19
src/buffer.C
19
src/buffer.C
@ -238,6 +238,7 @@ void Buffer::setFileName(string const & newfile)
|
|||||||
updateTitles();
|
updateTitles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int 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)
|
||||||
@ -249,6 +250,7 @@ void Buffer::setFileName(string const & newfile)
|
|||||||
// 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, LyXParagraph * par)
|
bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
|
||||||
{
|
{
|
||||||
|
unknown_layouts = 0;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
char depth = 0; // signed or unsigned?
|
char depth = 0; // signed or unsigned?
|
||||||
#ifndef NEW_INSETS
|
#ifndef NEW_INSETS
|
||||||
@ -315,6 +317,17 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
|
|||||||
|
|
||||||
paragraph = return_par;
|
paragraph = return_par;
|
||||||
|
|
||||||
|
if (unknown_layouts > 0) {
|
||||||
|
string s = _("Couldn't set the layout for ");
|
||||||
|
if (unknown_layouts == 1) {
|
||||||
|
s += _("one paragraph");
|
||||||
|
} else {
|
||||||
|
s += tostr(unknown_layouts);
|
||||||
|
s += _(" paragraphs");
|
||||||
|
}
|
||||||
|
WriteAlert(_("Textclass Loading Error!"),s);
|
||||||
|
}
|
||||||
|
|
||||||
return the_end_read;
|
return the_end_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,6 +378,12 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
|||||||
} else { // layout not found
|
} else { // layout not found
|
||||||
// use default layout "Standard" (0)
|
// use default layout "Standard" (0)
|
||||||
par->layout = 0;
|
par->layout = 0;
|
||||||
|
++unknown_layouts;
|
||||||
|
string const s = _("Layout had to be changed from\n")
|
||||||
|
+ layoutname + _(" to ")
|
||||||
|
+ textclasslist.NameOfLayout(params.textclass, par->layout);
|
||||||
|
InsetError * new_inset = new InsetError(s);
|
||||||
|
par->InsertInset(0, new_inset);
|
||||||
}
|
}
|
||||||
// Test whether the layout is obsolete.
|
// Test whether the layout is obsolete.
|
||||||
LyXLayout const & layout =
|
LyXLayout const & layout =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user