diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 5c733d6a2b02..c2026022139c 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -752,7 +752,7 @@ void ViewShellManager::Implementation::UpdateShellStack() SfxShell* pPreviousTopViewShell = mpTopViewShell; // Update the pointer to the top-most active view shell. - mpTopViewShell = (maActiveViewShells.empty()) + mpTopViewShell = (maActiveViewShells.empty() || mbFormShellAboveParent) ? nullptr : maActiveViewShells.begin()->mpShell; bool bTopViewShellChanged = mpTopViewShell != pPreviousTopViewShell;