diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/svapp.cxx | 90 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 |
2 files changed, 40 insertions, 52 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 6225104ababf..5a2ae0c8a586 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1431,70 +1431,60 @@ OUString Application::GetToolkitName() return OUString(); } -void Application::SetDefDialogParent( vcl::Window* pWindow ) -{ - ImplGetSVData()->maWinData.mpDefDialogParent = pWindow; -} - vcl::Window* Application::GetDefDialogParent() { ImplSVData* pSVData = ImplGetSVData(); - // #103442# find some useful dialog parent if there - // was no default set - // NOTE: currently even the default is not used - if( false && pSVData->maWinData.mpDefDialogParent.get() != nullptr ) - return pSVData->maWinData.mpDefDialogParent; - else - { - // always use the topmost parent of the candidate - // window to avoid using dialogs or floaters - // as DefDialogParent + // find some useful dialog parent - // current focus frame - vcl::Window *pWin = nullptr; - if( (pWin = pSVData->maWinData.mpFocusWin) != nullptr ) - { - while( pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent ) - pWin = pWin->mpWindowImpl->mpParent; + // always use the topmost parent of the candidate + // window to avoid using dialogs or floaters + // as DefDialogParent - // check for corrupted window hierarchy, #122232#, may be we now crash somewhere else - if( !pWin->mpWindowImpl ) - { - OSL_FAIL( "Window hierarchy corrupted!" ); - pSVData->maWinData.mpFocusWin = nullptr; // avoid further access - return nullptr; - } + // current focus frame + vcl::Window *pWin = nullptr; + if( (pWin = pSVData->maWinData.mpFocusWin) != nullptr ) + { + while( pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent ) + pWin = pWin->mpWindowImpl->mpParent; - if( (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0 ) - { - return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow(); - } + // check for corrupted window hierarchy, #122232#, may be we now crash somewhere else + if( !pWin->mpWindowImpl ) + { + OSL_FAIL( "Window hierarchy corrupted!" ); + pSVData->maWinData.mpFocusWin = nullptr; // avoid further access + return nullptr; } - // last active application frame - if( nullptr != (pWin = pSVData->maWinData.mpActiveApplicationFrame) ) + + if( (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0 ) { return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow(); } - else + } + + // last active application frame + if( nullptr != (pWin = pSVData->maWinData.mpActiveApplicationFrame) ) + { + return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow(); + } + else + { + // first visible top window (may be totally wrong....) + pWin = pSVData->maWinData.mpFirstFrame; + while( pWin ) { - // first visible top window (may be totally wrong....) - pWin = pSVData->maWinData.mpFirstFrame; - while( pWin ) + if( pWin->ImplGetWindow()->IsTopWindow() && + pWin->mpWindowImpl->mbReallyVisible && + (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0 + ) { - if( pWin->ImplGetWindow()->IsTopWindow() && - pWin->mpWindowImpl->mbReallyVisible && - (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0 - ) - { - while( pWin->mpWindowImpl->mpParent ) - pWin = pWin->mpWindowImpl->mpParent; - return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow(); - } - pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame; + while( pWin->mpWindowImpl->mpParent ) + pWin = pWin->mpWindowImpl->mpParent; + return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow(); } - // use the desktop - return nullptr; + pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame; } + // use the desktop + return nullptr; } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 9a4d62ba634c..de678c506131 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -255,8 +255,6 @@ void Window::dispose() EndTracking(); if (IsMouseCaptured()) ReleaseMouse(); - if ( pSVData->maWinData.mpDefDialogParent == this ) - pSVData->maWinData.mpDefDialogParent = nullptr; #if OSL_DEBUG_LEVEL > 0 if ( true ) // always perform these tests in debug builds |