# It include many corrections ( centered text, misalignment, ... )

# Tab replacement by spaces in source code.



svn: r6917
This commit is contained in:
Serge Noiraud 2006-06-19 20:48:28 +00:00
parent bf67ad8ba0
commit 5b1cb3b3d2

View File

@ -113,24 +113,24 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.cntnt.write('<office:document-content ')
self.cntnt.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.cntnt.write('xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" ')
self.cntnt.write('xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" ')
self.cntnt.write('xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" ')
self.cntnt.write('xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" ')
self.cntnt.write('xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" ')
self.cntnt.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.cntnt.write('xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" ')
self.cntnt.write('xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" ')
self.cntnt.write('xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" ')
self.cntnt.write('xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" ')
self.cntnt.write('xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" ')
self.cntnt.write('xmlns:xlink="http://www.w3.org/1999/xlink" ')
self.cntnt.write('xmlns:dc="http://purl.org/dc/elements/1.1/" ')
self.cntnt.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.cntnt.write('xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" ')
self.cntnt.write('xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" ')
self.cntnt.write('xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" ')
self.cntnt.write('xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" ')
self.cntnt.write('xmlns:dc="http://purl.org/dc/elements/1.1/" ')
self.cntnt.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.cntnt.write('xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" ')
self.cntnt.write('xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" ')
self.cntnt.write('xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" ')
self.cntnt.write('xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" ')
self.cntnt.write('xmlns:math="http://www.w3.org/1998/Math/MathML" ')
self.cntnt.write('xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" ')
self.cntnt.write('xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" ')
self.cntnt.write('xmlns:dom="http://www.w3.org/2001/xml-events" ')
self.cntnt.write('xmlns:xforms="http://www.w3.org/2002/xforms" ')
self.cntnt.write('xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" ')
self.cntnt.write('xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" ')
self.cntnt.write('xmlns:dom="http://www.w3.org/2001/xml-events" ')
self.cntnt.write('xmlns:xforms="http://www.w3.org/2002/xforms" ')
self.cntnt.write('office:class="text" office:version="1.0">\n')
self.cntnt.write('<office:scripts/>\n')
self.cntnt.write('<office:font-face-decls>\n')
@ -147,7 +147,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('</office:font-face-decls>\n')
self.cntnt.write('<office:automatic-styles>\n')
self.cntnt.write('<style:style style:name="docgen_page_break" style:family="paragraph" ')
self.cntnt.write('style:parent-style-name="Standard">\n')
self.cntnt.write('style:parent-style-name="Standard">\n')
self.cntnt.write('<style:paragraph-properties fo:break-before="page"/>\n')
self.cntnt.write('</style:style>\n')
self.cntnt.write('<style:style style:name="GSuper" style:family="text">')
@ -401,11 +401,11 @@ class ODFDoc(BaseDoc.BaseDoc):
self.cntnt.write('<office:body>\n')
self.cntnt.write(' <office:text>\n')
self.cntnt.write(' <office:forms ')
self.cntnt.write('form:automatic-focus="false" ')
self.cntnt.write('form:apply-design-mode="false"/>\n')
self.cntnt.write('form:automatic-focus="false" ')
self.cntnt.write('form:apply-design-mode="false"/>\n')
def close(self):
self.cntnt.write('</office:text>\n')
self.cntnt.write('</office:text>\n')
self.cntnt.write('</office:body>\n')
self.cntnt.write('</office:document-content>\n')
self._write_styles_file()
@ -543,26 +543,26 @@ class ODFDoc(BaseDoc.BaseDoc):
self.sfile.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.sfile.write('<office:document-styles ')
self.sfile.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.sfile.write('xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" ')
self.sfile.write('xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" ')
self.sfile.write('xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" ')
self.sfile.write('xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" ')
self.sfile.write('xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" ')
self.sfile.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.sfile.write('xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" ')
self.sfile.write('xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" ')
self.sfile.write('xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" ')
self.sfile.write('xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" ')
self.sfile.write('xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" ')
self.sfile.write('xmlns:xlink="http://www.w3.org/1999/xlink" ')
self.sfile.write('xmlns:dc="http://purl.org/dc/elements/1.1/" ')
self.sfile.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.sfile.write('xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" ')
self.sfile.write('xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" ')
self.sfile.write('xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" ')
self.sfile.write('xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" ')
self.sfile.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.sfile.write('xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" ')
self.sfile.write('xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" ')
self.sfile.write('xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" ')
self.sfile.write('xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" ')
self.sfile.write('xmlns:math="http://www.w3.org/1998/Math/MathML" ')
self.sfile.write('xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" ')
self.sfile.write('xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" ')
self.sfile.write('xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" ')
self.sfile.write('xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" ')
self.sfile.write('office:version="1.0">\n')
self.sfile.write('<office:font-face-decls>\n')
self.sfile.write('<style:font-face style:name="Times New Roman"')
self.sfile.write(' svg:font-family="&apos;Times New Roman&apos;"')
self.sfile.write(' svg:font-family="&apos;Times New Roman&apos;"')
self.sfile.write(' style:font-family-generic="roman"')
self.sfile.write(' style:font-pitch="variable"/>\n')
self.sfile.write('<style:font-face style:name="Arial"')
@ -573,57 +573,57 @@ class ODFDoc(BaseDoc.BaseDoc):
self.sfile.write('<office:styles>\n')
self.sfile.write('<style:default-style ')
self.sfile.write(' style:family="graphic">\n')
self.sfile.write('<style:graphic-properties ')
self.sfile.write(' draw:shadow-offset-x="0.3cm"')
self.sfile.write(' draw:shadow-offset-y="0.3cm" ')
self.sfile.write(' draw:start-line-spacing-horizontal="0.283cm" ')
self.sfile.write(' draw:start-line-spacing-vertical="0.283cm" ')
self.sfile.write(' draw:end-line-spacing-horizontal="0.283cm" ')
self.sfile.write(' draw:end-line-spacing-vertical="0.283cm" ')
self.sfile.write(' style:flow-with-text="true"/>')
self.sfile.write('<style:paragraph-properties ')
self.sfile.write(' style:text-autospace="ideograph-alpha" ')
self.sfile.write(' style:line-break="strict" ')
self.sfile.write(' style:writing-mode="lr-tb" ')
self.sfile.write(' style:font-independent-line-spacing="false">')
self.sfile.write(' <style:tab-stops/>')
self.sfile.write(' </style:paragraph-properties>')
self.sfile.write('<style:text-properties ')
self.sfile.write(' style:use-window-font-color="true" ')
self.sfile.write(' fo:font-size="12pt" ')
self.sfile.write(' style:font-size-asian="12pt" ')
self.sfile.write(' style:language-asian="none" ')
self.sfile.write(' style:country-asian="none" ')
self.sfile.write(' style:font-size-complex="12pt" ')
self.sfile.write(' style:language-complex="none" ')
self.sfile.write(' style:country-complex="none"/>')
self.sfile.write('<style:graphic-properties ')
self.sfile.write(' draw:shadow-offset-x="0.3cm"')
self.sfile.write(' draw:shadow-offset-y="0.3cm" ')
self.sfile.write(' draw:start-line-spacing-horizontal="0.283cm" ')
self.sfile.write(' draw:start-line-spacing-vertical="0.283cm" ')
self.sfile.write(' draw:end-line-spacing-horizontal="0.283cm" ')
self.sfile.write(' draw:end-line-spacing-vertical="0.283cm" ')
self.sfile.write(' style:flow-with-text="true"/>')
self.sfile.write('<style:paragraph-properties ')
self.sfile.write(' style:text-autospace="ideograph-alpha" ')
self.sfile.write(' style:line-break="strict" ')
self.sfile.write(' style:writing-mode="lr-tb" ')
self.sfile.write(' style:font-independent-line-spacing="false">')
self.sfile.write(' <style:tab-stops/>')
self.sfile.write(' </style:paragraph-properties>')
self.sfile.write('<style:text-properties ')
self.sfile.write(' style:use-window-font-color="true" ')
self.sfile.write(' fo:font-size="12pt" ')
self.sfile.write(' style:font-size-asian="12pt" ')
self.sfile.write(' style:language-asian="none" ')
self.sfile.write(' style:country-asian="none" ')
self.sfile.write(' style:font-size-complex="12pt" ')
self.sfile.write(' style:language-complex="none" ')
self.sfile.write(' style:country-complex="none"/>')
self.sfile.write('</style:default-style>\n')
self.sfile.write('<style:default-style ')
self.sfile.write(' style:family="paragraph">\n')
self.sfile.write(' <style:paragraph-properties\n')
self.sfile.write(' style:text-autospace="ideograph-alpha"\n')
self.sfile.write(' style:punctuation-wrap="hanging"\n')
self.sfile.write(' style:text-autospace="ideograph-alpha"\n')
self.sfile.write(' style:punctuation-wrap="hanging"\n')
self.sfile.write(' style:line-break="strict"\n')
self.sfile.write(' style:tab-stop-distance="2.205cm"\n')
self.sfile.write(' style:writing-mode="page"/>\n')
self.sfile.write('<style:text-properties \n')
self.sfile.write('style:font-name="Times New Roman" ')
self.sfile.write('style:font-name="Times New Roman" ')
self.sfile.write('fo:font-size="12pt" ')
self.sfile.write('style:font-name-asian="Times New Roman" ')
self.sfile.write('style:font-name-asian="Times New Roman" ')
self.sfile.write('style:font-size-asian="12pt" ')
self.sfile.write('style:font-name-complex="Times New Roman" ')
self.sfile.write('style:font-name-complex="Times New Roman" ')
self.sfile.write('style:font-size-complex="12pt" ')
self.sfile.write('style:tab-stop-distance="2.205cm"/>\n')
self.sfile.write('</style:default-style>\n')
self.sfile.write('<style:default-style ')
self.sfile.write(' style:family="table"> ')
self.sfile.write(' <style:table-properties ')
self.sfile.write(' table:border-model="separating"/> ')
self.sfile.write(' style:family="table"> ')
self.sfile.write(' <style:table-properties ')
self.sfile.write(' table:border-model="separating"/> ')
self.sfile.write('</style:default-style>\n')
self.sfile.write('<style:default-style ')
self.sfile.write(' style:family="table-row"> ')
self.sfile.write(' <style:table-row-properties ')
self.sfile.write(' fo:keep-together="auto"/> ')
self.sfile.write(' style:family="table-row"> ')
self.sfile.write(' <style:table-row-properties ')
self.sfile.write(' fo:keep-together="auto"/> ')
self.sfile.write('</style:default-style>\n')
self.sfile.write('<style:style style:name="Standard" ')
self.sfile.write('style:family="paragraph" style:class="text"/>\n')
@ -666,8 +666,8 @@ class ODFDoc(BaseDoc.BaseDoc):
self.sfile.write('fo:text-align="justify" ')
self.sfile.write('style:justify-single-word="false" ')
self.sfile.write('fo:text-indent="%.2fcm" ' % style.get_first_indent())
self.sfile.write('style:auto-text-indent="false"/> ')
self.sfile.write('<style:text-properties ')
self.sfile.write('style:auto-text-indent="false"/> ')
self.sfile.write('<style:text-properties ')
font = style.get_font()
color = font.get_color()
self.sfile.write('fo:color="#%02x%02x%02x" ' % color)
@ -686,44 +686,54 @@ class ODFDoc(BaseDoc.BaseDoc):
self.sfile.write('fo:text-indent="%.2fcm" ' % style.get_first_indent())
self.sfile.write('fo:margin-right="%.2fcm" ' % 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="0cm" ')
self.sfile.write('fo:margin-bottom="0.212cm"')
self.sfile.write('/>\n')
self.sfile.write('</style:style>\n')
# 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" ')
self.sfile.write('style:num-format="1" ')
self.sfile.write('text:start-value="0" ')
self.sfile.write('text:footnotes-position="page" ')
self.sfile.write('text:start-numbering-at="document"/> ')
self.sfile.write('<text:notes-configuration ')
self.sfile.write('text:note-class="endnote" ')
self.sfile.write('style:num-format="i" ')
self.sfile.write('text:start-value="0"/> ')
self.sfile.write('<text:linenumbering-configuration ')
self.sfile.write('text:number-lines="false" ')
self.sfile.write('text:offset="0.499cm" ')
self.sfile.write('style:num-format="1" ')
self.sfile.write('text:number-position="left" ')
self.sfile.write('text:increment="5"/> ')
self.sfile.write('<text:notes-configuration ')
self.sfile.write('text:note-class="footnote" ')
self.sfile.write('style:num-format="1" ')
self.sfile.write('text:start-value="0" ')
self.sfile.write('text:footnotes-position="page" ')
self.sfile.write('text:start-numbering-at="document"/> ')
self.sfile.write('<text:notes-configuration ')
self.sfile.write('text:note-class="endnote" ')
self.sfile.write('style:num-format="i" ')
self.sfile.write('text:start-value="0"/> ')
self.sfile.write('<text:linenumbering-configuration ')
self.sfile.write('text:number-lines="false" ')
self.sfile.write('text:offset="0.499cm" ')
self.sfile.write('style:num-format="1" ')
self.sfile.write('text:number-position="left" ')
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:master-page style:name="Standard" ')
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')
@ -846,7 +875,7 @@ class ODFDoc(BaseDoc.BaseDoc):
self.mfile.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.mfile.write('<manifest:manifest ')
self.mfile.write('xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">')
self.mfile.write('xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0">')
self.mfile.write('<manifest:file-entry ')
self.mfile.write('manifest:media-type="%s" ' % _apptype)
self.mfile.write('manifest:full-path="/"/>')
@ -876,22 +905,22 @@ class ODFDoc(BaseDoc.BaseDoc):
self.meta.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.meta.write('<office:document-meta ')
self.meta.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.meta.write('xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" ')
self.meta.write('xmlns:xlink="http://www.w3.org/1999/xlink" ')
self.meta.write('xmlns:dc="http://purl.org/dc/elements/1.1/" ')
self.meta.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.meta.write('xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ')
self.meta.write('office:version="1.0">\n');
self.meta.write('<office:meta>\n')
self.meta.write('<meta:generator>')
self.meta.write(const.program_name + ' ' + const.version)
self.meta.write('</meta:generator>\n')
self.meta.write('<dc:title>')
# It should be reasonable to have a true document title. but how ?
# self.title ?
#self.meta.write(_("Summary of %s") % self.name)
# It should be reasonable to have a true document title. but how ?
# self.title ?
#self.meta.write(_("Summary of %s") % self.name)
self.meta.write('</dc:title>\n')
self.meta.write('<dc:subject>')
#self.meta.write(_("Summary of %s") % name)
#self.meta.write(_("Summary of %s") % name)
self.meta.write('</dc:subject>\n')
self.meta.write('<dc:description>')
self.meta.write('</dc:description>\n')
@ -913,8 +942,8 @@ class ODFDoc(BaseDoc.BaseDoc):
self.meta.write('<dc:language>%s</dc:language>\n' % self.lang)
self.meta.write('<meta:editing-cycles>1</meta:editing-cycles>\n')
self.meta.write('<meta:editing-duration>PT0S</meta:editing-duration>\n')
self.meta.write('<meta:user-defined meta:name="Genealogical Research and Analysis Management Programming System">http://gramps-project.org')
self.meta.write('</meta:user-defined>\n')
self.meta.write('<meta:user-defined meta:name="Genealogical Research and Analysis Management Programming System">http://gramps-project.org')
self.meta.write('</meta:user-defined>\n')
self.meta.write('<meta:user-defined meta:name="Info 1"/>\n')
self.meta.write('<meta:user-defined meta:name="Info 2"/>\n')
self.meta.write('<meta:user-defined meta:name="Info 3"/>\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" ')