From 0691ed7ea9d00c416e17aa9a52248bc2fc88109e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 9 Jan 2001 14:30:35 +0000 Subject: [PATCH] Fix class switching bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1307 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 +++++ src/frontends/xforms/FormDocument.C | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ce7407cc8..8ac3da2741 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-01-09 Jean-Marc Lasgouttes + + * src/frontends/xforms/FormDocument.C (CheckChoiceClass): fix + class switching; do not do anything if class has not been changed. + 2001-01-07 Dekel Tsur * lib/build-listerrors: Exit if literate-article doesn't appear in diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 489bfabddd..7032d46b10 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -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); -- 2.39.5