>>>>> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> New Doc, Layout->Doceument->Save as Document Defaults, Yes.
Andre> Boom.

Andre> Does anybody else see this?

I think the attached patch fixes the problem (the new created empty
paragraph did not have a valid layout). I did also fix it in the new
controldocument, although I am not able to actually test it.

OK to apply?

JMarc

? config.h.in
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.235
diff -u -p -r1.235 ChangeLog
--- src/frontends/controllers/ChangeLog	9 Oct 2002 08:59:01 -0000	1.235
+++ src/frontends/controllers/ChangeLog	9 Oct 2002 14:55:08 -0000
@@ -1,3 +1,8 @@
+2002-10-09  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* ControlDocument.C (saveAsDefault): make sure the empty paragraph
+	we create has a valid layout
+
 2002-10-09  Edwin Leuven <[EMAIL PROTECTED]>
 
 	* ControlDocument.h:
Index: src/frontends/controllers/ControlDocument.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDocument.C,v
retrieving revision 1.1
diff -u -p -r1.1 ControlDocument.C
--- src/frontends/controllers/ControlDocument.C	9 Oct 2002 08:59:01 -0000	1.1
+++ src/frontends/controllers/ControlDocument.C	9 Oct 2002 14:55:08 -0000
@@ -153,7 +153,9 @@ void ControlDocument::saveAsDefault()
 	defaults.params = params();
 
 	// add an empty paragraph. Is this enough?
-	defaults.paragraphs.set(new Paragraph);
+	Paragraph * par = new Paragraph;
+	par->layout(params().getLyXTextClass().defaultLayout());
+	defaults.paragraphs.set(par);
 	
 	defaults.writeFile(defaults.fileName());
 
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.557
diff -u -p -r1.557 ChangeLog
--- src/frontends/xforms/ChangeLog	9 Oct 2002 14:38:18 -0000	1.557
+++ src/frontends/xforms/ChangeLog	9 Oct 2002 14:55:09 -0000
@@ -1,5 +1,8 @@
 2002-10-09  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
+	* FormDocument.C (saveParamsAsDefault): make sure the empty
+	paragraph we create has a valid layout
+
 	* xforms_helpers.C (formatted): fix small typo, spotted by Rob
 	Lahaye 
 
Index: src/frontends/xforms/FormDocument.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormDocument.C,v
retrieving revision 1.119
diff -u -p -r1.119 FormDocument.C
--- src/frontends/xforms/FormDocument.C	4 Oct 2002 10:39:01 -0000	1.119
+++ src/frontends/xforms/FormDocument.C	9 Oct 2002 14:55:09 -0000
@@ -412,7 +412,9 @@ bool saveParamsAsDefault(BufferParams co
 	defaults.params = params;
 
 	// add an empty paragraph. Is this enough?
-	defaults.paragraphs.set(new Paragraph);
+	Paragraph * par = new Paragraph;
+	par->layout(params.getLyXTextClass().defaultLayout());
+	defaults.paragraphs.set(par);
 
 	return defaults.writeFile(defaults.fileName());
 }

Reply via email to