diff options
author | Paris Oplopoios <paris.oplopoios@collabora.com> | 2023-07-26 14:19:35 +0300 |
---|---|---|
committer | Paris Oplopoios <parisoplop@gmail.com> | 2023-08-02 23:39:34 +0200 |
commit | 06ebb2a0c94e89eb638b0aec3d597a83dfafd10c (patch) | |
tree | 905f41209da9f0933d2d84b1e779195ff657024d /desktop/source | |
parent | fe55282c02a3306ac1c7971a5c2c85c52f54d205 (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 8e90368b55b2a8c23ccae8aa6cd1e157294a67db)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155172
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
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; |