[orca] Don't treat objects with tons of embedded objects as text "chunks"
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't treat objects with tons of embedded objects as text "chunks"
- Date: Thu, 30 Jul 2015 02:18:07 +0000 (UTC)
commit 532fefacdb3714b6c8770217fd131f0aadab86a8
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Jul 29 22:16:31 2015 -0400
Don't treat objects with tons of embedded objects as text "chunks"
src/orca/structural_navigation.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index be7ac4e..7fdf259 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -1570,12 +1570,17 @@ class StructuralNavigation:
the criteria (e.g. the level of a heading).
"""
- isMatch = False
if obj and obj.getRole() in self.OBJECT_ROLES:
text = self._script.utilities.queryNonEmptyText(obj)
- isMatch = text and text.characterCount > settings.largeObjectTextLength
+ if not (text and text.characterCount > settings.largeObjectTextLength):
+ return False
- return isMatch
+ string = text.getText(0, -1)
+ eocs = string.count(self._script.EMBEDDED_OBJECT_CHARACTER)
+ if eocs/text.characterCount < 0.05:
+ return True
+
+ return False
def _chunkPresentation(self, obj, arg=None):
"""Presents the chunk or indicates that one was not found.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]