From fc3b7956a2c774d0021134946286e0a954b0f7c9 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 29 May 2018 10:54:22 +0200 Subject: [PATCH] Update attributeManager.py --- src/fenrirscreenreader/core/attributeManager.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fenrirscreenreader/core/attributeManager.py b/src/fenrirscreenreader/core/attributeManager.py index 7a93d0d4..09f5bb39 100644 --- a/src/fenrirscreenreader/core/attributeManager.py +++ b/src/fenrirscreenreader/core/attributeManager.py @@ -103,23 +103,18 @@ class attributeManager(): 'default' # fontfamily )) #end attribute def isDefaultAttribute(self,attribute): - useAttribute = None - if not attribute: - useAttribute = self.currAttributes - else: - useAttribute = attribute - return useAttribute in self.defaultAttributes + return attribute in self.defaultAttributes def hasAttributes(self, cursor, update=True): if not cursor: return False cursorPos = cursor.copy() try: - attributes = self.getAttributeByXY( cursorPos['x'], cursorPos['y']) + attribute = self.getAttributeByXY( cursorPos['x'], cursorPos['y']) - if self.isDefaultAttribute(attributes): + if self.isDefaultAttribute(attribute): return False if update: - self.setLastCursorAttribute(attributes) + self.setLastCursorAttribute(attribute) if not self.isLastCursorAttributeChange(): return False except Exception as e: