diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-22 16:41:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-02-22 22:10:25 +0100 |
commit | 6e65d9184a5525f303f75fa0dd1cfc8a401f5bc6 (patch) | |
tree | f754bb8fd8cb04d1f53630f1f71f0d605ec89deb /sfx2 | |
parent | 298d5ee4fae0c45e2dc3927a5399edc0257c75cd (diff) |
weld SvxScriptSelectorDialog
Change-Id: I885acfcdfd9544d7f4eb0e602a7acf0215cb9d92
Reviewed-on: https://gerrit.libreoffice.org/68220
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/app.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 26 |
2 files changed, 8 insertions, 23 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index ff66aad976c2..9afc9d873835 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -490,7 +490,7 @@ bool SfxApplication::IsXScriptURL( const OUString& rScriptURL ) } OUString -SfxApplication::ChooseScript() +SfxApplication::ChooseScript(weld::Window *pParent) { OUString aScriptURL; @@ -502,8 +502,7 @@ SfxApplication::ChooseScript() const SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr; uno::Reference< frame::XFrame > xFrame( pFrame ? pFrame->GetFrameInterface() : uno::Reference< frame::XFrame >() ); - ScopedVclPtr<AbstractScriptSelectorDialog> pDlg( - pFact->CreateScriptSelectorDialog( nullptr, xFrame )); + ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(pParent, xFrame)); SAL_INFO( "sfx.appl", "done, now exec it"); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index e6033326bcbb..d08edda9b1b7 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1273,25 +1273,12 @@ static OUString ChooseMacro(weld::Window* pParent, const Reference<XModel>& rxLi namespace { #if HAVE_FEATURE_SCRIPTING - vcl::Window* lcl_getDialogParent( const Reference< XFrame >& _rxFrame, vcl::Window* _pFallback ) + weld::Window* lcl_getDialogParent(const Reference<XFrame>& rxFrame) { - if ( !_rxFrame.is() ) - return _pFallback; - - try - { - Reference< awt::XWindow > xContainerWindow( _rxFrame->getContainerWindow(), UNO_SET_THROW ); - VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xContainerWindow ); - OSL_ENSURE( pWindow, "lcl_getDialogParent: cool, somebody implemented a VCL-less toolkit!" ); - - if ( pWindow ) - return pWindow->GetSystemWindow(); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION("sfx.appl"); - } - return _pFallback; + Reference<awt::XWindow> xContainerWindow; + if (rxFrame.is()) + xContainerWindow = rxFrame->getContainerWindow(); + return Application::GetFrameWeld(xContainerWindow); } SfxViewFrame* lcl_getBasicIDEViewFrame( SfxObjectShell const * i_pBasicIDE ) @@ -1529,8 +1516,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) do // artificial loop for flow control { - ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog( - lcl_getDialogParent( xFrame, GetTopWindow() ), xFrame )); + ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame)); OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" ); if ( !pDlg ) break; |