Patches from Alexandre Duret-Lutz
svn: r1179
This commit is contained in:
parent
c8dc6063b5
commit
4d28689c85
@ -175,10 +175,11 @@ class AddSpouse:
|
||||
self.person.addFamily(family)
|
||||
spouse.addFamily(family)
|
||||
|
||||
if self.person.getGender() == RelLib.Person.male:
|
||||
if (self.person.getGender() == RelLib.Person.male
|
||||
or spouse.getGender() == RelLib.Person.female):
|
||||
family.setMother(spouse)
|
||||
family.setFather(self.person)
|
||||
else:
|
||||
else:
|
||||
family.setFather(spouse)
|
||||
family.setMother(self.person)
|
||||
|
||||
@ -322,11 +323,18 @@ class SetSpouse:
|
||||
return
|
||||
|
||||
Utils.modified()
|
||||
if self.family.getFather() == self.person:
|
||||
|
||||
# Recompute the family relation. self.person is already
|
||||
# a father or mother, but in case (s)he had an unknown
|
||||
# gender, adding a spouse might swap roles.
|
||||
if (self.person.getGender() == RelLib.Person.male
|
||||
or spouse.getGender() == RelLib.Person.female):
|
||||
self.family.setMother(spouse)
|
||||
self.family.setFather(self.person)
|
||||
else:
|
||||
self.family.setFather(spouse)
|
||||
|
||||
self.family.setMother(self.person)
|
||||
|
||||
spouse.addFamily(self.family)
|
||||
|
||||
reltype = self.relation_type.get_text()
|
||||
|
@ -623,13 +623,23 @@ class LaTeXDoc(TextDoc):
|
||||
self.f.write('\\includegraphics[%s]{%s}\\hspace*{\\fill}\n' % (mysize,picf))
|
||||
else:
|
||||
self.f.write('\\hspace*{\\fill}\\includegraphics[%s]{%s}\hspace*{\\fill}\n' % (mysize,picf))
|
||||
|
||||
|
||||
def write_text(self,text):
|
||||
"""Write the text to the file"""
|
||||
if not self.in_listing:
|
||||
# Quote unsafe characters.
|
||||
text = string.replace(text,'\\','\\\\')
|
||||
text = string.replace(text,'$','\\$')
|
||||
text = string.replace(text,'&','\\&')
|
||||
text = string.replace(text,'%','\\%')
|
||||
text = string.replace(text,'#','\\#')
|
||||
text = string.replace(text,'{','\\{')
|
||||
text = string.replace(text,'}','\\}')
|
||||
text = string.replace(text,'_','\\_')
|
||||
text = string.replace(text,'^','\\verb+^+')
|
||||
text = string.replace(text,'~','\\verb+~+')
|
||||
if text == '\n':
|
||||
text = '\\newline\n'
|
||||
text = string.replace(text,'#','\#')
|
||||
self.f.write(text)
|
||||
if text:
|
||||
self.last_char_written = text[-1]
|
||||
|
@ -121,8 +121,8 @@ class CheckIntegrity:
|
||||
if father.getGender() == mother.getGender():
|
||||
family.setRelationship("Partners")
|
||||
self.fam_rel.append(family)
|
||||
elif father.getGender() != RelLib.Person.male or \
|
||||
mother.getGender() != RelLib.Person.female:
|
||||
elif (father.getGender() == RelLib.Person.female or
|
||||
mother.getGender() == RelLib.Person.male):
|
||||
family.setFather(mother)
|
||||
family.setMother(father)
|
||||
self.fam_rel.append(family)
|
||||
|
Loading…
Reference in New Issue
Block a user