From cf56ab4c9e29cb076c3f986a75ade58d997cb43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 12 Sep 2025 09:14:25 +0100 Subject: [PATCH] use SfxLokHelper::getViewOfId to get most recent view of this document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4bdc51b1c175c6a46094305090f711d8b3ffb388 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190861 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194797 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- desktop/source/lib/init.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2ef7c12af7b9..4cb16c203176 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5781,7 +5781,9 @@ static char* doc_getPresentationInfo(LibreOfficeKitDocument* pThis) } bool bAllyState = false; - SfxViewShell* pViewShell = SfxViewShell::Current(); + LibLODocument_Impl* pDocument = static_cast(pThis); + const int nView = SfxLokHelper::getViewId(pDocument->mnDocumentId); + SfxViewShell* pViewShell = SfxLokHelper::getViewOfId(nView); if (pViewShell) { bAllyState = pViewShell->GetLOKAccessibilityState();