From 59ab92808d435cceb5d2c1800f7f9396ea7ef589 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Thu, 27 May 2010 19:12:11 +0000 Subject: [PATCH] Open Document : Issue 4018 and 4017 : random page break + top and bottom margin for paragraphs. svn: r15490 --- src/plugins/docgen/ODFDoc.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/plugins/docgen/ODFDoc.py b/src/plugins/docgen/ODFDoc.py index 34e2177f1..9cc25b21a 100644 --- a/src/plugins/docgen/ODFDoc.py +++ b/src/plugins/docgen/ODFDoc.py @@ -346,7 +346,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): if style.get_padding() != 0.0: self.cntnt.write('fo:padding="%.2fcm" ' % style.get_padding()) if style.get_header_level() > 0: - self.cntnt.write('fo:keep-with-next="true" ') + self.cntnt.write('fo:keep-with-next="auto" ') align = style.get_alignment() if align == PARA_ALIGN_LEFT: @@ -382,8 +382,10 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): style.get_right_margin()) self.cntnt.write('fo:margin-left="%.2fcm"\n' % style.get_left_margin()) - self.cntnt.write('fo:margin-top="0.00cm"\n') - self.cntnt.write('fo:margin-bottom="0.212cm" ') + self.cntnt.write('fo:margin-top="%.2fcm"\n' % + style.get_top_margin()) + self.cntnt.write('fo:margin-bottom="%.2fcm"\n' % + style.get_bottom_margin()) self.cntnt.write('/>\n') self.cntnt.write('\n') @@ -967,13 +969,15 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): style.get_left_margin()) self.sfile.write('fo:margin-right="%.2fcm"\n' % style.get_right_margin()) - self.sfile.write('fo:margin-top="0.00cm"\n') - self.sfile.write('fo:margin-bottom="0.212cm"\n') + self.sfile.write('fo:margin-top="%.2fcm"\n' % + style.get_top_margin()) + self.sfile.write('fo:margin-bottom="%.2fcm"\n' % + style.get_bottom_margin()) if style.get_padding() != 0.0: self.sfile.write('fo:padding="%.2fcm" ' % style.get_padding()) if style.get_header_level() > 0: - self.sfile.write('fo:keep-with-next="always" ') + self.sfile.write('fo:keep-with-next="auto" ') align = style.get_alignment() if align == PARA_ALIGN_LEFT: @@ -1012,8 +1016,10 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): style.get_right_margin()) self.sfile.write('fo:margin-left="%.2fcm" ' % style.get_left_margin()) - self.sfile.write('fo:margin-top="0cm" ') - self.sfile.write('fo:margin-bottom="0.212cm"') + self.sfile.write('fo:margin-top="%.2fcm"\n' % + style.get_top_margin()) + self.sfile.write('fo:margin-bottom="%.2fcm"\n' % + style.get_bottom_margin()) self.sfile.write('/>\n') self.sfile.write('\n')