]> git.lyx.org Git - features.git/commitdiff
Fix class switching bug
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 9 Jan 2001 14:30:35 +0000 (14:30 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 9 Jan 2001 14:30:35 +0000 (14:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1307 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/frontends/xforms/FormDocument.C

index 0ce7407cc81f788f4d0c1d17f47d2206ab8ec783..8ac3da27410c0498d86018bfa148458f4095f1ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 489bfabdddef9d83cf23f2511c85e42189df50f2..7032d46b10947fa77fde7b3142444001ace0559a 100644 (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);