summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx12
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;