summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-10-04 14:36:34 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-04 14:42:52 +0200
commitdd11a1e57a2565560803dc3fef5fccc9e7157105 (patch)
tree4adf17c00e21a17b0137a286ce1547b0e56bea2f /dbaccess/source
parentc25cb8a641723ab098980bb842caf75c0dc9b059 (diff)
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
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx4
-rw-r--r--dbaccess/source/ext/macromigration/docinteraction.cxx2
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx2
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx3
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx12
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx9
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx2
-rw-r--r--dbaccess/source/ui/misc/datasourceconnector.cxx2
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx25
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx5
15 files changed, 32 insertions, 44 deletions
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;
}