Juergen Spitzmueller wrote:
> apart from that it is an xforms specific problem. The qt
> frontend resets packages to none when the paperformat changes to anything
> different than A4. XForms should do that too

Which would look a like the attached patch, which solves bug 844 
frontend-wise. With this, BufferParams::setPaperStuff and thus the 
papersize/papersize2 distinction could go I think (but this is rather your 
area). This means that the clever stuff moved from the core to frontends 
(advantage is: it is more visible to the user). Any disadvantages? Have I 
missed something?

Jürgen.

P.S.: The other patches (papersize.diff and a4-3.diff should be applied 
nonetheless)
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.664
diff -u -r1.664 ChangeLog
--- src/frontends/xforms/ChangeLog	2003/02/08 21:48:54	1.664
+++ src/frontends/xforms/ChangeLog	2003/02/10 20:04:01
@@ -1,3 +1,8 @@
+2003-02-10  Juergen Spitzmueller  <[EMAIL PROTECTED]>
+
+	* FormDocument.C: Reset paperpackage to NONE when 
+	papersize != A4 (bug 844)
+
 2003-02-08  John Levon  <[EMAIL PROTECTED]>
 
 	* FormPreferences.C: don't call setCurrentAuthor explicitly
Index: src/frontends/xforms/FormDocument.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormDocument.C,v
retrieving revision 1.127
diff -u -r1.127 FormDocument.C
--- src/frontends/xforms/FormDocument.C	2003/02/07 14:28:41	1.127
+++ src/frontends/xforms/FormDocument.C	2003/02/10 20:04:03
@@ -584,7 +584,11 @@
 		bool const enable = ( fl_get_choice(paper_->choice_papersize) == 1
 					&& lyxrc.default_papersize == BufferParams::PAPER_A4PAPER )
 				|| fl_get_choice(paper_->choice_papersize) == 7;
-		setEnabled(paper_->choice_paperpackage, enable && fl_get_button(paper_->radio_portrait));
+		if (!enable)
+			fl_set_choice(paper_->choice_paperpackage,
+				BufferParams::PACKAGE_NONE + 1);
+		setEnabled(paper_->choice_paperpackage, 
+			enable && fl_get_button(paper_->radio_portrait));
 	}
 
 	return ButtonPolicy::SMI_VALID;

Reply via email to