Fix 0001393: Detailed descendant report crash on too many references.

svn: r9569
This commit is contained in:
Brian Matherly 2007-12-23 22:20:51 +00:00
parent 096db6b3a0
commit 7aa7acb355
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2007-12-23 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_Bibliography.py:
Fix 0001393: Detailed descendant report crash on too many references.
2007-12-23 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/plugins/ExtractCity.py: Fix #0001160: Regular expressions,
dash/separator and non-ASCII characters on ExtractCity

View File

@ -72,7 +72,17 @@ class Citation:
@return: The key of the added reference among all the references.
@rtype: char
"""
key = string.lowercase[ len(self.__ref_list) ]
first_letter = ''
second_letter = ''
letter_count = len(string.lowercase)
ref_count = len(self.__ref_list)
if ref_count > letter_count:
# If there are more than 26 references, we need to use two
# characters to uniquely identify them all.
first_letter = string.lowercase[ ref_count / letter_count ]
second_letter = string.lowercase[ ref_count % letter_count ]
key = first_letter + second_letter
self.__ref_list.append((key,source_ref))
return key