Open Document : Issue 4018 and 4017 : random page break + top and bottom margin for paragraphs.

svn: r15490
This commit is contained in:
Serge Noiraud 2010-05-27 19:12:11 +00:00
parent 7d998edc95
commit 59ab92808d

View File

@ -346,7 +346,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
if style.get_padding() != 0.0: if style.get_padding() != 0.0:
self.cntnt.write('fo:padding="%.2fcm" ' % style.get_padding()) self.cntnt.write('fo:padding="%.2fcm" ' % style.get_padding())
if style.get_header_level() > 0: 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() align = style.get_alignment()
if align == PARA_ALIGN_LEFT: if align == PARA_ALIGN_LEFT:
@ -382,8 +382,10 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
style.get_right_margin()) style.get_right_margin())
self.cntnt.write('fo:margin-left="%.2fcm"\n' % self.cntnt.write('fo:margin-left="%.2fcm"\n' %
style.get_left_margin()) style.get_left_margin())
self.cntnt.write('fo:margin-top="0.00cm"\n') self.cntnt.write('fo:margin-top="%.2fcm"\n' %
self.cntnt.write('fo:margin-bottom="0.212cm" ') style.get_top_margin())
self.cntnt.write('fo:margin-bottom="%.2fcm"\n' %
style.get_bottom_margin())
self.cntnt.write('/>\n') self.cntnt.write('/>\n')
self.cntnt.write('</style:style>\n') self.cntnt.write('</style:style>\n')
@ -967,13 +969,15 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
style.get_left_margin()) style.get_left_margin())
self.sfile.write('fo:margin-right="%.2fcm"\n' % self.sfile.write('fo:margin-right="%.2fcm"\n' %
style.get_right_margin()) style.get_right_margin())
self.sfile.write('fo:margin-top="0.00cm"\n') self.sfile.write('fo:margin-top="%.2fcm"\n' %
self.sfile.write('fo:margin-bottom="0.212cm"\n') style.get_top_margin())
self.sfile.write('fo:margin-bottom="%.2fcm"\n' %
style.get_bottom_margin())
if style.get_padding() != 0.0: if style.get_padding() != 0.0:
self.sfile.write('fo:padding="%.2fcm" ' % style.get_padding()) self.sfile.write('fo:padding="%.2fcm" ' % style.get_padding())
if style.get_header_level() > 0: 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() align = style.get_alignment()
if align == PARA_ALIGN_LEFT: if align == PARA_ALIGN_LEFT:
@ -1012,8 +1016,10 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
style.get_right_margin()) style.get_right_margin())
self.sfile.write('fo:margin-left="%.2fcm" ' % self.sfile.write('fo:margin-left="%.2fcm" ' %
style.get_left_margin()) style.get_left_margin())
self.sfile.write('fo:margin-top="0cm" ') self.sfile.write('fo:margin-top="%.2fcm"\n' %
self.sfile.write('fo:margin-bottom="0.212cm"') style.get_top_margin())
self.sfile.write('fo:margin-bottom="%.2fcm"\n' %
style.get_bottom_margin())
self.sfile.write('/>\n') self.sfile.write('/>\n')
self.sfile.write('</style:style>\n') self.sfile.write('</style:style>\n')