[orca] Generate current line text even if there is an embedded object char
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Generate current line text even if there is an embedded object char
- Date: Tue, 15 Feb 2022 13:18:19 +0000 (UTC)
commit d5ee88c7be51d1e2431de264187d9bdca2e1dead
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Feb 15 13:59:38 2022 +0100
Generate current line text even if there is an embedded object char
_generateCurrentLineText() has for many years returned early and
without generating anything if an embedded object character was
found. The idea appears to be that in those cases returning nothing
would trigger the logic needed to split such lines up (e.g. in the
case of web content). The web script, however, handles line generation
differently and does not rely upon _generateCurrentLineText(). So
returning early doesn't seem necessary. In addition, LibreOffice Writer
inserts embedded object characters for comments as well as images and
other objects. (Unfortunately its hypertext implementation is broken,
so reliably presenting the embedded objects like we do on the web is
not possible.)
This commit stops us from returning early and removes any embedded
object characters so that we can present the line's textual contents
as expected.
src/orca/speech_generator.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 23a059842..08d6e320e 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1229,9 +1229,6 @@ class SpeechGenerator(generator.Generator):
return result
[text, caretOffset, startOffset] = self._script.getTextLineAtCaret(obj)
- if self._script.EMBEDDED_OBJECT_CHARACTER in text:
- return []
-
if text == '\n' and _settingsManager.getSetting('speakBlankLines') \
and not self._script.inSayAll() and args.get('total', 1) == 1:
result = [messages.BLANK]
@@ -1242,6 +1239,7 @@ class SpeechGenerator(generator.Generator):
endOffset = startOffset + len(text)
split = self._script.utilities.splitSubstringByLanguage(obj, startOffset, endOffset)
for start, end, string, language, dialect in split:
+ string = string.replace(self._script.EMBEDDED_OBJECT_CHARACTER, "")
if not string:
continue
args["language"], args["dialect"] = language, dialect
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]