Skip to content

Commit

Permalink
sayAll: no longer prematurely stop sayAll after turning a page. (#14711)
Browse files Browse the repository at this point in the history
Fixes #14390

Summary of the issue:
With the merging of pr #14070 which added sayall in tables, SayAll in Kindle for PC would fail to continue reading after turning the page.
Technical:
Some of the code in the nextLine method in sayAll was refacted into a nextLineImpl method.
However, if nextLineImpl returned false, finish would be called and nextLIne would return. This would be correct for handling the case where there was no more text, or table cells, but not the case where the page has just been turned. In fact, text sayAll already called finish when there was no more text, so calling finish again was useless in the base case, but for page turns caused sayAll to abort prematurely after the page was turned.

Description of user facing changes
NVDA no longer fails to keep reading with sayAll after crossing a page boundary.

Description of development approach
In sayAll's nextLine method, removed the call to self.finish when nextLineImpl returns False, but ensured that table sayAll's nextLineImpl does call finish itself if there is no more table cells.
In other words, the self.finish call has been moved into the specific nextLineImpl method where it is needed, rather than running more broadly.
  • Loading branch information
michaelDCurran authored Mar 22, 2023
1 parent d5c0ead commit 7edac84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/speech/sayAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def nextLine(self):

if not self.initialIteration or not self.shouldReadInitialPosition():
if not self.nextLineImpl():
self.finish()
return
self.initialIteration = False
bookmark = self.reader.bookmark
Expand Down Expand Up @@ -408,6 +407,7 @@ def nextLineImpl(self) -> bool:
self.reader = self.nextLineFunc(self.reader)
return True
except StopIteration:
self.finish()
return False

def collapseLineImpl(self) -> bool:
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Same as pressing ``NVDA+k`` twice, but may be more useful for braille users. (#1
- In web browsers such as Chrome and Firefox, alerts such as file downloads are shown in braille in addition to being spoken. (#14562)
- Bug fixed when navigating to the first and last column in a table in Firefox (#14554)
- When NVDA is launched with ``--lang=Windows`` parameter, it is again possible to open NVDA's General settings dialog. (#14407)
- NVDA no longer fails to continue reading in Kindle for PC after turning the page. (#14390)
-


Expand Down

0 comments on commit 7edac84

Please sign in to comment.