Use iterable for checking difference between Odt paragraph styles
This commit is contained in:
@@ -1240,18 +1240,16 @@ class ODTParagraphStyle:
|
|||||||
##
|
##
|
||||||
|
|
||||||
def checkNew(self, style: ODTParagraphStyle) -> bool:
|
def checkNew(self, style: ODTParagraphStyle) -> bool:
|
||||||
"""Check if there are new settings in refStyle that differ from
|
"""Check if there are new settings in style that differ from
|
||||||
those in the current object.
|
those in this object. Unset styles are ignored as they can be
|
||||||
|
inherited from the parent style.
|
||||||
"""
|
"""
|
||||||
for name, (_, aVal) in style._mAttr.items():
|
if any(v and v != self._mAttr[m][1] for m, (_, v) in style._mAttr.items()):
|
||||||
if aVal is not None and aVal != self._mAttr[name][1]:
|
return True
|
||||||
return True
|
if any(v and v != self._pAttr[m][1] for m, (_, v) in style._pAttr.items()):
|
||||||
for name, (_, aVal) in style._pAttr.items():
|
return True
|
||||||
if aVal is not None and aVal != self._pAttr[name][1]:
|
if any(v and v != self._tAttr[m][1] for m, (_, v) in style._tAttr.items()):
|
||||||
return True
|
return True
|
||||||
for name, (_, aVal) in style._tAttr.items():
|
|
||||||
if aVal is not None and aVal != self._tAttr[name][1]:
|
|
||||||
return True
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def getID(self) -> str:
|
def getID(self) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user