[orca] Also preserve MathML tree when it is the first object being expanded
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Also preserve MathML tree when it is the first object being expanded
- Date: Thu, 24 May 2018 16:21:42 +0000 (UTC)
commit 984d916e311d17a77cc744dc41bb73e0c2189dab
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu May 24 09:13:46 2018 -0700
Also preserve MathML tree when it is the first object being expanded
src/orca/scripts/web/script_utilities.py | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index afc7160..fcda254 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -743,8 +743,11 @@ class Utilities(script_utilities.Utilities):
if not text:
return ""
- string = text.getText(startOffset, endOffset)
+ if self._preserveTree(obj):
+ utterances = self._script.speechGenerator.generateSpeech(obj)
+ return self._script.speechGenerator.utterancesToString(utterances)
+ string = text.getText(startOffset, endOffset)
if self.EMBEDDED_OBJECT_CHARACTER in string:
# If we're not getting the full text of this object, but
# rather a substring, we need to figure out the offset of
@@ -758,19 +761,12 @@ class Utilities(script_utilities.Utilities):
toBuild = list(string)
count = toBuild.count(self.EMBEDDED_OBJECT_CHARACTER)
for i in range(count):
- index = toBuild.index(self.EMBEDDED_OBJECT_CHARACTER)
try:
child = obj[i + childOffset]
except:
continue
-
- childText = ""
- if not self._preserveTree(child):
- childText = self.expandEOCs(child)
- else:
- utterances = self._script.speechGenerator.generateSpeech(child)
- childText = self._script.speechGenerator.utterancesToString(utterances)
- toBuild[index] = "%s " % childText
+ index = toBuild.index(self.EMBEDDED_OBJECT_CHARACTER)
+ toBuild[index] = "%s " % self.expandEOCs(child)
string = "".join(toBuild).strip()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]