From 240ec23841cc1e9728f9273d88c1f9a170cf3fb8 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Tue, 6 Nov 2018 09:43:11 +0100 Subject: Keep reference mode if only one dialog closed Change-Id: I9cf7988da7f83c28a0919c69ace131ee93054486 Reviewed-on: https://gerrit.libreoffice.org/79466 Tested-by: Jenkins Reviewed-by: Michael Meeks --- sc/source/ui/app/scmod.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sc/source/ui/app') diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index d8eb515e8eda..e21a83310256 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1483,7 +1483,16 @@ void ScModule::SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm ) //if ( pViewFrm ) // pViewFrm->GetBindings().Update(); // to avoid trouble in LockDispatcher - m_nCurRefDlgId = bVis ? nId : 0 ; // before SetChildWindow + // before SetChildWindow + if ( comphelper::LibreOfficeKit::isActive() ) + { + if ( bVis ) + m_nCurRefDlgId = nId; + } + else + { + m_nCurRefDlgId = bVis ? nId : 0; + } if ( pViewFrm ) { @@ -1753,7 +1762,13 @@ void ScModule::EndReference() //FIXME: ShowRefFrame at InputHdl, if the Function AutoPilot is open? if ( m_nCurRefDlgId ) { - SfxChildWindow* pChildWnd = lcl_GetChildWinFromAnyView( m_nCurRefDlgId ); + SfxChildWindow* pChildWnd = nullptr; + + if ( comphelper::LibreOfficeKit::isActive() ) + pChildWnd = lcl_GetChildWinFromCurrentView( m_nCurRefDlgId ); + else + pChildWnd = lcl_GetChildWinFromAnyView( m_nCurRefDlgId ); + OSL_ENSURE( pChildWnd, "NoChildWin" ); if ( pChildWnd ) { -- cgit