dbaccess/source/filter/xml/xmlfilter.cxx | 38 ++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-)
New commits: commit 80af51be1aa85733b9c0b696a93edd8c6520811c Author: Mike Kaganski <[email protected]> Date: Wed Nov 8 14:22:44 2017 +0200 ODBFilter::filter: Also leave window wait on exception Change-Id: I6bb759c583e15f229bc2afa178a1d1d90d8315ef Reviewed-on: https://gerrit.libreoffice.org/44458 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 8069a577f8e1..f386206bec66 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -244,30 +244,38 @@ css::uno::Reference< css::uno::XInterface > return static_cast< XServiceInfo* >(new ODBFilter( comphelper::getComponentContext(_rxORB))); } - -sal_Bool SAL_CALL ODBFilter::filter( const Sequence< PropertyValue >& rDescriptor ) +namespace { +class FocusWindowWaitGuard { - uno::Reference< css::awt::XWindow > xWindow; +public: + FocusWindowWaitGuard() { SolarMutexGuard aGuard; - vcl::Window* pFocusWindow = Application::GetFocusWindow(); - xWindow = VCLUnoHelper::GetInterface( pFocusWindow ); - if( pFocusWindow ) - pFocusWindow->EnterWait(); + mpWindow.set(Application::GetFocusWindow()); + if (mpWindow) + mpWindow->EnterWait(); } + ~FocusWindowWaitGuard() + { + if (mpWindow) + { + SolarMutexGuard aGuard; + mpWindow->LeaveWait(); + } + } +private: + VclPtr<vcl::Window> mpWindow; +}; +} + +sal_Bool SAL_CALL ODBFilter::filter( const Sequence< PropertyValue >& rDescriptor ) +{ + FocusWindowWaitGuard aWindowFocusGuard; bool bRet = false; if ( GetModel().is() ) bRet = implImport( rDescriptor ); - if ( xWindow.is() ) - { - SolarMutexGuard aGuard; - VclPtr<vcl::Window> pFocusWindow = VCLUnoHelper::GetWindow( xWindow ); - if ( pFocusWindow ) - pFocusWindow->LeaveWait(); - } - return bRet; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
