4758: Copy constructor of gen.lib objects uses shallow copy instead of deep copy
svn: r16825
This commit is contained in:
parent
efbff4178a
commit
3e76c9d3b5
@ -67,7 +67,7 @@ class Attribute(SecondaryObject, PrivacyBase, SourceBase, NoteBase):
|
||||
NoteBase.__init__(self, source)
|
||||
|
||||
if source:
|
||||
self.type = source.type
|
||||
self.type = AttributeType(source.type)
|
||||
self.value = source.value
|
||||
else:
|
||||
self.type = AttributeType()
|
||||
|
@ -57,8 +57,8 @@ class ChildRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase):
|
||||
NoteBase.__init__(self, source)
|
||||
RefBase.__init__(self, source)
|
||||
if source:
|
||||
self.frel = source.frel
|
||||
self.mrel = source.mrel
|
||||
self.frel = ChildRefType(source.frel)
|
||||
self.mrel = ChildRefType(source.mrel)
|
||||
else:
|
||||
self.frel = ChildRefType()
|
||||
self.mrel = ChildRefType()
|
||||
|
@ -76,7 +76,7 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase,
|
||||
|
||||
if source:
|
||||
self.__description = source.__description
|
||||
self.__type = source.__type
|
||||
self.__type = EventType(source.__type)
|
||||
else:
|
||||
self.__description = ""
|
||||
self.__type = EventType()
|
||||
|
@ -60,7 +60,7 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase):
|
||||
AttributeBase.__init__(self, source)
|
||||
RefBase.__init__(self, source)
|
||||
if source:
|
||||
self.__role = source.__role
|
||||
self.__role = EventRoleType(source.__role)
|
||||
else:
|
||||
self.__role = EventRoleType()
|
||||
|
||||
|
@ -47,6 +47,7 @@ class GenderStats(object):
|
||||
if stats is None:
|
||||
self.stats = {}
|
||||
else:
|
||||
# Current use of GenderStats is such that a shallow copy suffices.
|
||||
self.stats = stats
|
||||
|
||||
def save_stats(self):
|
||||
|
@ -90,7 +90,7 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, SourceBase, NoteBase,
|
||||
self.first_name = source.first_name
|
||||
self.suffix = source.suffix
|
||||
self.title = source.title
|
||||
self.type = source.type
|
||||
self.type = NameType(source.type)
|
||||
self.group_as = source.group_as
|
||||
self.sort_as = source.sort_as
|
||||
self.display_as = source.display_as
|
||||
|
@ -53,7 +53,7 @@ class RepoRef(SecondaryObject, PrivacyBase, NoteBase, RefBase):
|
||||
RefBase.__init__(self, source)
|
||||
if source:
|
||||
self.call_number = source.call_number
|
||||
self.media_type = source.media_type
|
||||
self.media_type = SourceMediaType(source.media_type)
|
||||
else:
|
||||
self.call_number = ""
|
||||
self.media_type = SourceMediaType()
|
||||
|
@ -61,6 +61,7 @@ class StyledTextTag(object):
|
||||
if ranges is None:
|
||||
self.ranges = []
|
||||
else:
|
||||
# Current use of StyledTextTag is such that a shallow copy suffices.
|
||||
self.ranges = ranges
|
||||
|
||||
def serialize(self):
|
||||
|
@ -53,7 +53,7 @@ class Surname(SecondaryObject):
|
||||
self.surname = source.surname
|
||||
self.prefix = source.prefix
|
||||
self.primary = source.primary
|
||||
self.origintype = source.origintype
|
||||
self.origintype = NameOriginType(source.origintype)
|
||||
self.connector = source.connector
|
||||
else:
|
||||
self.surname = ""
|
||||
|
@ -44,7 +44,7 @@ class TagBase(object):
|
||||
:type source: TagBase
|
||||
"""
|
||||
if source:
|
||||
self.tag_list = source.tag_list
|
||||
self.tag_list = list(source.tag_list)
|
||||
else:
|
||||
self.tag_list = []
|
||||
|
||||
|
@ -60,7 +60,7 @@ class Url(SecondaryObject, PrivacyBase):
|
||||
if source:
|
||||
self.path = source.path
|
||||
self.desc = source.desc
|
||||
self.type = source.type
|
||||
self.type = UrlType(source.type)
|
||||
else:
|
||||
self.path = ""
|
||||
self.desc = ""
|
||||
|
Loading…
Reference in New Issue
Block a user