diff options
61 files changed, 185 insertions, 178 deletions
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<XCommandEnvironment*>( new OLibCommandEnvironment( xHandler ) ); + static_cast<XCommandEnvironment*>( + 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() ) { diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index e5800bc9dc4d..2afd00192482 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -307,7 +307,7 @@ Reference< XConnection > getConnection_allowException( if (xConnectionCompletion.is()) { // instantiate the default SDB interaction handler Reference< XInteractionHandler > xHandler( - InteractionHandler::createDefault(_rxContext), UNO_QUERY_THROW ); + InteractionHandler::createWithParent(_rxContext, 0), UNO_QUERY ); xConnection = xConnectionCompletion->connectWithCompletion(xHandler); } } diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 95b2eb13f0d5..e15c328af33f 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -342,9 +342,8 @@ short SvInsertOleDlg::Execute() aMedium[0].Value <<= ::rtl::OUString( aFileName ); uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - uno::Reference< task::XInteractionHandler > xInteraction( - task::InteractionHandler::createDefault(xContext), - uno::UNO_QUERY_THROW ); + uno::Reference< task::XInteractionHandler2 > xInteraction( + task::InteractionHandler::createWithParent(xContext, 0) ); aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ); aMedium[1].Value <<= xInteraction; diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 5b4ca5fcb09f..bc7bb02b7856 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -188,8 +188,8 @@ void WebConnectionInfoDialog::FillPasswordList() if ( xMasterPasswd->isPersistentStoringAllowed() ) { uno::Reference< task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY); uno::Sequence< task::UrlRecord > aURLEntries = xMasterPasswd->getAllPersistent( xInteractionHandler ); sal_Int32 nCount = 0; @@ -297,8 +297,8 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl) uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest ); uno::Reference< task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW ); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY ); xInteractionHandler->handle( rRequest ); if ( pPasswordRequest->isPassword() ) diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 717661d57e46..798262f941a6 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -363,7 +363,7 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin ::comphelper::NamedValueCollection aArgs; aArgs.put( "URL", _sURL ); aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG ); - aArgs.put( "InteractionHandler", task::InteractionHandler::createDefault(m_aContext.getUNOContext()) ); + aArgs.put( "InteractionHandler", task::InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); Sequence< PropertyValue > aResource( aArgs.getPropertyValues() ); xLoad->load( aResource ); diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index fd1ded798872..5abe8f8bb8d9 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1301,7 +1301,7 @@ sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); xHandler->handle(xRequest); if ( pAbort->wasSelected() ) @@ -1375,7 +1375,7 @@ sal_Bool ODocumentDefinition::saveAs() pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); xHandler->handle(xRequest); if ( pAbort->wasSelected() ) diff --git a/dbaccess/source/ext/macromigration/docinteraction.cxx b/dbaccess/source/ext/macromigration/docinteraction.cxx index f2f9dc5938fd..9e21ef418541 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.cxx +++ b/dbaccess/source/ext/macromigration/docinteraction.cxx @@ -66,7 +66,7 @@ namespace dbmm } InteractionHandler_Data( const ::comphelper::ComponentContext& _rContext ) - :xHandler( ::com::sun::star::task::InteractionHandler::createDefault(_rContext.getUNOContext()), UNO_QUERY_THROW ) + :xHandler( ::com::sun::star::task::InteractionHandler::createWithParent(_rContext.getUNOContext(), 0), UNO_QUERY ) { } }; diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 52562d997540..07fe9f25229c 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -429,7 +429,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: // not touch it. if ( !aMediaDesc.has( "InteractionHandler" ) ) { - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); aMediaDesc.put( "InteractionHandler", xHandler ); } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index d03cd2abd0bd..460b09354860 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1471,7 +1471,7 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for pParamRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(comphelper::ComponentContext(getORB()).getUNOContext()), UNO_QUERY_THROW); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); xHandler->handle(xParamRequest); if (!pParamValues->wasSelected()) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 23148ba2a812..058aaefcadf4 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3531,8 +3531,7 @@ void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) if ( xDocumentModel.is() ) { Reference< XInteractionHandler2 > xInteractionHandler( - InteractionHandler::createDefault(comphelper::getComponentContext(getORB())), - UNO_QUERY_THROW ); + InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); ::comphelper::NamedValueCollection aLoadArgs; aLoadArgs.put( "Model", xDocumentModel ); diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 3c11de710096..7123db850014 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -29,7 +29,6 @@ #include <toolkit/helper/vclunohelper.hxx> #include <svtools/QueryFolderName.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -170,20 +169,13 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) InteractiveAugmentedIOException aException(sTemp,Reference<XInterface>(),eClass,eError,aValues); - Reference<XInitialization> xIni( - InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), UNO_QUERY_THROW); - aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent")); - aValue.Value <<= VCLUnoHelper::GetInterface( this ); - Sequence< Any > aArgs(1); - aArgs[0] <<= makeAny(aValue); - xIni->initialize(aArgs); + Reference<XInteractionHandler2> xHandler( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), VCLUnoHelper::GetInterface( this ))); OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aException)); Reference< XInteractionRequest > xRequest(pRequest); OInteractionApprove* pApprove = new OInteractionApprove; pRequest->addContinuation(pApprove); - - Reference< XInteractionHandler > xHandler(xIni,UNO_QUERY); xHandler->handle(xRequest); return 0; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index f3cab0081558..ac7e55f21a55 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -524,7 +524,7 @@ DBG_NAME(OConnectionHelper) sal_Bool bExists = sal_False; IS_PATH_EXIST eExists = PATH_NOT_EXIST; Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), UNO_QUERY_THROW ); + task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); OFilePickerInteractionHandler* pHandler = new OFilePickerInteractionHandler(xInteractionHandler); xInteractionHandler = pHandler; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 30118af634d3..9082417c97ca 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -255,7 +255,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( task::InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), UNO_QUERY_THROW ); + xHandler = Reference< XInteractionHandler >( task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); } String sName = pName ? pName->GetValue() : String(); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index dfdb2e26bb1e..1f34d54c47df 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -735,7 +735,7 @@ namespace //------------------------------------------------------------------------- sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { - Reference< XInteractionHandler2 > xHandler( InteractionHandler::createDefault(comphelper::getComponentContext(getORB())), UNO_QUERY_THROW ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); try { if (callSaveAsDialog() == sal_True) @@ -965,7 +965,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() private: Reference< XComponentLoader > m_xFrameLoader; Reference< XDesktop > m_xDesktop; - Reference< XInteractionHandler > m_xInteractionHandler; + Reference< XInteractionHandler2 > m_xInteractionHandler; ::rtl::OUString m_sURL; OAsyncronousLink m_aAsyncCaller; @@ -993,9 +993,8 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { m_xDesktop.set( _rxORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); m_xFrameLoader.set( m_xDesktop, UNO_QUERY_THROW ); - m_xInteractionHandler.set( - InteractionHandler::createDefault(comphelper::getComponentContext(_rxORB)), - UNO_QUERY_THROW ); + m_xInteractionHandler = + InteractionHandler::createWithParent(comphelper::getComponentContext(_rxORB), 0); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index a705c8b7dcdf..d43e4cdd7752 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -192,7 +192,7 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP } else { // instantiate the default SDB interaction handler - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(_rxContext), UNO_QUERY_THROW); + Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(_rxContext, 0), UNO_QUERY); _rOUTConnection = xConnectionCompletion->connectWithCompletion(xHandler); } } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index c63f77ce1ad9..bf3c9d35e7d4 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -684,7 +684,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); - m_xInteractionHandler.set( InteractionHandler::createDefault(comphelper::getComponentContext(m_xFactory)), UNO_QUERY_THROW ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0), UNO_QUERY ); OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowViews(); diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 4f1b4af83014..b4b4187038d6 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -139,7 +139,7 @@ namespace dbaui if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), UNO_QUERY_THROW ); + xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); } xConnection = xConnectionCompletion->connectWithCompletion(xHandler); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index d41a4967ddce..252564d610d8 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -136,7 +136,6 @@ namespace dbaui namespace DataType = ::com::sun::star::sdbc::DataType; typedef ::utl::SharedUNOComponent< XConnection > SharedConnection; - typedef Reference< XInteractionHandler > InteractionHandler; //========================================================================= //= CopyTableWizard @@ -239,7 +238,7 @@ namespace dbaui const Sequence< Any >& _rAllArgs, const sal_Int16 _nArgPos, SharedConnection& _out_rxConnection, - InteractionHandler& _out_rxDocInteractionHandler + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const; /** extracts the source object (table or query) described by the given descriptor, @@ -293,7 +292,7 @@ namespace dbaui SharedConnection impl_extractConnection_throw( const Reference< XPropertySet >& _rxDataSourceDescriptor, - InteractionHandler& _out_rxDocInteractionHandler + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const; /** actually copies the table @@ -358,7 +357,7 @@ private: SharedConnection m_xDestConnection; // other - InteractionHandler m_xInteractionHandler; + Reference< XInteractionHandler > m_xInteractionHandler; ::cppu::OInterfaceContainerHelper m_aCopyTableListeners; sal_Int16 m_nOverrideExecutionResult; @@ -635,9 +634,9 @@ namespace if it occures during invoking any of the data source's methods, or if any of the involved components violates its contract by not providing the required interfaces */ - InteractionHandler lcl_getInteractionHandler_throw( const Reference< XDataSource >& _rxDataSource, const InteractionHandler& _rFallback ) + Reference< XInteractionHandler > lcl_getInteractionHandler_throw( const Reference< XDataSource >& _rxDataSource, const Reference< XInteractionHandler >& _rFallback ) { - InteractionHandler xHandler( _rFallback ); + Reference< XInteractionHandler > xHandler( _rFallback ); // try to obtain the document model Reference< XModel > xDocumentModel; @@ -664,7 +663,7 @@ namespace if it occures during invoking any of the data source's methods, or if any of the involved components violates its contract by not providing the required interfaces */ - InteractionHandler lcl_getInteractionHandler_throw( const Reference< XConnection >& _rxConnection, const InteractionHandler& _rFallback ) + Reference< XInteractionHandler > lcl_getInteractionHandler_throw( const Reference< XConnection >& _rxConnection, const Reference< XInteractionHandler >& _rFallback ) { // try whether there is a data source which the connection belongs to Reference< XDataSource > xDataSource; @@ -682,7 +681,7 @@ namespace //------------------------------------------------------------------------- Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw( const Sequence< Any >& _rAllArgs, const sal_Int16 _nArgPos, SharedConnection& _out_rxConnection, - InteractionHandler& _out_rxDocInteractionHandler ) const + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const { Reference< XPropertySet > xDescriptor; _rAllArgs[ _nArgPos ] >>= xDescriptor; @@ -879,7 +878,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope //------------------------------------------------------------------------- SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< XPropertySet >& _rxDataSourceDescriptor, - InteractionHandler& _out_rxDocInteractionHandler ) const + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const { SharedConnection xConnection; @@ -887,7 +886,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< if ( !_rxDataSourceDescriptor.is() ) return xConnection; - InteractionHandler xInteractionHandler; + Reference< XInteractionHandler > xInteractionHandler; do { @@ -1554,15 +1553,15 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) ); } if ( !m_xInteractionHandler.is() ) - m_xInteractionHandler.set( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY_THROW ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0), UNO_QUERY ); - InteractionHandler xSourceDocHandler; + Reference< XInteractionHandler > xSourceDocHandler; Reference< XPropertySet > xSourceDescriptor( impl_ensureDataAccessDescriptor_throw( _rArguments, 0, m_xSourceConnection, xSourceDocHandler ) ); impl_checkForUnsupportedSettings_throw( xSourceDescriptor ); m_pSourceObject = impl_extractSourceObject_throw( xSourceDescriptor, m_nCommandType ); impl_extractSourceResultSet_throw( xSourceDescriptor ); - InteractionHandler xDestDocHandler; + Reference< XInteractionHandler > xDestDocHandler; impl_ensureDataAccessDescriptor_throw( _rArguments, 1, m_xDestConnection, xDestDocHandler ); if ( xDestDocHandler.is() && !m_xInteractionHandler.is() ) diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index 4a8d80fb4230..8cb12b91397a 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -304,11 +304,10 @@ namespace dbaui //------------------------------------------------------------------------- bool BasicInteractionHandler::implHandleUnknown( const Reference< XInteractionRequest >& _rxRequest ) { - Reference< XInteractionHandler > xFallbackHandler; if ( m_xORB.is() ) - xFallbackHandler = xFallbackHandler.query( InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)) ); - if ( xFallbackHandler.is() ) { + Reference< XInteractionHandler2 > xFallbackHandler( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0) ); xFallbackHandler->handle( _rxRequest ); return true; } diff --git a/desktop/source/app/configinit.cxx b/desktop/source/app/configinit.cxx index 66b1c6e3d4d0..9394a9b59be5 100644 --- a/desktop/source/app/configinit.cxx +++ b/desktop/source/app/configinit.cxx @@ -165,7 +165,7 @@ void ConfigurationErrorHandler::deactivate() ConfigurationErrorHandler::InteractionHandler ConfigurationErrorHandler::getDefaultInteractionHandler() { uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - InteractionHandler xHandler( com::sun::star::task::InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + InteractionHandler xHandler( com::sun::star::task::InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); return xHandler; } //------------------------------------------------------------------------------ diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 091d48465205..261fa64572de 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -227,9 +227,8 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch } else { - Reference < XInteractionHandler > xInteraction( - InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), - UNO_QUERY_THROW ); + Reference < XInteractionHandler2 > xInteraction( + InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), 0) ); aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aArgs[1].Value <<= xInteraction; diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index b52478146734..943d37e6b33b 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -36,7 +36,6 @@ #include <cstddef> -#include "com/sun/star/beans/PropertyValue.hpp" #include "com/sun/star/beans/NamedValue.hpp" #include "com/sun/star/deployment/DependencyException.hpp" @@ -134,7 +133,7 @@ class ProgressCmdEnv task::XInteractionHandler, ucb::XProgressHandler > { - uno::Reference< task::XInteractionHandler> m_xHandler; + uno::Reference< task::XInteractionHandler2> m_xHandler; uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< task::XAbortChannel> m_xAbortChannel; @@ -533,11 +532,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & // forward to UUI handler: if (! m_xHandler.is()) { // late init: - uno::Sequence< uno::Any > handlerArgs( 1 ); - handlerArgs[ 0 ] <<= beans::PropertyValue( - OUSTR("Context"), -1, uno::Any( m_sTitle ), - beans::PropertyState_DIRECT_VALUE ); - m_xHandler.set( task::InteractionHandler::createWithParentAndContext(m_xContext, NULL, m_sTitle), uno::UNO_QUERY_THROW ); + m_xHandler = task::InteractionHandler::createWithParentAndContext(m_xContext, NULL, m_sTitle); } m_xHandler->handle( xRequest ); } diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 107e7b6017cd..e22463347c1d 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -273,9 +273,9 @@ UpdateDialog::Thread::Thread( { if( m_context.is() ) { - m_xInteractionHdl = uno::Reference< task::XInteractionHandler > ( - task::InteractionHandler::createDefault(m_context), - uno::UNO_QUERY_THROW ); + m_xInteractionHdl.set( + task::InteractionHandler::createWithParent(m_context, 0), + uno::UNO_QUERY ); m_updateInformation->setInteractionHandler( m_xInteractionHdl ); } } diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 9b23732e70e9..0577224521d7 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -527,10 +527,9 @@ namespace abp Reference< XInteractionHandler > xInteractions; try { - xInteractions = Reference< XInteractionHandler >( - InteractionHandler::createDefault(comphelper::getComponentContext(m_pImpl->xORB)), - UNO_QUERY_THROW - ); + xInteractions.set( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_pImpl->xORB), 0), + UNO_QUERY); } catch(const Exception&) { diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 1146aaf64d13..242733b52744 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -119,7 +119,7 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL) Reference< XCompletedConnection > xComplConn(xDataSource, UNO_QUERY); try { - Reference<task::XInteractionHandler> xIHdl( task::InteractionHandler::createDefault(xContext), UNO_QUERY_THROW); + Reference<task::XInteractionHandler> xIHdl( task::InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW); xConn = xComplConn->connectWithCompletion(xIHdl); } catch (const SQLException&) diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index cb5a0d4721f1..767088ea8fcb 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -518,7 +518,7 @@ namespace dbp Reference< XInteractionHandler > xHandler; try { - xHandler = Reference< XInteractionHandler >( InteractionHandler::createDefault(comphelper::getComponentContext(getServiceFactory())), UNO_QUERY_THROW ); + xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(comphelper::getComponentContext(getServiceFactory()), 0), UNO_QUERY_THROW ); } catch(const Exception&) { } if (!xHandler.is()) diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 6ee4458f411f..e4d125f8e20d 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -450,9 +450,9 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > if( !xServiceManager.is() ) throw uno::RuntimeException( UNISTRING( "UpdateHandler: unable to obtain service manager from component context" ), *this ); - mxInteractionHdl = uno::Reference<task::XInteractionHandler> ( - task::InteractionHandler::createDefault(mxContext), - uno::UNO_QUERY_THROW); + mxInteractionHdl.set( + task::InteractionHandler::createWithParent(mxContext, 0), + uno::UNO_QUERY_THROW); } uno::Reference< task::XInteractionRequestStringResolver > xStrResolver = task::InteractionRequestStringResolver::create( mxContext ); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 670e615df960..6f265a5f8071 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -424,7 +424,7 @@ void XMLFilterTestDialog::onExportBrowse() maExportRecentFile = aDlg.GetPath(); Reference< XComponentLoader > xLoader( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ), UNO_QUERY ); - Reference< XInteractionHandler > xInter( InteractionHandler::createDefault(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW ); + Reference< XInteractionHandler2 > xInter( InteractionHandler::createWithParent(comphelper::getComponentContext(mxMSF), 0) ); if( xLoader.is() ) { OUString aFrame( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ); @@ -619,7 +619,7 @@ void XMLFilterTestDialog::import( const OUString& rURL ) try { Reference< XComponentLoader > xLoader( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ), UNO_QUERY ); - Reference< XInteractionHandler > xInter( InteractionHandler::createDefault(comphelper::getComponentContext(mxMSF)), UNO_QUERY_THROW ); + Reference< XInteractionHandler2 > xInter( InteractionHandler::createWithParent(comphelper::getComponentContext(mxMSF), 0) ); if( xLoader.is() ) { diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx index 902ba9cffaf5..cb53a0bf7eb3 100644 --- a/forms/source/xforms/submission/replace.cxx +++ b/forms/source/xforms/submission/replace.cxx @@ -130,8 +130,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH if( _xHandler.is() ) pHelper->m_aInteractionHandler = _xHandler; else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >( - InteractionHandler::createDefault(m_xContext), UNO_QUERY_THROW); + pHelper->m_aInteractionHandler.set( + InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW); CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; pHelper->m_aProgressHandler = Reference< XProgressHandler >(pProgressHelper); diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index 156972404302..9a141a1bf459 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -73,8 +73,8 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference< if( aInteractionHandler.is() ) pHelper->m_aInteractionHandler = aInteractionHandler; else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >( - CSS::task::InteractionHandler::createDefault(m_xContext), UNO_QUERY_THROW); + pHelper->m_aInteractionHandler.set( + CSS::task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW); CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper); diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 98cbd32ae464..9a68aaecb086 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -81,8 +81,8 @@ namespace svt void SmartContent::enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::EInterceptedInteractions eInterceptions) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xGlobalInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); m_pOwnInteraction = new ::svt::OFilePickerInteractionHandler(xGlobalInteractionHandler); m_pOwnInteraction->enableInterceptions(eInterceptions); @@ -100,8 +100,8 @@ namespace svt m_xOwnInteraction = Reference< XInteractionHandler >(); Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xGlobalInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 264e673b883d..f44c4c3f34ce 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2000,10 +2000,8 @@ void SvtFileDialog::displayIOException( const String& _rURL, IOErrorCode _eCode new ::comphelper::OInteractionRequest( makeAny( aException ) ); pRequest->addContinuation( new ::comphelper::OInteractionAbort( ) ); - Reference< XInteractionHandler > xHandler( - InteractionHandler::createDefault( ::comphelper::getProcessComponentContext() ), - UNO_QUERY_THROW - ); + Reference< XInteractionHandler2 > xHandler( + InteractionHandler::createWithParent( ::comphelper::getProcessComponentContext(), 0 ) ); xHandler->handle( xRequest ); } catch( const Exception& ) diff --git a/offapi/com/sun/star/task/InteractionHandler.idl b/offapi/com/sun/star/task/InteractionHandler.idl index 524c385ce4ac..74e732346531 100644 --- a/offapi/com/sun/star/task/InteractionHandler.idl +++ b/offapi/com/sun/star/task/InteractionHandler.idl @@ -149,11 +149,22 @@ module com { module sun { module star { module task { */ published service InteractionHandler : XInteractionHandler2 { - createDefault(); + /** Creates an instance. - createWithParent([in] com::sun::star::awt::XWindow parent); + @param parent denotes the parent window for any GUI dialogs the + interaction handler pops up; may be null. + */ + createWithParent([in] com::sun::star::awt::XWindow parent); - createWithParentAndContext([in] com::sun::star::awt::XWindow parent, [in] string context); + /** Creates an instance with an additional context. + + @param parent denotes the parent window for any GUI dialogs the + interaction handler pops up; may be null. + + @param context is a textual description of the current context (used, + e.g., as a first line of text in error boxes). + */ + createWithParentAndContext([in] com::sun::star::awt::XWindow parent, [in] string context); }; }; }; }; }; diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index d95c6a03062d..df133d7d816d 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2651,7 +2651,7 @@ uno::Reference< embed::XStorage > OReportDefinition::getStorage() const uno::Reference< task::XInteractionHandler > OReportDefinition::getInteractionHandler() const { uno::Reference< task::XInteractionHandler > xRet( - task::InteractionHandler::createDefault(m_aProps->m_xContext), uno::UNO_QUERY_THROW); + task::InteractionHandler::createWithParent(m_aProps->m_xContext, 0), uno::UNO_QUERY_THROW); return xRet; } // ----------------------------------------------------------------------------- diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index c3a034c4f3df..634eeb232ef7 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -3058,7 +3058,7 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet( if ( xExecute.is() ) { uno::Reference<task::XInteractionHandler> xHandler( - task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), uno::UNO_QUERY_THROW); xExecute->executeWithCompletion( xHandler ); } diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 117a8e7ef668..4213ede828b4 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -165,8 +165,8 @@ void ScDataPilotDatabaseDlg::FillObjects() if ( !xSource.is() ) return; uno::Reference<task::XInteractionHandler> xHandler( - task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY_THROW); uno::Reference<sdbc::XConnection> xConnection = xSource->connectWithCompletion( xHandler ); diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 5b849909ef23..c3be6648b2e2 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -252,8 +252,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if ( xExecute.is() ) { uno::Reference<task::XInteractionHandler> xHandler( - task::InteractionHandler::createDefault(comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY_THROW); xExecute->executeWithCompletion( xHandler ); } else diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 96f19ec9100b..f8cf04083351 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -438,9 +438,8 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR int nArgs=3; Sequence< PropertyValue > aArgs(3); - Reference < com::sun::star::task::XInteractionHandler > xInteraction( - task::InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), - com::sun::star::uno::UNO_QUERY_THROW ); + Reference < com::sun::star::task::XInteractionHandler2 > xInteraction( + task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), 0) ); aArgs[0].Name = OUString("InteractionHandler"); aArgs[0].Value <<= xInteraction; diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx index 248595c2a453..c97d92f10596 100644 --- a/sfx2/source/bastyp/helper.cxx +++ b/sfx2/source/bastyp/helper.cxx @@ -170,8 +170,8 @@ uno::Sequence< OUString > SfxContentHelper::GetHelpTreeViewContents( const Strin try { uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - uno::Reference< task::XInteractionHandler > xInteractionHandler = uno::Reference< task::XInteractionHandler > ( - task::InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + uno::Reference< task::XInteractionHandler > xInteractionHandler( + task::InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); ::ucbhelper::Content aCnt( rURL, new ::ucbhelper::CommandEnvironment( xInteractionHandler, uno::Reference< ucb::XProgressHandler >() ), comphelper::getProcessComponentContext() ); uno::Reference< sdbc::XResultSet > xResultSet; @@ -254,8 +254,8 @@ String SfxContentHelper::GetActiveHelpString( const String& rURL ) try { uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - uno::Reference< task::XInteractionHandler > xInteractionHandler = uno::Reference< task::XInteractionHandler > ( - task::InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + uno::Reference< task::XInteractionHandler > xInteractionHandler( + task::InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); ::ucbhelper::Content aCnt( rURL, new ::ucbhelper::CommandEnvironment( xInteractionHandler, uno::Reference< ucb::XProgressHandler >() ), comphelper::getProcessComponentContext() ); // open the "active help" stream uno::Reference< io::XInputStream > xStream = aCnt.openStream(); diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx index 40f9208d53ec..776bab1513e2 100644 --- a/sfx2/source/control/templateremoteview.cxx +++ b/sfx2/source/control/templateremoteview.cxx @@ -53,8 +53,8 @@ TemplateRemoteView::TemplateRemoteView (Window *pParent, WinBits nWinStyle, bool mpItemView->setChangeNameHdl(LINK(this,TemplateRemoteView,ChangeNameHdl)); Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xGlobalInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); } diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx index 06ecbbf661a4..32fa7d89f6d1 100644 --- a/sfx2/source/dialog/templateinfodlg.cxx +++ b/sfx2/source/dialog/templateinfodlg.cxx @@ -75,8 +75,8 @@ void SfxTemplateInfoDlg::loadDocument(const OUString &rURL) try { - uno::Reference<task::XInteractionHandler> xInteractionHandler( - task::InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + uno::Reference<task::XInteractionHandler2> xInteractionHandler( + task::InteractionHandler::createWithParent(xContext, 0) ); uno::Sequence<beans::PropertyValue> aProps(1); aProps[0].Name = "InteractionHandler"; diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 666d37fd915d..9c199ad53fb3 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2527,8 +2527,8 @@ SfxMedium::GetInteractionHandler() // create default handler and cache it! Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - pImp->xInteraction = Reference< task::XInteractionHandler >( - task::InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + pImp->xInteraction.set( + task::InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); return pImp->xInteraction; } diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index bb06eddb1587..75e294ca2b00 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -391,7 +391,7 @@ void SfxDocTplService_Impl::init_Impl() { uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); uno::Reference < task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + task::InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); maCmdEnv = new TplTaskEnvironment( xInteractionHandler ); ::osl::ClearableMutexGuard aGuard( maMutex ); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 7bbfd072422d..3add4b1aacfe 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -440,9 +440,7 @@ void ModelData_Impl::CheckInteractionHandler() { try { m_aMediaDescrHM[ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ] - <<= uno::Reference< task::XInteractionHandler >( - task::InteractionHandler::createDefault(comphelper::getComponentContext(m_pOwner->GetServiceFactory())), - uno::UNO_QUERY ); + <<= task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_pOwner->GetServiceFactory()), 0); } catch( const uno::Exception& ) { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c6caa28ff4c3..70a4f1dd6c48 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -555,9 +555,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if ( !pInteractionHandlerItem ) { uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - uno::Reference< task::XInteractionHandler > xInteract( - task::InteractionHandler::createDefault(xContext), - UNO_QUERY_THROW ); + uno::Reference< task::XInteractionHandler2 > xInteract( + task::InteractionHandler::createWithParent(xContext, 0) ); SfxUnoAnyItem aInteractionItem( SID_INTERACTIONHANDLER, uno::makeAny( xInteract ) ); if ( nId == SID_SAVEDOC ) diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 092b2bac0d3a..7280a047f1f4 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1127,7 +1127,7 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); } if ( !m_aMasterPasswd.isEmpty() ) @@ -1172,7 +1172,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference< { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); } sal_Bool bCanChangePassword = sal_True; @@ -1289,7 +1289,7 @@ void SAL_CALL PasswordContainer::removeMasterPassword() { uno::Reference< lang::XMultiServiceFactory > xFactory( mComponent, uno::UNO_QUERY_THROW ); uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(xFactory) ); - xTmpHandler.set( InteractionHandler::createDefault(xContext), uno::UNO_QUERY_THROW ); + xTmpHandler.set( InteractionHandler::createWithParent(xContext, 0), uno::UNO_QUERY_THROW ); } sal_Bool bCanChangePassword = sal_True; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index dc182678dd05..2087bb843649 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -699,8 +699,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin, maResetQuickSearch.SetTimeoutHdl( LINK( this, ViewTabListBox_Impl, ResetQuickSearch_Impl ) ); Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); mxCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); @@ -1161,8 +1161,8 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId, nFlags |= FILEVIEW_MULTISELECTION; Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder ); @@ -1179,8 +1179,8 @@ SvtFileView::SvtFileView( Window* pParent, const ResId& rResId, sal_uInt8 nFlags Control( pParent, rResId ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xInteractionHandler = Reference< XInteractionHandler > ( - InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, nFlags & FILEVIEW_ONLYFOLDER ); diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 9579759419b3..c6df3734e502 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -670,9 +670,8 @@ void SvtFrameWindow_Impl::ShowDocInfo( const String& rURL ) { try { - uno::Reference < task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW ); + uno::Reference < task::XInteractionHandler2 > xInteractionHandler( + task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), 0) ); uno::Sequence < beans::PropertyValue> aProps(1); aProps[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aProps[0].Value <<= xInteractionHandler; @@ -754,8 +753,8 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B aArgs[1].Value.setValue( &b, ::getBooleanCppuType() ); aArgs[2].Name = ASCII_STR("AsTemplate"); // prevents getting an empty URL with getURL()! - uno::Reference < task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createDefault(::comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); + uno::Reference < task::XInteractionHandler2 > xInteractionHandler( + task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), 0) ); aArgs[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" )); aArgs[3].Value <<= xInteractionHandler; diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 3417d5531606..411c6d4e65c5 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -293,8 +293,8 @@ CmisDetailsContainer::CmisDetailsContainer( ) : m_xCmdEnv( ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xGlobalInteractionHandler = Reference< XInteractionHandler >( - InteractionHandler::createDefault(xContext), UNO_QUERY ); + Reference< XInteractionHandler > xGlobalInteractionHandler( + InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index a59b378746a4..ce329fa18ab4 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -850,9 +850,9 @@ void AssignmentPersistentData::Commit() Reference< XInteractionHandler > xHandler; try { - xHandler = Reference< XInteractionHandler >( - InteractionHandler::createDefault(comphelper::getComponentContext(m_xORB)), - UNO_QUERY_THROW ); + xHandler.set( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), + UNO_QUERY_THROW ); } catch(Exception&) { } if (!xHandler.is()) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 5dbb628d6b2f..fb5f281cb80e 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -4274,7 +4274,7 @@ bool FormController::ensureInteractionHandler() return false; m_bAttemptedHandlerCreation = true; - m_xInteractionHandler.set( InteractionHandler::createDefault(m_aContext.getUNOContext()), UNO_QUERY ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0), UNO_QUERY ); OSL_ENSURE( m_xInteractionHandler.is(), "FormController::ensureInteractionHandler: could not create an interaction handler!" ); return m_xInteractionHandler.is(); } diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 045436becc2c..7fd0f05c1e3f 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -561,7 +561,7 @@ void SwAddressListDialog::DetectTablesAndQueries( pUserData->xSource = uno::Reference<XDataSource>(xComplConnection, UNO_QUERY); uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(xContext), UNO_QUERY ); + uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(xContext, 0), UNO_QUERY ); pUserData->xConnection = SharedConnection( xComplConnection->connectWithCompletion( xHandler ) ); } if(pUserData->xConnection.is()) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 276639271d9c..9bd1fb12f917 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -1580,7 +1580,7 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData if ( xComplConnection.is() ) { rxSource.set(xComplConnection,UNO_QUERY); - Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(xContext), UNO_QUERY_THROW ); + Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(xContext, 0), UNO_QUERY_THROW ); xConnection = xComplConnection->connectWithCompletion( xHandler ); } } @@ -2661,7 +2661,7 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat if ( xRowSet.is() ) { - uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createDefault(comphelper::getComponentContext(xMgr)), UNO_QUERY_THROW ); + uno::Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(xMgr), 0), UNO_QUERY_THROW ); xRowSet->executeWithCompletion(xHandler); } xResultSet = uno::Reference<XResultSet>(xRowSet, UNO_QUERY); diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx index d24d8e61b1f9..6d557538a0b5 100644 --- a/ucb/workben/ucb/ucbdemo.cxx +++ b/ucb/workben/ucb/ucbdemo.cxx @@ -1306,8 +1306,8 @@ void UcbContent::transfer( const rtl::OUString& rSourceURL, sal_Bool bMove ) if (m_rUCB.getServiceFactory().is()) xInteractionHandler = uno::Reference< task::XInteractionHandler >( - task::InteractionHandler::createDefault(comphelper::getComponentContext(m_rUCB.getServiceFactory())), - uno::UNO_QUERY_THROW); + task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_rUCB.getServiceFactory()), 0), + uno::UNO_QUERY_THROW); uno::Reference< ucb::XProgressHandler > xProgressHandler( new ProgressHandler(m_rUCB)); uno::Reference< ucb::XCommandEnvironment > xEnv( diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index bf09e7e3e1d1..31d26b27a679 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -186,7 +186,7 @@ void getRememberModes( void handleAuthenticationRequest_( Window * pParent, - uno::Reference< task::XInteractionHandler > const & xIH, + uno::Reference< task::XInteractionHandler2 > const & xIH, uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, ucb::AuthenticationRequest const & rRequest, uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index e09256d9027e..09f904cf2971 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -1107,15 +1107,13 @@ UUIInteractionHelper::getContextProperty() return m_aContextParam; } -uno::Reference< task::XInteractionHandler > +uno::Reference< task::XInteractionHandler2 > UUIInteractionHelper::getInteractionHandler() SAL_THROW((uno::RuntimeException)) { - uno::Reference< task::XInteractionHandler > xIH( - InteractionHandler::createWithParentAndContext(comphelper::getComponentContext(m_xServiceFactory), - m_xWindowParam, m_aContextParam), - UNO_QUERY_THROW); - return xIH; + return InteractionHandler::createWithParentAndContext( + comphelper::getComponentContext(m_xServiceFactory), m_xWindowParam, + m_aContextParam); } namespace { diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 3266f0b90216..eee766753f92 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -52,7 +52,7 @@ namespace com { namespace sun { namespace star { namespace task { class FutureDocumentVersionProductUpdateRequest; class XInteractionContinuation; - class XInteractionHandler; + class XInteractionHandler2; class XInteractionRequest; } namespace ucb { @@ -161,7 +161,7 @@ private: getContextProperty() SAL_THROW(()); - com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > + com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler2 > getInteractionHandler() SAL_THROW((com::sun::star::uno::RuntimeException)); diff --git a/uui/source/interactionhandler.hxx b/uui/source/interactionhandler.hxx index 8d2147b74641..39acd8624a22 100644 --- a/uui/source/interactionhandler.hxx +++ b/uui/source/interactionhandler.hxx @@ -20,14 +20,16 @@ #ifndef UUI_INTERACTIONHANDLER_HXX #define UUI_INTERACTIONHANDLER_HXX +#include "com/sun/star/lang/XInitialization.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/task/XInteractionHandler2.hpp" -#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implbase3.hxx" class UUIInteractionHelper; class UUIInteractionHandler: - public cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo, + public cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo, + com::sun::star::lang::XInitialization, com::sun::star::task::XInteractionHandler2 > { public: diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index 5a688c622197..0005fe976668 100644 --- a/uui/source/passwordcontainer.cxx +++ b/uui/source/passwordcontainer.cxx @@ -23,7 +23,7 @@ #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/PasswordContainer.hpp" -#include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XInteractionHandler2.hpp" #include "com/sun/star/ucb/AuthenticationRequest.hpp" #include "com/sun/star/ucb/URLAuthenticationRequest.hpp" #include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" @@ -120,9 +120,11 @@ bool PasswordContainerHelper::handleAuthenticationRequest( uno::Reference< ucb::XInteractionSupplyAuthentication > const & xSupplyAuthentication, rtl::OUString const & rURL, - uno::Reference< task::XInteractionHandler > const & xIH ) + uno::Reference< task::XInteractionHandler2 > const & xIH ) SAL_THROW((uno::RuntimeException)) { + uno::Reference< task::XInteractionHandler > xIH1(xIH, uno::UNO_QUERY); + // Is continuation even a XInteractionSupplyAuthentication2, which // is derived from XInteractionSupplyAuthentication? uno::Reference< ucb::XInteractionSupplyAuthentication2 > @@ -167,12 +169,12 @@ bool PasswordContainerHelper::handleAuthenticationRequest( { task::UrlRecord aRec; if ( !rURL.isEmpty() ) - aRec = m_xPasswordContainer->find(rURL, xIH); + aRec = m_xPasswordContainer->find(rURL, xIH1); if ( aRec.UserList.getLength() == 0 ) { // compat: try server name. - aRec = m_xPasswordContainer->find(rRequest.ServerName, xIH); + aRec = m_xPasswordContainer->find(rRequest.ServerName, xIH1); } if ( fillContinuation( false, @@ -191,13 +193,13 @@ bool PasswordContainerHelper::handleAuthenticationRequest( task::UrlRecord aRec; if ( !rURL.isEmpty() ) aRec = m_xPasswordContainer->findForName( - rURL, rRequest.UserName, xIH); + rURL, rRequest.UserName, xIH1); if ( aRec.UserList.getLength() == 0 ) { // compat: try server name. aRec = m_xPasswordContainer->findForName( - rRequest.ServerName, rRequest.UserName, xIH); + rRequest.ServerName, rRequest.UserName, xIH1); } if ( fillContinuation( false, @@ -223,10 +225,12 @@ bool PasswordContainerHelper::addRecord( rtl::OUString const & rURL, rtl::OUString const & rUsername, uno::Sequence< rtl::OUString > const & rPasswords, - uno::Reference< task::XInteractionHandler > const & xIH, + uno::Reference< task::XInteractionHandler2 > const & xIH, bool bPersist ) SAL_THROW((uno::RuntimeException)) { + uno::Reference< task::XInteractionHandler > xIH1(xIH, uno::UNO_QUERY); + try { if ( !rUsername.isEmpty() ) @@ -246,13 +250,13 @@ bool PasswordContainerHelper::addRecord( m_xPasswordContainer->addPersistent( rURL, rUsername, rPasswords, - xIH ); + xIH1 ); } else m_xPasswordContainer->add( rURL, rUsername, rPasswords, - xIH ); + xIH1 ); } else { @@ -346,7 +350,7 @@ PasswordContainerInteractionHandler::getSupportedServiceNames_Static() //========================================================================= // -// XInteractionHandler methods. +// XInteractionHandler2 methods. // //========================================================================= @@ -356,14 +360,23 @@ PasswordContainerInteractionHandler::handle( const uno::Reference< task::XInteractionRequest >& rRequest ) throw ( uno::RuntimeException ) { + handleInteractionRequest( rRequest ); +} + +// virtual +sal_Bool SAL_CALL +PasswordContainerInteractionHandler::handleInteractionRequest( + const uno::Reference< task::XInteractionRequest >& rRequest ) + throw ( uno::RuntimeException ) +{ if ( !rRequest.is() ) - return; + return false; uno::Any aAnyRequest( rRequest->getRequest() ); ucb::AuthenticationRequest aAuthenticationRequest; if ( !( aAnyRequest >>= aAuthenticationRequest ) ) - return; + return false; rtl::OUString aURL; ucb::URLAuthenticationRequest aURLAuthenticationRequest; @@ -386,7 +399,7 @@ PasswordContainerInteractionHandler::handle( } if ( !xSupplyAuthentication.is() ) - return; + return false; // Try to obtain credentials from password container. if ( m_aPwContainerHelper. @@ -401,7 +414,9 @@ PasswordContainerInteractionHandler::handle( { // successfully handled xSupplyAuthentication->select(); + return true; } + return false; } //========================================================================= diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx index 31434a3f0da1..af9fdb16dd9b 100644 --- a/uui/source/passwordcontainer.hxx +++ b/uui/source/passwordcontainer.hxx @@ -24,7 +24,7 @@ #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/XSingleServiceFactory.hpp" -#include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XInteractionHandler2.hpp" #include "com/sun/star/task/XPasswordContainer2.hpp" namespace com { @@ -90,7 +90,7 @@ public: xSupplyAuthentication, rtl::OUString const & rURL, com::sun::star::uno::Reference< - com::sun::star::task::XInteractionHandler > const & xIH ) + com::sun::star::task::XInteractionHandler2 > const & xIH ) SAL_THROW( (com::sun::star::uno::RuntimeException) ); /** This member function adds credentials for the given URL to the password @@ -125,7 +125,7 @@ public: com::sun::star::uno::Sequence< rtl::OUString > const & rPasswords, com::sun::star::uno::Reference< - com::sun::star::task::XInteractionHandler > const & xIH, + com::sun::star::task::XInteractionHandler2 > const & xIH, bool bPersist ) SAL_THROW( (com::sun::star::uno::RuntimeException) ); @@ -140,7 +140,7 @@ private: class PasswordContainerInteractionHandler : public cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo, - com::sun::star::task::XInteractionHandler > + com::sun::star::task::XInteractionHandler2 > { public: PasswordContainerInteractionHandler( @@ -160,12 +160,17 @@ public: getSupportedServiceNames() throw ( com::sun::star::uno::RuntimeException ); - // XInteractionHandler + // XInteractionHandler2 virtual void SAL_CALL handle( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& Request ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL + handleInteractionRequest( const ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionRequest >& Request ) + throw (::com::sun::star::uno::RuntimeException); + // Non-UNO interfaces static rtl::OUString getImplementationName_Static(); diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 74ac0a3078a5..1d7280747c24 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -106,7 +106,7 @@ char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) { uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference < task::XInteractionHandler2 > xInteractionHandler( - task::InteractionHandler::createDefault(xContext) ); + task::InteractionHandler::createWithParent(xContext, 0) ); task::PasswordRequestMode eMode = bRetry ? task::PasswordRequestMode_PASSWORD_REENTER : task::PasswordRequestMode_PASSWORD_ENTER; ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest( |