summaryrefslogtreecommitdiffstats
path: root/dbaccess/source/ui/misc/linkeddocuments.cxx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-04 16:04:06 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-04 16:04:06 +0100
commit538e41ebb44726aa666c92b79d0000aca8c41ae4 (patch)
treeac8d879d8b03bd4a206d1a4eef12034e224e0042 /dbaccess/source/ui/misc/linkeddocuments.cxx
parentautorecovery: need to lock the SolarMutex when disposing, some of the depende... (diff)
downloadcore-538e41ebb44726aa666c92b79d0000aca8c41ae4.tar.gz
core-538e41ebb44726aa666c92b79d0000aca8c41ae4.zip
autorecovery: form and report wizzard now also using XDatabaseDocumentUI, instead of manipulating document definitions
All database object wizards by now employ XDatabaseDocumentUI. This way, it is ensured that the controller has the full control over the opened sub components. Still, other third-party code could use direct access to the document definitions, and open sub documents this way. This would go unnoticed by the application controller at the moment. I would be possible to fix this, by introducing broadcasts from the document definitions, listened to by the controller. But as this sounds like a rare case, and XDatabaseDocumentUI is the preferred way for third-party components, too, such an implementation is deferred to Later ...
Diffstat (limited to 'dbaccess/source/ui/misc/linkeddocuments.cxx')
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx55
1 files changed, 18 insertions, 37 deletions
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 9dc35a684041..85f8eb635947 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -268,81 +268,62 @@ namespace dbaui
return xRet;
}
//------------------------------------------------------------------
- Reference< XComponent> OLinkedDocumentsAccess::impl_newWithPilot( const char* _pWizardService,
- Reference< XComponent >& _xDefinition, const sal_Int32 _nCommandType, const ::rtl::OUString& _rObjectName )
+ void OLinkedDocumentsAccess::impl_newWithPilot( const char* _pWizardService,
+ const sal_Int32 _nCommandType, const ::rtl::OUString& _rObjectName )
{
- Reference< XComponent> xRet;
try
{
::comphelper::NamedValueCollection aArgs;
aArgs.put( "DataSourceName", m_sDataSourceName );
+ if ( m_xConnection.is() )
+ aArgs.put( "ActiveConnection", m_xConnection );
+
if ( _rObjectName.getLength() && ( _nCommandType != -1 ) )
{
aArgs.put( "CommandType", _nCommandType );
aArgs.put( "Command", _rObjectName );
}
- if ( m_xConnection.is() )
- aArgs.put( "ActiveConnection", m_xConnection );
aArgs.put( "DocumentUI", m_xDocumentUI );
- Reference< XController > xController( m_xDocumentUI, UNO_QUERY_THROW );
- aArgs.put( "ParentFrame", xController->getFrame() );
- // (legacy, 'til not all wizards migrated to the DocumentUI parameter)
-
Reference< XJobExecutor > xWizard;
{
WaitObject aWaitCursor( m_pDialogParent );
xWizard.set( m_xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii(_pWizardService),
+ ::rtl::OUString::createFromAscii( _pWizardService ),
aArgs.getWrappedPropertyValues()
- ), UNO_QUERY );
+ ), UNO_QUERY_THROW );
}
- if ( xWizard.is() )
- {
- xWizard->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("start")));
- Reference<XPropertySet> xProp( xWizard, UNO_QUERY_THROW );
- Reference<XPropertySetInfo> xInfo( xProp->getPropertySetInfo(), UNO_SET_THROW );
- if ( xInfo->hasPropertyByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Document"))) )
- {
- _xDefinition.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentDefinition"))),UNO_QUERY);
- xRet.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Document"))),UNO_QUERY);
- }
- xWizard->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("end")));
- ::comphelper::disposeComponent(xWizard);
- }
+ xWizard->trigger( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "start" ) ) );
+ ::comphelper::disposeComponent( xWizard );
}
catch(const Exception& e)
{
- (void) e;
- OSL_ENSURE(sal_False, "OLinkedDocumentsAccess::newWithPilot: caught an exception while loading the object!");
+ DBG_UNHANDLED_EXCEPTION();
}
- return xRet;
}
//------------------------------------------------------------------
- Reference< XComponent> OLinkedDocumentsAccess::newFormWithPilot(Reference< XComponent >& _xDefinition,const sal_Int32 _nCommandType,const ::rtl::OUString& _rObjectName)
+ void OLinkedDocumentsAccess::newFormWithPilot( const sal_Int32 _nCommandType,const ::rtl::OUString& _rObjectName )
{
- return impl_newWithPilot( "com.sun.star.wizards.form.CallFormWizard", _xDefinition, _nCommandType, _rObjectName );
+ impl_newWithPilot( "com.sun.star.wizards.form.CallFormWizard", _nCommandType, _rObjectName );
}
//------------------------------------------------------------------
- Reference< XComponent> OLinkedDocumentsAccess::newReportWithPilot( Reference< XComponent >& _xDefinition, const sal_Int32 _nCommandType, const ::rtl::OUString& _rObjectName )
+ void OLinkedDocumentsAccess::newReportWithPilot( const sal_Int32 _nCommandType, const ::rtl::OUString& _rObjectName )
{
- return impl_newWithPilot( "com.sun.star.wizards.report.CallReportWizard", _xDefinition, _nCommandType, _rObjectName );
+ impl_newWithPilot( "com.sun.star.wizards.report.CallReportWizard", _nCommandType, _rObjectName );
}
//------------------------------------------------------------------
- Reference< XComponent> OLinkedDocumentsAccess::newTableWithPilot()
+ void OLinkedDocumentsAccess::newTableWithPilot()
{
- Reference< XComponent > xDefinition;
- return impl_newWithPilot( "com.sun.star.wizards.table.CallTableWizard", xDefinition, -1, ::rtl::OUString() );
+ impl_newWithPilot( "com.sun.star.wizards.table.CallTableWizard", -1, ::rtl::OUString() );
}
//------------------------------------------------------------------
- Reference< XComponent> OLinkedDocumentsAccess::newQueryWithPilot()
+ void OLinkedDocumentsAccess::newQueryWithPilot()
{
- Reference< XComponent > xDefinition;
- return impl_newWithPilot( "com.sun.star.wizards.query.CallQueryWizard", xDefinition, -1, ::rtl::OUString() );
+ impl_newWithPilot( "com.sun.star.wizards.query.CallQueryWizard", -1, ::rtl::OUString() );
}
//------------------------------------------------------------------
Reference< XComponent > OLinkedDocumentsAccess::newDocument( sal_Int32 i_nActionID,