Patches from Alexandre Duret-Lutz
svn: r1179
This commit is contained in:
parent
c8dc6063b5
commit
4d28689c85
@ -175,7 +175,8 @@ class AddSpouse:
|
|||||||
self.person.addFamily(family)
|
self.person.addFamily(family)
|
||||||
spouse.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.setMother(spouse)
|
||||||
family.setFather(self.person)
|
family.setFather(self.person)
|
||||||
else:
|
else:
|
||||||
@ -322,10 +323,17 @@ class SetSpouse:
|
|||||||
return
|
return
|
||||||
|
|
||||||
Utils.modified()
|
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.setMother(spouse)
|
||||||
|
self.family.setFather(self.person)
|
||||||
else:
|
else:
|
||||||
self.family.setFather(spouse)
|
self.family.setFather(spouse)
|
||||||
|
self.family.setMother(self.person)
|
||||||
|
|
||||||
spouse.addFamily(self.family)
|
spouse.addFamily(self.family)
|
||||||
|
|
||||||
|
@ -627,9 +627,19 @@ class LaTeXDoc(TextDoc):
|
|||||||
def write_text(self,text):
|
def write_text(self,text):
|
||||||
"""Write the text to the file"""
|
"""Write the text to the file"""
|
||||||
if not self.in_listing:
|
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':
|
if text == '\n':
|
||||||
text = '\\newline\n'
|
text = '\\newline\n'
|
||||||
text = string.replace(text,'#','\#')
|
|
||||||
self.f.write(text)
|
self.f.write(text)
|
||||||
if text:
|
if text:
|
||||||
self.last_char_written = text[-1]
|
self.last_char_written = text[-1]
|
||||||
|
@ -121,8 +121,8 @@ class CheckIntegrity:
|
|||||||
if father.getGender() == mother.getGender():
|
if father.getGender() == mother.getGender():
|
||||||
family.setRelationship("Partners")
|
family.setRelationship("Partners")
|
||||||
self.fam_rel.append(family)
|
self.fam_rel.append(family)
|
||||||
elif father.getGender() != RelLib.Person.male or \
|
elif (father.getGender() == RelLib.Person.female or
|
||||||
mother.getGender() != RelLib.Person.female:
|
mother.getGender() == RelLib.Person.male):
|
||||||
family.setFather(mother)
|
family.setFather(mother)
|
||||||
family.setMother(father)
|
family.setMother(father)
|
||||||
self.fam_rel.append(family)
|
self.fam_rel.append(family)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user