* src/docgen/PSDrawDoc.py: Use ReportUtils.pt2cm.
* src/docgen/OpenOfficeDoc.py: Use ReportUtils.pt2cm. * src/docgen/ODFDoc.py: Use ReportUtils.pt2cm. svn: r6858
This commit is contained in:
parent
1b473c8178
commit
5848cf17b2
@ -1,4 +1,7 @@
|
||||
2006-06-04 Alex Roitman <shura@gramps-project.org>
|
||||
* src/docgen/PSDrawDoc.py: Use ReportUtils.pt2cm.
|
||||
* src/docgen/OpenOfficeDoc.py: Use ReportUtils.pt2cm.
|
||||
* src/docgen/ODFDoc.py: Use ReportUtils.pt2cm.
|
||||
* src/ReportBase/Makefile.am (pkgdata_PYTHON): Remove _BookReport.py
|
||||
* src/plugins/Makefile.am (pkgdata_PYTHON): Move BookReport.py
|
||||
|
||||
|
@ -42,7 +42,6 @@ import BaseDoc
|
||||
import const
|
||||
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
|
||||
from ReportBase import ReportUtils
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import Mime
|
||||
@ -1014,13 +1013,14 @@ class ODFDoc(BaseDoc.BaseDoc):
|
||||
if box_style.get_width():
|
||||
sw = box_style.get_width()*2.0 # *1.2
|
||||
else:
|
||||
sw = pt2cm(FontScale.string_width(font,text))*1.3
|
||||
sw = ReportUtils.pt2cm(FontScale.string_width(font,text))*1.3
|
||||
|
||||
self.cntnt.write('<draw:frame text:anchor-type="paragraph" ')
|
||||
self.cntnt.write('draw:z-index="2" ')
|
||||
self.cntnt.write('draw:style-name="%s" ' % style)
|
||||
self.cntnt.write('svg:width="%.2fcm" ' % sw)
|
||||
self.cntnt.write('svg:height="%.2fcm" ' % (pt2cm(font.get_size()*1.4)))
|
||||
self.cntnt.write('svg:height="%.2fcm" ' %
|
||||
(ReportUtils.pt2cm(font.get_size()*1.4)))
|
||||
|
||||
self.cntnt.write('svg:x="%.2fcm" ' % float(x))
|
||||
self.cntnt.write('svg:y="%.2fcm">' % float(y))
|
||||
|
@ -42,7 +42,6 @@ import BaseDoc
|
||||
import const
|
||||
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
|
||||
from ReportBase import ReportUtils
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
import ImgManip
|
||||
import FontScale
|
||||
import Mime
|
||||
@ -891,7 +890,7 @@ class OpenOfficeDoc(BaseDoc.BaseDoc):
|
||||
if box_style.get_width():
|
||||
sw = box_style.get_width()
|
||||
else:
|
||||
sw = pt2cm(FontScale.string_width(font,text))*1.3
|
||||
sw = ReportUtils.pt2cm(FontScale.string_width(font,text))*1.3
|
||||
|
||||
|
||||
self.cntnt.write('<draw:text-box draw:style-name="%s" ' % style)
|
||||
|
@ -29,19 +29,14 @@ from math import pi, cos, sin
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#Gramps modules
|
||||
#-------------------------------------------------------------------------
|
||||
from PluginUtils import register_draw_doc
|
||||
from ReportBase import Report, ReportUtils
|
||||
pt2cm, rgb_color = ReportUtils.pt2cm, ReportUtils.rgb_color
|
||||
import Errors
|
||||
import BaseDoc
|
||||
from Utils import gformat
|
||||
#from PluginUtils import register_draw_doc from ReportBase import
|
||||
#Report, ReportUtils import Errors import BaseDoc from Utils import
|
||||
#gformat
|
||||
|
||||
def lrgb(grp):
|
||||
grp = rgb_color(grp)
|
||||
grp = ReportUtils.rgb_color(grp)
|
||||
return (gformat(grp[0]),gformat(grp[1]),gformat(grp[2]))
|
||||
|
||||
def coords(grp):
|
||||
@ -191,7 +186,7 @@ class PSDrawDoc(BaseDoc.BaseDoc):
|
||||
p = self.style_list[para_name]
|
||||
|
||||
x1 = x1 + self.lmargin
|
||||
y1 = y1 + self.tmargin + pt2cm(p.get_font().get_size())
|
||||
y1 = y1 + self.tmargin + ReportUtils.pt2cm(p.get_font().get_size())
|
||||
|
||||
(text,fdef) = self.encode_text(p,text)
|
||||
|
||||
@ -350,8 +345,8 @@ class PSDrawDoc(BaseDoc.BaseDoc):
|
||||
y2 = y2 + self.tmargin
|
||||
|
||||
box_type = self.draw_styles[style]
|
||||
fill_color = rgb_color(box_type.get_fill_color())
|
||||
color = rgb_color(box_type.get_color())
|
||||
fill_color = ReportUtils.rgb_color(box_type.get_fill_color())
|
||||
color = ReportUtils.rgb_color(box_type.get_color())
|
||||
|
||||
self.f.write('gsave\n')
|
||||
self.f.write("%s cm %s cm moveto\n" % coords(self.translate(x1,y1)))
|
||||
|
Loading…
Reference in New Issue
Block a user