Skip to content

Commit

Permalink
Fix Powerpoint say all on new slide (#17498)
Browse files Browse the repository at this point in the history
Follow up of #17488

Summary of the issue:
Since #17488, entering a slide show in Power point no longer activates say all when that browse mode option is disabled. However, I intended this to also apply to cases where you'd move from one slide to another, which didn't work.

Description of user facing changes
NO say all when moving from slide to slide in a slide show and the browse mode option is disabled.

Description of development approach
Expanded the reportSlide method.
  • Loading branch information
LeonarddeR authored Dec 10, 2024
1 parent a94f069 commit 02736c8
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions source/appModules/powerpnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1387,18 +1387,9 @@ def __contains__(self, obj):
def event_treeInterceptor_gainFocus(self):
braille.handler.handleGainFocus(self)
self.rootNVDAObject.reportFocus()
doSayAll = not self.hadFocusOnce and config.conf["virtualBuffers"]["autoSayAllOnPageLoad"]
self.reportNewSlide(self.hadFocusOnce)
if not self.hadFocusOnce:
self.hadFocusOnce = True
if doSayAll:
self.reportNewSlide()
else:
info = self.selection
if not info.isCollapsed:
speech.speakPreselectedText(info.text)
else:
info.expand(textInfos.UNIT_LINE)
speech.speakTextInfo(info, reason=controlTypes.OutputReason.CARET, unit=textInfos.UNIT_LINE)

def event_gainFocus(self, obj, nextHandler):
pass
Expand All @@ -1408,9 +1399,22 @@ def event_gainFocus(self, obj, nextHandler):
def makeTextInfo(self, position):
return self.TextInfo(self, position)

def reportNewSlide(self):
self.makeTextInfo(textInfos.POSITION_FIRST).updateCaret()
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET)
def reportNewSlide(self, suppressSayAll: bool = False):
"""Reports a new slide, activating say all when appropriate.
:param suppressSayAll: When say all should be suppressed always, e.g.
because tree interceptor gets focus multiple times.
"""
doSayAll = not suppressSayAll and config.conf["virtualBuffers"]["autoSayAllOnPageLoad"]
if doSayAll:
self.makeTextInfo(textInfos.POSITION_FIRST).updateCaret()
sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET)
else:
info = self.selection
if not info.isCollapsed:
speech.speakPreselectedText(info.text)
else:
info.expand(textInfos.UNIT_LINE)
speech.speakTextInfo(info, reason=controlTypes.OutputReason.CARET, unit=textInfos.UNIT_LINE)

@scriptHandler.script(
description=_(
Expand Down

0 comments on commit 02736c8

Please sign in to comment.