From 3c01fa17e64645922ea1b957087457e8b8ed8b85 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 10 Apr 2002 14:06:14 +0000 Subject: [PATCH] fontsize3.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3961 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 7 +++++++ src/frontends/xforms/FormDocument.C | 32 ++++++++++++++++++++--------- src/frontends/xforms/FormDocument.h | 2 ++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 23e3827835..38dfafdc9a 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -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 + + * 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 * forms/Makefile.am (SUFFIXES): instead of .SUFFIXES diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 033dbd147c..7a1eaeaab6 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -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 { diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index 6bc93cba56..c3edc94ae1 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -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 &); -- 2.39.2