0002633: Characters in Notes don't show in report - 3.0.4 and trunk
1357: Incorrect marriage event description when outputting to PDF 1328: opened a gedcom, and create a pdf text file Do it better with a private method so plugin authors don't circumvent style settings svn: r11896
This commit is contained in:
parent
c5d18aa935
commit
00a68636a9
@ -1084,16 +1084,16 @@ class CairoDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
|||||||
self._active_element.add_child(GtkDocPagebreak())
|
self._active_element.add_child(GtkDocPagebreak())
|
||||||
|
|
||||||
def start_bold(self):
|
def start_bold(self):
|
||||||
self.write_text('<b>', True)
|
self.__write_text('<b>', markup=True)
|
||||||
|
|
||||||
def end_bold(self):
|
def end_bold(self):
|
||||||
self.write_text('</b>', True)
|
self.__write_text('</b>', markup=True)
|
||||||
|
|
||||||
def start_superscript(self):
|
def start_superscript(self):
|
||||||
self.write_text('<small><sup>', True)
|
self.__write_text('<small><sup>', markup=True)
|
||||||
|
|
||||||
def end_superscript(self):
|
def end_superscript(self):
|
||||||
self.write_text('</sup></small>', True)
|
self.__write_text('</sup></small>', markup=True)
|
||||||
|
|
||||||
def start_paragraph(self, style_name, leader=None):
|
def start_paragraph(self, style_name, leader=None):
|
||||||
style_sheet = self.get_style_sheet()
|
style_sheet = self.get_style_sheet()
|
||||||
@ -1164,20 +1164,31 @@ class CairoDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
|||||||
self.write_text(line)
|
self.write_text(line)
|
||||||
self.end_paragraph()
|
self.end_paragraph()
|
||||||
|
|
||||||
def write_text(self, text, markup=False):
|
def __write_text(self, text, mark=None, markup=False):
|
||||||
"""Write a normal piece of text according to the
|
"""
|
||||||
present style
|
@param text: text to write.
|
||||||
If markup=False, no markup is present, the
|
@param mark: IndexMark to use for indexing (if supported)
|
||||||
text is escaped in writted
|
@param markup: True if text already contains markup info.
|
||||||
If markup=True, some markup is present, so
|
Then text will no longer be escaped
|
||||||
caller had to escape the text already
|
Private method: reports should not add markup in text to override
|
||||||
|
the style
|
||||||
"""
|
"""
|
||||||
if not markup:
|
if not markup:
|
||||||
#no pango markup, escape the text as it
|
# We need to escape the text here for later pango.Layout.set_markup
|
||||||
#should not have happened yet
|
# calls. This way we save the markup created by the report
|
||||||
|
# The markup in the note editor is not in the text so is not
|
||||||
|
# considered. It must be added by pango too
|
||||||
text = escape(text)
|
text = escape(text)
|
||||||
self._active_element.add_text(text)
|
self._active_element.add_text(text)
|
||||||
|
|
||||||
|
def write_text(self, text, mark=None):
|
||||||
|
"""Write a normal piece of text according to the
|
||||||
|
present style
|
||||||
|
@param text: text to write.
|
||||||
|
@param mark: IndexMark to use for indexing (if supported)
|
||||||
|
"""
|
||||||
|
self. __write_text(text, mark)
|
||||||
|
|
||||||
def add_media_object(self, name, pos, x_cm, y_cm):
|
def add_media_object(self, name, pos, x_cm, y_cm):
|
||||||
new_image = GtkDocPicture(pos, name, x_cm, y_cm)
|
new_image = GtkDocPicture(pos, name, x_cm, y_cm)
|
||||||
self._active_element.add_child(new_image)
|
self._active_element.add_child(new_image)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user