# It include many corrections ( centered text, misalignment, ... )
# Tab replacement by spaces in source code. svn: r6917
This commit is contained in:
parent
bf67ad8ba0
commit
5b1cb3b3d2
@ -693,18 +693,18 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
|
||||
# Current no leading number format for headers
|
||||
|
||||
self.sfile.write('<text:outline-style>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="1" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="2" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="3" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="4" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="5" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="6" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="7" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="8" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="9" style:num-format=""/>\n')
|
||||
self.sfile.write('<text:outline-level-style text:level="10" style:num-format=""/>\n')
|
||||
self.sfile.write('</text:outline-style>\n')
|
||||
#self.sfile.write('<text:outline-style>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="1" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="2" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="3" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="4" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="5" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="6" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="7" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="8" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="9" style:num-format=""/>\n')
|
||||
#self.sfile.write('<text:outline-level-style text:level="10" style:num-format=""/>\n')
|
||||
#self.sfile.write('</text:outline-style>\n')
|
||||
|
||||
self.sfile.write('<text:notes-configuration ')
|
||||
self.sfile.write('text:note-class="footnote" ')
|
||||
@ -724,6 +724,16 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
self.sfile.write('text:increment="5"/> ')
|
||||
self.sfile.write('</office:styles>\n')
|
||||
self.sfile.write('<office:automatic-styles>\n')
|
||||
self.sfile.write('<style:style style:name="S-Header" style:family="paragraph" ')
|
||||
self.sfile.write('style:parent-style-name="Standard">')
|
||||
self.sfile.write('<style:paragraph-properties fo:text-align="center" ')
|
||||
self.sfile.write('style:justify-single-word="false"/>')
|
||||
self.sfile.write('</style:style>\n')
|
||||
self.sfile.write('<style:style style:name="S-Footer" style:family="paragraph" ')
|
||||
self.sfile.write('style:parent-style-name="Header">')
|
||||
self.sfile.write('<style:paragraph-properties fo:text-align="center" ')
|
||||
self.sfile.write('style:justify-single-word="false"/>')
|
||||
self.sfile.write('</style:style>\n')
|
||||
self.sfile.write('<style:page-layout style:name="pm1">\n')
|
||||
self.sfile.write('<style:page-layout-properties fo:page-width="%.2fcm" ' % self.width)
|
||||
self.sfile.write('fo:page-height="%.2fcm" ' % self.height)
|
||||
@ -744,20 +754,39 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
self.sfile.write('style:adjustment="left" style:rel-width="25%" ')
|
||||
self.sfile.write('style:color="#000000"/>\n')
|
||||
self.sfile.write('</style:page-layout-properties>\n')
|
||||
self.sfile.write('<style:header-style/>\n')
|
||||
self.sfile.write('<style:footer-style/>\n')
|
||||
# header
|
||||
self.sfile.write('<style:header-style>\n')
|
||||
self.sfile.write('<style:header-footer-properties ')
|
||||
self.sfile.write('fo:min-height="0cm" fo:margin-bottom="0.499cm"/>\n')
|
||||
self.sfile.write('</style:header-style>\n')
|
||||
# footer
|
||||
self.sfile.write('<style:footer-style>\n')
|
||||
self.sfile.write('<style:header-footer-properties ')
|
||||
self.sfile.write('fo:min-height="0cm" fo:margin-bottom="0.499cm"/>\n')
|
||||
self.sfile.write('</style:footer-style>\n')
|
||||
#
|
||||
self.sfile.write('</style:page-layout>\n')
|
||||
self.sfile.write('</office:automatic-styles>\n')
|
||||
self.sfile.write('<office:master-styles>\n')
|
||||
self.sfile.write('<draw:layer-set>\n')
|
||||
self.sfile.write('<draw:layer draw:name="layout"/>\n')
|
||||
self.sfile.write('<draw:layer draw:name="background"/>\n')
|
||||
self.sfile.write('<draw:layer draw:name="backgroundobjects"/>\n')
|
||||
self.sfile.write('<draw:layer draw:name="controls"/>\n')
|
||||
self.sfile.write('<draw:layer draw:name="measurelines"/>\n')
|
||||
self.sfile.write('</draw:layer-set>\n')
|
||||
self.sfile.write('<style:master-page style:name="Standard" ')
|
||||
self.sfile.write('style:page-layout-name="pm1"/>\n')
|
||||
self.sfile.write('style:page-layout-name="pm1">\n')
|
||||
# header
|
||||
#self.sfile.write('<style:header>')
|
||||
#self.sfile.write('<text:p text:style-name="S-Header">')
|
||||
#self.sfile.write(' TITRE : %s' % self.title) # How to get the document title here ?
|
||||
#self.sfile.write('</text:p>')
|
||||
#self.sfile.write('</style:header>')
|
||||
# footer
|
||||
#self.sfile.write('<style:footer>')
|
||||
#self.sfile.write('<text:p text:style-name="S-Footer">')
|
||||
#self.sfile.write('<text:page-number text:select-page="current">1')
|
||||
#self.sfile.write('</text:page-number>/')
|
||||
#self.sfile.write('<text:page-count>1')
|
||||
#self.sfile.write('</text:page-count>')
|
||||
#self.sfile.write('</text:p>')
|
||||
#self.sfile.write('</style:footer>')
|
||||
#
|
||||
self.sfile.write('</style:master-page>')
|
||||
self.sfile.write('</office:master-styles>\n')
|
||||
self.sfile.write('</office:document-styles>\n')
|
||||
|
||||
@ -934,8 +963,8 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
width = 0
|
||||
for line in text:
|
||||
width = max(width,FontScale.string_width(font,line))
|
||||
wcm = (width/72.0)*2.54*1.5 # *1.2
|
||||
hcm = (height/72.0)*2.54*1.5 # *1.2
|
||||
wcm = (width/72.0)*2.54*1.2
|
||||
hcm = (height/72.0)*2.54*1.2
|
||||
|
||||
rangle = -((pi/180.0) * angle)
|
||||
|
||||
@ -1011,7 +1040,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
pstyle = self.style_list[para_name]
|
||||
font = pstyle.get_font()
|
||||
if box_style.get_width():
|
||||
sw = box_style.get_width()*2.0 # *1.2
|
||||
sw = box_style.get_width()*1.2
|
||||
else:
|
||||
sw = ReportUtils.pt2cm(FontScale.string_width(font,text))*1.3
|
||||
|
||||
@ -1025,7 +1054,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
self.cntnt.write('svg:x="%.2fcm" ' % float(x))
|
||||
self.cntnt.write('svg:y="%.2fcm">' % float(y))
|
||||
self.cntnt.write('<draw:text-box> ' )
|
||||
self.cntnt.write('<text:p text:style-name="X%s">' % para_name)
|
||||
self.cntnt.write('<text:p text:style-name="F%s">' % para_name)
|
||||
self.cntnt.write('<text:span text:style-name="F%s"' % para_name)
|
||||
self.cntnt.write(' fo:max-height="%.2f">' % font.get_size() )
|
||||
self.cntnt.write(text)
|
||||
@ -1085,7 +1114,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
pstyle = self.style_list[para_name]
|
||||
font = pstyle.get_font()
|
||||
|
||||
size = 1.5*(FontScale.string_width(font,text)/72.0) * 2.54
|
||||
size = 1.2*(FontScale.string_width(font,text)/72.0) * 2.54
|
||||
|
||||
self.cntnt.write('<draw:frame text:anchor-type="paragraph" ')
|
||||
self.cntnt.write('draw:style-name="%s" ' % style)
|
||||
@ -1098,7 +1127,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
|
||||
if text != "":
|
||||
self.cntnt.write('<draw:text-box>')
|
||||
self.cntnt.write('<text:p text:style-name="%s">' % para_name)
|
||||
self.cntnt.write('<text:p text:style-name="X%s">' % para_name)
|
||||
self.cntnt.write('<text:span text:style-name="F%s">' % para_name)
|
||||
self.cntnt.write(text)
|
||||
self.cntnt.write('</text:span>\n')
|
||||
@ -1110,7 +1139,7 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
pstyle = self.style_list[style]
|
||||
font = pstyle.get_font()
|
||||
|
||||
size = 2*(FontScale.string_width(font,text)/72.0) * 2.54
|
||||
size = 1.2*(FontScale.string_width(font,text)/72.0) * 2.54
|
||||
|
||||
self.cntnt.write('<draw:frame text:anchor-type="paragraph" ')
|
||||
self.cntnt.write('draw:z-index="0" ')
|
||||
|
Loading…
Reference in New Issue
Block a user