From dceb900362002fc6aa32c1974c4145252d91f141 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Tue, 8 Jun 2010 18:39:45 +0000 Subject: [PATCH] Open Document : Issue 4018 and 4017 : random page break + top and bottom margin for paragraphs. svn: r15543 --- 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 21c05490f..428a1bc10 100644 --- a/src/plugins/docgen/ODFDoc.py +++ b/src/plugins/docgen/ODFDoc.py @@ -345,7 +345,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: @@ -381,8 +381,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') @@ -966,13 +968,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: @@ -1011,8 +1015,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')