From ae763a0e56d4b12a9adefa8c31008bc0eb23e7ae Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter Date: Fri, 21 Feb 2025 14:30:46 +0100 Subject: [PATCH 1/3] Avoid error in PowerPoint slideshows when focus highlighting is on --- source/appModules/powerpnt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/appModules/powerpnt.py b/source/appModules/powerpnt.py index fee293fd66b..e9305e6c77b 100644 --- a/source/appModules/powerpnt.py +++ b/source/appModules/powerpnt.py @@ -1,5 +1,5 @@ # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2012-2024 NV Access Limited, Leonard de Ruijter +# Copyright (C) 2012-2025 NV Access Limited, Leonard de Ruijter # This file is covered by the GNU General Public License. # See the file COPYING for more details. @@ -1360,6 +1360,11 @@ class SlideShowTreeInterceptorTextInfo(NVDAObjectTextInfo): def _getStoryText(self): return self.obj.rootNVDAObject.basicText + def _get_boundingRects(self): + if self.obj.rootNVDAObject.hasIrrelevantLocation: + raise LookupError("Object is off screen, invisible or has no location") + return [self.obj.rootNVDAObject.location] + def _getOffsetsFromNVDAObject(self, obj): if obj == self.obj.rootNVDAObject: return (0, self._getStoryLength()) From 76d99fb8cf9eab0754902a43417ac61f64b67d2e Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter <3049216+LeonarddeR@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:06:42 +0100 Subject: [PATCH 2/3] Update source/appModules/powerpnt.py Co-authored-by: Sean Budd --- source/appModules/powerpnt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/appModules/powerpnt.py b/source/appModules/powerpnt.py index e9305e6c77b..5ab11297c08 100644 --- a/source/appModules/powerpnt.py +++ b/source/appModules/powerpnt.py @@ -1360,7 +1360,7 @@ class SlideShowTreeInterceptorTextInfo(NVDAObjectTextInfo): def _getStoryText(self): return self.obj.rootNVDAObject.basicText - def _get_boundingRects(self): + def _get_boundingRects(self) -> list[locationHelper.RectLTWH]: if self.obj.rootNVDAObject.hasIrrelevantLocation: raise LookupError("Object is off screen, invisible or has no location") return [self.obj.rootNVDAObject.location] From 0ea3151c78e58eec1e047c73ffffe7415c67b709 Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter Date: Tue, 25 Feb 2025 13:18:33 +0100 Subject: [PATCH 3/3] Fix type hint --- source/appModules/powerpnt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/appModules/powerpnt.py b/source/appModules/powerpnt.py index 5ab11297c08..9244f84c3cc 100644 --- a/source/appModules/powerpnt.py +++ b/source/appModules/powerpnt.py @@ -41,7 +41,7 @@ from controlTypes import TextPosition from logHandler import log import scriptHandler -from locationHelper import RectLTRB +from locationHelper import RectLTRB, RectLTWH from NVDAObjects.window._msOfficeChart import OfficeChart from utils.urlUtils import _LinkData @@ -1360,7 +1360,7 @@ class SlideShowTreeInterceptorTextInfo(NVDAObjectTextInfo): def _getStoryText(self): return self.obj.rootNVDAObject.basicText - def _get_boundingRects(self) -> list[locationHelper.RectLTWH]: + def _get_boundingRects(self) -> list[RectLTWH]: if self.obj.rootNVDAObject.hasIrrelevantLocation: raise LookupError("Object is off screen, invisible or has no location") return [self.obj.rootNVDAObject.location]