From dd11a1e57a2565560803dc3fef5fccc9e7157105 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 4 Oct 2012 14:36:34 +0200 Subject: Fixes/improvements on previous commit * UUIInteractionHandler still needs to implement XInitialization. * Moved ambiguating InteractionHandler typedef out of the way. * Removed InteractionHandler.createDefault, as it was originally stated that "it is strongly recommended that [the "Parent"] property is supplied." * Added back documentation about Parent and Context. * Simplified some call-sites to directly use XInteractionHandler2. Change-Id: I1029b8f3cf079171c75920cafaaa44b5bbada883 --- basctl/source/basicide/moduldl2.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'basctl/source/basicide/moduldl2.cxx') diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index f14611836c2d..5de042e9262f 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -82,9 +82,9 @@ namespace class DummyInteractionHandler : public HandlerImpl_BASE { - Reference< task::XInteractionHandler > m_xHandler; + Reference< task::XInteractionHandler2 > m_xHandler; public: - DummyInteractionHandler( const Reference< task::XInteractionHandler >& xHandler ) : m_xHandler( xHandler ){} + DummyInteractionHandler( const Reference< task::XInteractionHandler2 >& xHandler ) : m_xHandler( xHandler ){} virtual void SAL_CALL handle( const Reference< task::XInteractionRequest >& rRequest ) throw (::com::sun::star::uno::RuntimeException) { @@ -1255,7 +1255,7 @@ void LibPage::ExportAsPackage( const String& aLibName ) // file open dialog Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - Reference< task::XInteractionHandler > xHandler( task::InteractionHandler::createDefault(xContext), UNO_QUERY ); + Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, 0) ); Reference< XSimpleFileAccess2 > xSFA = SimpleFileAccess::create(xContext); Reference < XFilePicker > xFP; @@ -1307,7 +1307,10 @@ void LibPage::ExportAsPackage( const String& aLibName ) implExportLib( aLibName, aTmpPath, xDummyHandler ); Reference< XCommandEnvironment > xCmdEnv = - static_cast( new OLibCommandEnvironment( xHandler ) ); + static_cast( + new OLibCommandEnvironment( + Reference< task::XInteractionHandler >( + xHandler, UNO_QUERY ) ) ); ::ucbhelper::Content sourceContent( aSourcePath, xCmdEnv, comphelper::getProcessComponentContext() ); @@ -1386,7 +1389,7 @@ void LibPage::ExportAsBasic( const String& aLibName ) Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XFolderPicker > xFolderPicker( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ) ) ), UNO_QUERY ); - Reference< task::XInteractionHandler > xHandler( task::InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, 0) ); if( xFolderPicker.is() ) { -- cgit