Skip to content

Commit 8817701

Browse files
reedandprculley
authored andcommitted
Fix issue with Notes in FamilyTree graphical report (#158)
Notes with multiple lines attached to People records can cause the Family Tree graphical report to output the notes outside the boundary of the drawn box or overwrite other text within the drawn box. To resolve this any carriage returns and new lines are replaced with spaces prior to outputing in the report.
1 parent 9283b07 commit 8817701

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FamilyTree/FamilyTree.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,10 @@ def __person_get_display_data(self, person):
817817
noteobj = self.database.get_note_from_handle(notehandle)
818818
note += noteobj.get()
819819
note += ", "
820+
# replace all new lines and carriage returns with spaces to prevent notes
821+
# being written beyond the bottom edge of the drawn box or overwriting other text
822+
# if they contain multiple lines
823+
note = note.replace('\n', ' ').replace('\r', ' ')
820824
# cut "," from end of the string and limit length of note to 50 characters
821825
note_len = len(note)
822826
if note_len > 50:

0 commit comments

Comments
 (0)