feature 2769: add styled notes support to markerreport and
fgroupreport svn: r12305
This commit is contained in:
		@@ -193,7 +193,7 @@ class FamilyGroup(Report):
 | 
			
		||||
            self.doc.end_cell()
 | 
			
		||||
            self.doc.end_row()
 | 
			
		||||
        elif self.missingInfo:
 | 
			
		||||
            self.dump_parent_line(_("Father"),"")
 | 
			
		||||
            self.dump_parent_line(_("Father"), "")
 | 
			
		||||
 | 
			
		||||
        if mother_name != "":
 | 
			
		||||
            self.doc.start_row()
 | 
			
		||||
@@ -210,9 +210,9 @@ class FamilyGroup(Report):
 | 
			
		||||
            self.doc.end_cell()
 | 
			
		||||
            self.doc.end_row()
 | 
			
		||||
        elif self.missingInfo:
 | 
			
		||||
            self.dump_parent_line(_("Mother"),"")
 | 
			
		||||
            self.dump_parent_line(_("Mother"), "")
 | 
			
		||||
 | 
			
		||||
    def dump_parent_line(self, name,text):
 | 
			
		||||
    def dump_parent_line(self, name, text):
 | 
			
		||||
        self.doc.start_row()
 | 
			
		||||
        self.doc.start_cell("FGR-TextContents")
 | 
			
		||||
        self.doc.start_paragraph('FGR-Normal')
 | 
			
		||||
@@ -226,6 +226,19 @@ class FamilyGroup(Report):
 | 
			
		||||
        self.doc.end_cell()
 | 
			
		||||
        self.doc.end_row()
 | 
			
		||||
 | 
			
		||||
    def dump_parent_noteline(self, name, note):
 | 
			
		||||
        self.doc.start_row()
 | 
			
		||||
        self.doc.start_cell("FGR-TextContents")
 | 
			
		||||
        self.doc.start_paragraph('FGR-Normal')
 | 
			
		||||
        self.doc.write_text(name)
 | 
			
		||||
        self.doc.end_paragraph()
 | 
			
		||||
        self.doc.end_cell()
 | 
			
		||||
        self.doc.start_cell("FGR-TextContentsEnd", 2)
 | 
			
		||||
        self.doc.write_styled_note(note.get_styledtext(),
 | 
			
		||||
                                   note.get_format(), 'FGR-Note')
 | 
			
		||||
        self.doc.end_cell()
 | 
			
		||||
        self.doc.end_row()
 | 
			
		||||
    
 | 
			
		||||
    def dump_parent(self,title,person_handle):
 | 
			
		||||
 | 
			
		||||
        if not person_handle and not self.missingInfo:
 | 
			
		||||
@@ -300,7 +313,7 @@ class FamilyGroup(Report):
 | 
			
		||||
        if self.incParNotes:
 | 
			
		||||
            for notehandle in person.get_note_list():
 | 
			
		||||
                note = self.database.get_note_from_handle(notehandle)
 | 
			
		||||
                self.dump_parent_line(_("Note"), note.get())
 | 
			
		||||
                self.dump_parent_noteline(_("Note"), note)
 | 
			
		||||
                
 | 
			
		||||
        if self.includeAttrs:
 | 
			
		||||
            for attr in person.get_attribute_list():
 | 
			
		||||
@@ -679,6 +692,18 @@ class FamilyGroupOptions(MenuReportOptions):
 | 
			
		||||
        para.set_description(_('The basic style used for the text display.'))
 | 
			
		||||
        default_style.add_paragraph_style('FGR-Normal',para)
 | 
			
		||||
 | 
			
		||||
        para = BaseDoc.ParagraphStyle()
 | 
			
		||||
        font = BaseDoc.FontStyle()
 | 
			
		||||
        font.set_type_face(BaseDoc.FONT_SERIF)
 | 
			
		||||
        font.set_size(10)
 | 
			
		||||
        font.set_bold(0)
 | 
			
		||||
        para.set_font(font)
 | 
			
		||||
        para.set(lmargin=0.0)
 | 
			
		||||
        para.set_top_margin(0.0)
 | 
			
		||||
        para.set_bottom_margin(0.0)
 | 
			
		||||
        para.set_description(_('The basic style used for the note display.'))
 | 
			
		||||
        default_style.add_paragraph_style("FGR-Note",para)
 | 
			
		||||
 | 
			
		||||
        font = BaseDoc.FontStyle()
 | 
			
		||||
        font.set_type_face(BaseDoc.FONT_SANS_SERIF)
 | 
			
		||||
        font.set_size(10)
 | 
			
		||||
 
 | 
			
		||||
@@ -410,9 +410,8 @@ class MarkerReport(Report):
 | 
			
		||||
            self.doc.end_cell()
 | 
			
		||||
            
 | 
			
		||||
            self.doc.start_cell('MR-TableCell', 2)
 | 
			
		||||
            self.doc.start_paragraph('MR-Normal')
 | 
			
		||||
            self.doc.write_text(note.get())
 | 
			
		||||
            self.doc.end_paragraph()
 | 
			
		||||
            self.doc.write_styled_note(note.get_styledtext(),
 | 
			
		||||
                                       note.get_format(), 'MR-Note')
 | 
			
		||||
            self.doc.end_cell()
 | 
			
		||||
            
 | 
			
		||||
            self.doc.end_row()
 | 
			
		||||
@@ -498,6 +497,13 @@ class MarkerOptions(MenuReportOptions):
 | 
			
		||||
        p.set_description(_('The basic style used for table headings.'))
 | 
			
		||||
        default_style.add_paragraph_style("MR-Normal-Bold", p)
 | 
			
		||||
        
 | 
			
		||||
        para = BaseDoc.ParagraphStyle()
 | 
			
		||||
        p.set(first_indent=-0.75, lmargin=.75)
 | 
			
		||||
        para.set_top_margin(ReportUtils.pt2cm(3))
 | 
			
		||||
        para.set_bottom_margin(ReportUtils.pt2cm(3))
 | 
			
		||||
        para.set_description(_('The basic style used for the note display.'))
 | 
			
		||||
        default_style.add_paragraph_style("MR-Note",para)
 | 
			
		||||
 
 | 
			
		||||
        #Table Styles
 | 
			
		||||
        cell = BaseDoc.TableCellStyle()
 | 
			
		||||
        default_style.add_cell_style('MR-TableCell', cell)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user