Fix class switching bug

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1307 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-01-09 14:30:35 +00:00
parent 43772015fd
commit 0691ed7ea9
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2001-01-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/frontends/xforms/FormDocument.C (CheckChoiceClass): fix
class switching; do not do anything if class has not been changed.
2001-01-07 Dekel Tsur <dekelts@tau.ac.il>
* lib/build-listerrors: Exit if literate-article doesn't appear in

View File

@ -417,6 +417,7 @@ bool FormDocument::class_apply()
#else
unsigned int const new_class = fl_get_choice(class_->choice_doc_class) - 1;
#endif
if (params.textclass != new_class) {
// try to load new_class
if (textclasslist.Load(new_class)) {
@ -1091,10 +1092,13 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
string tct = fl_get_choice_text(ob);
#endif
if (textclasslist.Load(tc)) {
if (AskQuestion(_("Should I set some parameters to"), tct,
_("the defaults of this document class?"))) {
BufferParams & params = lv_->buffer()->params;
// we use a copy of the bufferparams because we do not
// want to modify them yet.
BufferParams params = lv_->buffer()->params;
if (params.textclass != tc
&& AskQuestion(_("Should I set some parameters to"),
_("the defaults of this document class?"))) {
params.textclass = tc;
params.useClassDefaults();
UpdateLayoutDocument(params);