Michael Schmitt wrote:

- I did not read the full story: "My default paper is US letter, but 
this is not picked up by layout-document-paper, which tries to use cm 
unless I explicitly specify letter again." (#146)

We didn't recognize the default settings in Preferences when chosing 
default_unit. I have attached a fix, which also takes care of the 
papersize for the units in Paragraph (Length Above/ Below).

- Menu item "Insert->Include file" is lacking some "..." (trivial GUI 
stuff)

Fixed.

- Open menu "View->Table of Contents"; press on "TOC" (Type); "Txype" 
is misspelled

I cannot see this (german translation) and didn't find it in the 
sources :-(

Jürgen.

PS: A late "happy new year" to all! I am very busy with my real work at 
the moment and hope to find some more time anytime soon. 
Index: lib/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v
retrieving revision 1.142
diff -u -r1.142 ChangeLog
--- lib/ChangeLog	2001/12/21 13:55:23	1.142
+++ lib/ChangeLog	2002/01/04 12:58:43
@@ -1,3 +1,7 @@
+2002-01-04  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+
+	* ui/default.ui: added dots "..." to insert->include file.
+
 2001-12-21  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>

 	* configure.m4: fix typo in \print_spool_command name.
Index: lib/ui/default.ui
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/ui/default.ui,v
retrieving revision 1.73
diff -u -r1.73 default.ui
--- lib/ui/default.ui	2002/01/03 18:38:17	1.73
+++ lib/ui/default.ui	2002/01/04 12:58:45
@@ -203,7 +203,7 @@
 	Item "Tabular Material...|b" "dialog-tabular-insert"
 	Submenu "Floats|a" "insert_floats"
 	Separator
-	Item "Include File|d" "buffer-child-insert"
+	Item "Include File...|d" "buffer-child-insert"
 	Submenu "Insert File|e" "insert_file"
 	Item "External Material...|x" "external-insert"
     End
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.218
diff -u -r1.218 ChangeLog
--- src/frontends/xforms/ChangeLog	2002/01/03 13:31:11	1.218
+++ src/frontends/xforms/ChangeLog	2002/01/04 12:58:50
@@ -1,3 +1,9 @@
+2002-01-04  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+
+	* FormDocument.C: Recognize the default paper settings too
+	when setting the default length values (cm or inch).
+	* FormParagraph.C: do the same.
+
 2001-12-11  Michael A. Koziarski <[EMAIL PROTECTED]>
 
 	* FormFloat.C: changes to prevent here definitely being used
Index: src/frontends/xforms/FormDocument.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormDocument.C,v
retrieving revision 1.80
diff -u -r1.80 FormDocument.C
--- src/frontends/xforms/FormDocument.C	2001/12/28 13:26:54	1.80
+++ src/frontends/xforms/FormDocument.C	2002/01/04 12:58:53
@@ -451,8 +451,10 @@
 		setEnabled(class_->choice_default_skip_units,
 			   skip_used && length_input);
 		// Default unit choice is cm if metric, inches if US paper.
+		// If papersize is default, check the lyxrc-settings
 		int const paperchoice = fl_get_choice(paper_->choice_papersize);
-		bool const metric = paperchoice < 3 || paperchoice > 5;
+		bool const metric = (paperchoice == 1 && lyxrc.default_papersize > 3)
+			|| paperchoice == 2 || paperchoice > 5;
 		int const default_unit = metric ? 8 : 9;
 		if (strip(fl_get_input(class_->input_doc_skip)).empty())
 			fl_set_choice(class_->choice_default_skip_units,
@@ -487,6 +489,7 @@
 
 	if (ob == paper_->choice_papersize) {
 		int const paperchoice = fl_get_choice(paper_->choice_papersize);
+		bool const defsize = paperchoice == 1;
 		bool const custom = paperchoice == 2;
 		bool const a3size = paperchoice == 6;
 		bool const b3size = paperchoice == 9;
@@ -524,11 +527,13 @@
 		setEnabled(paper_->radio_landscape, !custom);
 
 		// Default unit choice is cm if metric, inches if US paper.
-		bool const metric = paperchoice < 3 || paperchoice > 5;
+		// If papersize is default, use the lyxrc-settings
+		bool const metric = (defsize && lyxrc.default_papersize > 3)
+			|| paperchoice == 2 || paperchoice > 5;
 		int const default_unit = metric ? 8 : 9;
 		if (strip(fl_get_input(paper_->input_custom_width)).empty())
-			fl_set_choice(paper_->choice_custom_width_units,
-				      default_unit);
+		fl_set_choice(paper_->choice_custom_width_units,
+			      default_unit);
 		if (strip(fl_get_input(paper_->input_custom_height)).empty())
 			fl_set_choice(paper_->choice_custom_height_units,
 				      default_unit);
@@ -988,13 +993,14 @@
 		break;
 	case VSpace::LENGTH:
 	{
-		int const paperchoice = params.papersize2 + 1;
-		bool const metric = paperchoice < 3 || paperchoice > 5;
+		int const paperchoice = fl_get_choice(paper_->choice_papersize);
+		bool const metric = (paperchoice == 1 && lyxrc.default_papersize > 3)
+			|| paperchoice == 2 || paperchoice > 5;
 		string const default_unit = metric ? "cm" : "in";
 		string const length = params.getDefSkip().asLyXCommand();
 		updateWidgetsFromLengthString(class_->input_doc_skip,
-					      class_->choice_default_skip_units,
-					      length, default_unit);
+				      class_->choice_default_skip_units,
+				      length, default_unit);
 		break;
 	}
 	default:
@@ -1119,11 +1125,12 @@
 		   && fl_get_button(paper_->radio_portrait));
 
 	// Default unit choice is cm if metric, inches if US paper.
-	bool const metric = paperchoice < 3 || paperchoice > 5;
+	bool const metric = (paperchoice == 1 && lyxrc.default_papersize > 3)
+			|| paperchoice == 2 || paperchoice > 5;
 	string const default_unit = metric ? "cm" : "in";
 	updateWidgetsFromLengthString(paper_->input_custom_width,
-				      paper_->choice_custom_width_units,
-				      params.paperwidth, default_unit);
+			      paper_->choice_custom_width_units,
+			      params.paperwidth, default_unit);
 	setEnabled(paper_->input_custom_width, useCustom);
 	setEnabled(paper_->choice_custom_width_units, useCustom);
 
Index: src/frontends/xforms/FormParagraph.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormParagraph.C,v
retrieving revision 1.46
diff -u -r1.46 FormParagraph.C
--- src/frontends/xforms/FormParagraph.C	2001/12/28 13:26:54	1.46
+++ src/frontends/xforms/FormParagraph.C	2002/01/04 12:58:54
@@ -25,6 +25,7 @@
 #include "buffer.h"
 #include "lyxtext.h"
 #include "xforms_helpers.h"
+#include "lyxrc.h" // to set the deafult length values
 #include "BufferView.h"
 #include "lyxtextclasslist.h"
 #include "Spacing.h"
@@ -401,12 +402,13 @@
 	break;
     case VSpace::LENGTH:
     {
-	    fl_set_choice (dialog_->choice_space_above, 7);
-	    setEnabled(dialog_->input_space_above, true);
-	    setEnabled(dialog_->choice_value_space_above, true);
-	    string const default_unit = "cm";
-	    string const length = par_->params().spaceTop().length().asString();
-	    updateWidgetsFromLengthString(dialog_->input_space_above,
+		fl_set_choice (dialog_->choice_space_above, 7);
+		setEnabled(dialog_->input_space_above, true);
+		setEnabled(dialog_->choice_value_space_above, true);
+		bool const metric = lyxrc.default_papersize > 3;
+		string const default_unit = metric ? "cm" : "in";
+		string const length = par_->params().spaceTop().length().asString();
+		updateWidgetsFromLengthString(dialog_->input_space_above,
 					  dialog_->choice_value_space_above,
 					  length, default_unit);
 	    break;
@@ -440,13 +442,14 @@
 	break;
     case VSpace::LENGTH:
     {
-	    fl_set_choice (dialog_->choice_space_below, 7);
-	    setEnabled(dialog_->input_space_below, true);
-	    setEnabled(dialog_->choice_value_space_below, true);
-	    string const default_unit = "cm";
-	    string const length =
-		    par_->params().spaceBottom().length().asString();
-	    updateWidgetsFromLengthString(dialog_->input_space_below,
+		fl_set_choice (dialog_->choice_space_below, 7);
+		setEnabled(dialog_->input_space_below, true);
+		setEnabled(dialog_->choice_value_space_below, true);
+		bool const metric = lyxrc.default_papersize > 3;
+		string const default_unit = metric ? "cm" : "in";
+		string const length =
+			par_->params().spaceBottom().length().asString();
+		updateWidgetsFromLengthString(dialog_->input_space_below,
 					  dialog_->choice_value_space_below,
 					  length, default_unit);
 	    break;
@@ -478,11 +481,12 @@
             setEnabled (dialog_->input_space_above, false);
            setEnabled (dialog_->choice_value_space_above, false);
         } else {
-            setEnabled (dialog_->input_space_above, !lv_->buffer()->isReadonly());
-           setEnabled (dialog_->choice_value_space_above, !lv_->buffer()->isReadonly());
-           int const default_unit = 8;
-           if (strip(fl_get_input(dialog_->input_space_above)).empty())
-                       fl_set_choice(dialog_->choice_value_space_above,
+		setEnabled (dialog_->input_space_above, !lv_->buffer()->isReadonly());
+		setEnabled (dialog_->choice_value_space_above, !lv_->buffer()->isReadonly());
+		bool const metric = lyxrc.default_papersize > 3;
+		int const default_unit = metric ? 8 : 9;
+		if (strip(fl_get_input(dialog_->input_space_above)).empty())
+			fl_set_choice(dialog_->choice_value_space_above,
                                      default_unit);
         }
     }
@@ -492,11 +496,12 @@
             setEnabled (dialog_->input_space_below, false);
            setEnabled (dialog_->choice_value_space_below, false);
         } else {
-            setEnabled (dialog_->input_space_below, !lv_->buffer()->isReadonly());
-           setEnabled (dialog_->choice_value_space_below, !lv_->buffer()->isReadonly());
-           int const default_unit = 8;
-           if (strip(fl_get_input(dialog_->input_space_below)).empty())
-                       fl_set_choice(dialog_->choice_value_space_below,
+		setEnabled (dialog_->input_space_below, !lv_->buffer()->isReadonly());
+	    	setEnabled (dialog_->choice_value_space_below, !lv_->buffer()->isReadonly());
+		bool const metric = lyxrc.default_papersize > 3;
+		int const default_unit = metric ? 8 : 9;
+		if (strip(fl_get_input(dialog_->input_space_below)).empty())
+			fl_set_choice(dialog_->choice_value_space_below,
                                      default_unit);
         }
     }

Reply via email to