From 832177eb9c89beb187e073bbca9feaa5a0bc8c2e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 7 Jun 2001 15:55:45 +0000 Subject: [PATCH] Fixed python's changing of "." to "," for internationized formats svn: r96 --- src/AbiWordDoc.py | 32 +++++++++++++++++++------------- src/HtmlDoc.py | 12 ++++++++---- src/OpenOfficeDoc.py | 43 ++++++++++++++++++++++++++++--------------- 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/AbiWordDoc.py b/src/AbiWordDoc.py index e3d4fdaf2..0cf939d85 100644 --- a/src/AbiWordDoc.py +++ b/src/AbiWordDoc.py @@ -25,6 +25,8 @@ from TextDoc import * from latin_utf8 import latin_to_utf8 import const import string +import utils +cnv = utils.fl2txt try: import Image @@ -57,14 +59,16 @@ class AbiWordDoc(TextDoc): self.f.write('orientation="portrait" ') else: self.f.write('orientation="landscape" ') - self.f.write('width="%.4f" ' % (self.width/2.54)) - self.f.write('height="%.4f" ' % (self.height/2.54)) + self.f.write('width="%s" ' % cnv("%.4f",self.width/2.54)) + self.f.write('height="%s" ' % cnv("%.4f",self.height/2.54)) self.f.write('units="inch" page-scale="1.000000"/>\n') self.f.write('
\n') def close(self): @@ -114,8 +118,10 @@ class AbiWordDoc(TextDoc): self.f.write('' % ((float(act_height)/72.0)/2.54)) + width = cnv("%.3f",((float(act_width)/72.0)/2.54)) + height = cnv("%.3f",((float(act_height)/72.0)/2.54)) + self.f.write('" props="width:%sin; ' % width) + self.f.write('height:%sin"/>' % height) def start_paragraph(self,style_name): style = self.style_list[style_name] @@ -129,13 +135,13 @@ class AbiWordDoc(TextDoc): self.f.write('text-align:center;') else: self.f.write('text-align:justify;') - rmargin = float(style.get_right_margin())/2.54 - lmargin = float(style.get_left_margin())/2.54 - indent = float(style.get_first_indent())/2.54 - self.f.write(' margin-right:%.4fin;' % rmargin) - self.f.write(' margin-left:%.4fin;' % lmargin) - self.f.write(' tabstops:%.4fin/L;' % lmargin) - self.f.write(' text-indent:%.4fin' % indent) + rmargin = cnv("%.4f",float(style.get_right_margin())/2.54) + lmargin = cnv("%.4f",float(style.get_left_margin())/2.54) + indent = cnv("%.4f",float(style.get_first_indent())/2.54) + self.f.write(' margin-right:%sin;' % rmargin) + self.f.write(' margin-left:%sin;' % lmargin) + self.f.write(' tabstops:%sin/L;' % lmargin) + self.f.write(' text-indent:%sin' % indent) self.f.write('">') font = style.get_font() self.f.write('\n') table_width = float(self.get_usable_width()) - self.f.write('\n') self.f.write('\n') for col in range(0,style.get_columns()): @@ -120,7 +124,9 @@ class OpenOfficeDoc(TextDoc): self.f.write(style_name + '.' + str(chr(ord('A')+col)) +'" ') self.f.write('style:family="table-column">') width = table_width * float(style.get_column_width(col)/100.0) - self.f.write('' % width) + width_str = cnv("%.4f",width) + self.f.write('' % width_str) self.f.write('\n') for cell in self.cell_styles.keys(): cell_style = self.cell_styles[cell] @@ -128,7 +134,8 @@ class OpenOfficeDoc(TextDoc): self.f.write(cell) self.f.write('" style:family="table-cell">\n') self.f.write('\n') @@ -358,17 +369,19 @@ class OpenOfficeDoc(TextDoc): self.f.write('\n') self.f.write('\n') self.f.write('\n') - self.f.write('\n') self.f.write('