desktop/source/lib/init.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
New commits: commit 06ebb2a0c94e89eb638b0aec3d597a83dfafd10c Author: Paris Oplopoios <paris.oplopo...@collabora.com> AuthorDate: Wed Jul 26 14:19:35 2023 +0300 Commit: Paris Oplopoios <parisop...@gmail.com> CommitDate: Wed Aug 2 23:39:34 2023 +0200 Compare viewRenderState before setting view on doc_paintPartTile It shouldn't be the case that the view is changed upon painting a tile if the new view has different view options, as it may have a different theme (light/dark) Change-Id: Ie218ab1ca99a588cd04e93deb7b42a18b354b811 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154940 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 8e90368b55b2a8c23ccae8aa6cd1e157294a67db) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155172 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisop...@gmail.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 08609ef442d9..932810fd4758 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4118,6 +4118,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, int nViewId = nOrigViewId; int nLastNonEditorView = -1; int nViewMatchingMode = -1; + SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); + if (!isText) { // Check if just switching to another view is enough, that has @@ -4129,11 +4131,16 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, { bool bIsInEdit = pViewShell->GetDrawView() && pViewShell->GetDrawView()->GetTextEditOutliner(); - if (!bIsInEdit) + + OString sCurrentViewRenderState = pDoc->getViewRenderState(pCurrentViewShell); + OString sNewRenderState = pDoc->getViewRenderState(pViewShell); + + if (sCurrentViewRenderState == sNewRenderState && !bIsInEdit) nLastNonEditorView = pViewShell->GetViewShellId().get(); if (pViewShell->getPart() == nPart && pViewShell->getEditMode() == nMode && + sCurrentViewRenderState == sNewRenderState && !bIsInEdit) { nViewId = pViewShell->GetViewShellId().get(); @@ -4142,7 +4149,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, doc_setView(pThis, nViewId); break; } - else if (pViewShell->getEditMode() == nMode && !bIsInEdit) + else if (pViewShell->getEditMode() == nMode && sCurrentViewRenderState == sNewRenderState && !bIsInEdit) { nViewMatchingMode = pViewShell->GetViewShellId().get(); } @@ -4154,7 +4161,6 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, // if not found view with correct part // - at least avoid rendering active textbox, This is for Impress. // - prefer view with the same mode - SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); if (nViewMatchingMode >= 0 && nViewMatchingMode != nViewId) { nViewId = nViewMatchingMode;