]> git.lyx.org Git - features.git/commitdiff
fontsize3.diff
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 10 Apr 2002 14:06:14 +0000 (14:06 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 10 Apr 2002 14:06:14 +0000 (14:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3961 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormDocument.h

index 23e3827835b7a0a84ad58342fe871e051658b797..38dfafdc9a1ff6b5365ccf1e34faf1274d084ba9 100644 (file)
@@ -3,6 +3,13 @@
        * xformsGImage.C (clip): no need to check if the width, height are > 0
        because the BoundingBox would be empty() in this weren't the case.
 
+2002-04-08  Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+       * FormDocument.[Ch]: Add a new method UpdateClassParams
+       which is used in CheckChoiceClass to update the fontsizes
+       and other necessary stuff (pagestyle) on class change
+       (hopefully finally fix bug #306)
+
 2002-04-08  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * forms/Makefile.am (SUFFIXES): instead of .SUFFIXES
index 033dbd147cf0b384a129522ed28a3a93411103fe..7a1eaeaab601be0b71e4757e0011a36095029d43 100644 (file)
@@ -964,28 +964,38 @@ void FormDocument::bullets_apply()
        bullets_apply(lv_->buffer()->params);
 }
 
-
-void FormDocument::class_update(BufferParams const & params)
+void FormDocument::UpdateClassParams(BufferParams const & params)
 {
-       if (!class_.get())
-               return;
+       // These are the params that have to be updated on any class change
+       // (even if the class defaults are not used) (JSpitzm 2002-04-08)
 
        LyXTextClass const & tclass = textclasslist[params.textclass];
 
        combo_doc_class->select(tclass.description());
-       fl_set_choice_text(class_->choice_doc_fonts, params.fonts.c_str());
        fl_clear_choice(class_->choice_doc_fontsize);
        fl_addto_choice(class_->choice_doc_fontsize, "default");
        fl_addto_choice(class_->choice_doc_fontsize,
                        tclass.opt_fontsize().c_str());
-       fl_set_choice(class_->choice_doc_fontsize,
-                     tokenPos(tclass.opt_fontsize(), '|', params.fontsize)+2);
+       fl_set_choice_text(class_->choice_doc_fontsize,
+                       params.fontsize.c_str());
        fl_clear_choice(class_->choice_doc_pagestyle);
        fl_addto_choice(class_->choice_doc_pagestyle, "default");
        fl_addto_choice(class_->choice_doc_pagestyle,
                        tclass.opt_pagestyle().c_str());
-       fl_set_choice(class_->choice_doc_pagestyle,
-                     tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle)+2);
+       fl_set_choice_text(class_->choice_doc_pagestyle,
+                       params.pagestyle.c_str());
+
+}
+
+void FormDocument::class_update(BufferParams const & params)
+{
+       if (!class_.get())
+               return;
+
+       UpdateClassParams(params);
+
+       fl_set_choice_text(class_->choice_doc_fonts,
+               params.fonts.c_str());
        fl_set_button(class_->radio_doc_indent, 0);
        fl_set_button(class_->radio_doc_skip, 0);
        if (params.paragraph_separation == BufferParams::PARSEP_INDENT)
@@ -1459,8 +1469,10 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
                        params.useClassDefaults();
                        UpdateLayoutDocument(params);
                } else {
+                       // update the params which are needed in any case
+                       // (fontsizes, pagestyle)
                        params.textclass = tc;
-                       UpdateLayoutDocument(params);
+                       UpdateClassParams(params);
                }
 
        } else {
index 6bc93cba56e290db23b5783544036a14f9da3bba..c3edc94ae1b6f05611a75b7ed9ed1c462545705f 100644 (file)
@@ -108,6 +108,8 @@ private:
        void CheckChoiceClass(FL_OBJECT * ob, long);
        ///
        void UpdateLayoutDocument(BufferParams const & params);
+       ///
+       void UpdateClassParams(BufferParams const & params);
 
        ///
        void paper_update(BufferParams const &);