From 5e3a88a283bbbe772703e099adcd70baf7ad3e2f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 5 Nov 2024 14:55:33 +0000 Subject: switching PageKind without switching EditMode retains current page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i.e. ChangeEditMode doesn't do anything if the EditMode is unchanged but the PageKind was switched from Notes to Standard. So the same page of the other mode is still selected. An explicit SwitchPage is required to change the page from the other mode. This results in the reported mode of "2", but rendering actually still rendering as if in "mode 0", so a request to render a 'standard' page returns an image of the currently still-selected 'notes' page, which confusingly can be cached and not shown until served as a reply to a later request of the 'standard' page. See DrawViewShell::ReadFrameViewData and other places for more of this pattern. Change-Id: Ie8aa8f93f45189fd6f9c37c4077fa2b547ca4815 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176084 Reviewed-by: Miklos Vajna Reviewed-by: Gökay ŞATIR Tested-by: Jenkins CollaboraOffice (cherry picked from commit 95e9c210ef8380b0909c6ba596e3023bafef4083) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176824 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- desktop/source/lib/init.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop/source') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 006910049f7d..e4c1c15aed12 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4331,6 +4331,7 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, // TODO: we could be clever and e.g. set to 0 when we change to/from // embedded object mode, and not when changing between slide/notes/combined // modes? + // TODO: Also now see ViewShellBase::setEditMode for a similar case if ( nCurrentPart < pDoc->getParts() ) { pDoc->setPart( nCurrentPart ); -- cgit