Tag: cws_src680_dba24 User: oj Date: 05/02/22 23:41:53 Modified: /dba/dbaccess/source/core/dataaccess/ datasource.cxx /dba/dbaccess/source/filter/xml/ dbloader2.cxx /dba/dbaccess/source/ui/dlg/ DbAdminImpl.cxx, dbwizsetup.cxx /dba/dbaccess/source/ui/inc/ dbwizsetup.hxx /dba/dbaccess/source/ui/uno/ DBTypeWizDlgSetup.cxx
Log: #i42461# reinvent the opening of database documents File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.53.2.5&r2=1.53.2.6 Delta lines: +2 -14 -------------------- --- datasource.cxx 22 Feb 2005 10:07:20 -0000 1.53.2.5 +++ datasource.cxx 23 Feb 2005 07:41:47 -0000 1.53.2.6 @@ -2,9 +2,9 @@ * * $RCSfile: datasource.cxx,v $ * - * $Revision: 1.53.2.5 $ + * $Revision: 1.53.2.6 $ * - * last change: $Author: oj $ $Date: 2005/02/22 10:07:20 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -580,18 +580,6 @@ //-------------------------------------------------------------------------- Any ODatabaseSource::queryInterface( const Type & rType ) throw (RuntimeException) { - OSL_ENSURE(rType != ::getCppuType(static_cast<Reference< XModel>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< XStorable>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< css::document::XEventBroadcaster>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< css::document::XEventListener>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< css::view::XPrintable>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< css::util::XCloseable>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< XOfficeDatabaseDocument>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< drafts::com::sun::star::ui::XUIConfigurationManagerSupplier>* >(NULL)) - && rType != ::getCppuType(static_cast<Reference< XModifiable>* >(NULL)) - ,"There is still someone thinking that this is a model. Please use the XDatasourceDocument interface!"); - - Any aIface = OSubComponent::queryInterface( rType ); if (!aIface.hasValue()) { Directory: /dba/dbaccess/source/filter/xml/ =========================================== File [changed]: dbloader2.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/xml/dbloader2.cxx?r1=1.5.18.3&r2=1.5.18.4 Delta lines: +17 -3 -------------------- --- dbloader2.cxx 21 Feb 2005 13:10:25 -0000 1.5.18.3 +++ dbloader2.cxx 23 Feb 2005 07:41:48 -0000 1.5.18.4 @@ -2,9 +2,9 @@ * * $RCSfile: dbloader2.cxx,v $ * - * $Revision: 1.5.18.3 $ + * $Revision: 1.5.18.4 $ * - * last change: $Author: oj $ $Date: 2005/02/21 13:10:25 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -471,6 +471,20 @@ makeAny(xModel), PropertyState_DIRECT_VALUE); + try + { + Reference< ::com::sun::star::document::XEventListener > xDocEventBroadcaster(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), + UNO_QUERY); + if ( xDocEventBroadcaster.is() ) + { + ::com::sun::star::document::EventObject aEvent(xModel, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew")) ); + xDocEventBroadcaster->notifyEvent(aEvent); + } + } + catch(Exception) + { + OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!"); + } // create the dialog Reference< XExecutableDialog > xAdminDialog( m_xServiceFactory->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseWizardDialog")),aArgs), UNO_QUERY); Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: DbAdminImpl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/DbAdminImpl.cxx?r1=1.7.4.3&r2=1.7.4.4 Delta lines: +14 -6 -------------------- --- DbAdminImpl.cxx 18 Feb 2005 12:42:18 -0000 1.7.4.3 +++ DbAdminImpl.cxx 23 Feb 2005 07:41:48 -0000 1.7.4.4 @@ -2,9 +2,9 @@ * * $RCSfile: DbAdminImpl.cxx,v $ * - * $Revision: 1.7.4.3 $ + * $Revision: 1.7.4.4 $ * - * last change: $Author: oj $ $Date: 2005/02/18 12:42:18 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -459,8 +459,8 @@ { if ( !m_xDatasource.is() ) { - m_xDatasource.set(m_aDataSourceName,UNO_QUERY);; - if ( !m_xDatasource.is() ) + Reference<XInterface> xIn(m_aDataSourceName,UNO_QUERY); + if ( !xIn.is() ) { ::rtl::OUString sCurrentDatasource; m_aDataSourceName >>= sCurrentDatasource; @@ -469,14 +469,22 @@ { if ( m_xDatabaseContext.is() ) m_xDatasource.set(m_xDatabaseContext->getByName(sCurrentDatasource),UNO_QUERY); + xIn = m_xDatasource; } catch(const Exception&) { } } + m_xModel.set(getDataSourceOrModel(xIn),UNO_QUERY); + if ( m_xModel.is() ) + m_xDatasource.set(xIn,UNO_QUERY); + else + { + m_xDatasource.set(getDataSourceOrModel(xIn),UNO_QUERY); + m_xModel.set(xIn,UNO_QUERY); + } } - m_xModel.set(getDataSourceOrModel(m_xDatasource),UNO_QUERY); DBG_ASSERT(m_xDatasource.is(), "ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!"); return m_xDatasource; File [changed]: dbwizsetup.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/dbwizsetup.cxx?r1=1.8.4.3&r2=1.8.4.4 Delta lines: +3 -36 -------------------- --- dbwizsetup.cxx 21 Feb 2005 13:12:02 -0000 1.8.4.3 +++ dbwizsetup.cxx 23 Feb 2005 07:41:49 -0000 1.8.4.4 @@ -2,9 +2,9 @@ * * $RCSfile: dbwizsetup.cxx,v $ * - * $Revision: 1.8.4.3 $ + * $Revision: 1.8.4.4 $ * - * last change: $Author: oj $ $Date: 2005/02/21 13:12:02 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1068,21 +1068,6 @@ //------------------------------------------------------------------------- - void ODbTypeWizDialogSetup::OpenDatabaseDocument(const ::rtl::OUString& _sPath) - { - // get the desktop object - sal_Int32 nFrameSearchFlag = FrameSearchFlag::ALL | FrameSearchFlag::GLOBAL ; - Reference< XComponentLoader > xFrameLoader(getORB()->createInstance(SERVICE_FRAME_DESKTOP),UNO_QUERY); - if ( xFrameLoader.is() ) - { - xFrameLoader->loadComponentFromURL( - _sPath, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default")), - nFrameSearchFlag, - Sequence<PropertyValue >() ); - } - } - short ODbTypeWizDialogSetup::Execute() { @@ -1191,24 +1176,6 @@ return sal_False; } } - - - //------------------------------------------------------------------ - sal_Bool ODbTypeWizDialogSetup::StartTableWizard() - { - try - { - ::rtl::OUString sPath = m_pImpl->getDocumentUrl(*m_pOutSet); - ::std::auto_ptr<OLinkedDocumentsAccess> oLinkedDocument(new OLinkedDocumentsAccess(this, getORB(), NULL, NULL,sPath)); - oLinkedDocument->newTableWithPilot(); - } - catch(const Exception&) - { - OSL_ENSURE(sal_False, "ODbTypeWizDialogSetup::newTable: caught an exception while loading the object!"); - } - return sal_True; - } - //......................................................................... } // namespace dbaui Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: dbwizsetup.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/dbwizsetup.hxx?r1=1.4&r2=1.4.2.1 Delta lines: +3 -5 ------------------- --- dbwizsetup.hxx 17 Feb 2005 11:08:12 -0000 1.4 +++ dbwizsetup.hxx 23 Feb 2005 07:41:49 -0000 1.4.2.1 @@ -2,9 +2,9 @@ * * $RCSfile: dbwizsetup.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.2.1 $ * - * last change: $Author: vg $ $Date: 2005/02/17 11:08:12 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -207,9 +207,7 @@ ApplyResult implApplyChanges(); private: - sal_Bool StartTableWizard(); //const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB void RegisterDataSourceByLocation(const ::rtl::OUString& sPath); - void OpenDatabaseDocument(const ::rtl::OUString& _sPath); sal_Bool SaveDatabaseDocument(); void activateDatabasePath(OGeneralPage* _pTabpage); void createUniqueFileName(INetURLObject* pURL); Directory: /dba/dbaccess/source/ui/uno/ ======================================= File [changed]: DBTypeWizDlgSetup.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx?r1=1.2.48.2&r2=1.2.48.3 Delta lines: +3 -35 -------------------- --- DBTypeWizDlgSetup.cxx 21 Feb 2005 13:14:17 -0000 1.2.48.2 +++ DBTypeWizDlgSetup.cxx 23 Feb 2005 07:41:50 -0000 1.2.48.3 @@ -2,9 +2,9 @@ * * $RCSfile: DBTypeWizDlgSetup.cxx,v $ * - * $Revision: 1.2.48.2 $ + * $Revision: 1.2.48.3 $ * - * last change: $Author: oj $ $Date: 2005/02/21 13:14:17 $ + * last change: $Author: oj $ $Date: 2005/02/23 07:41:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,39 +123,7 @@ //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODBTypeWizDialogSetup::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - Reference < XInterface > xDBContext = _rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"))); - - Reference<XOfficeDatabaseDocument> xOfficeDoc(xDBContext,UNO_QUERY); - Reference<XPropertySet> xDataSource(xOfficeDoc.is() ? xOfficeDoc->getDataSource() : Reference<XDataSource>(),UNO_QUERY); - - Sequence<Any> aSequence(1); - PropertyValue aPropertyValue; - Any aTmp; - aTmp <<= xDataSource; - aPropertyValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InitialSelection")); - aPropertyValue.Value = aTmp; - aSequence[0] <<= aPropertyValue; Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup(_rxFactory)); - Reference < XInitialization > xDBWizardInit(xDBWizard, UNO_QUERY); - - xDBWizardInit->initialize(aSequence); - - try - { - Reference< ::com::sun::star::document::XEventListener > xDocEventBroadcaster(_rxFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster"))), - UNO_QUERY); - if ( xDocEventBroadcaster.is() ) - { - ::com::sun::star::document::EventObject aEvent(xDBContext, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew")) ); - xDocEventBroadcaster->notifyEvent(aEvent); - } - } - catch(Exception) - { - OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!"); - } - Reference <com::sun::star::ui::dialogs::XExecutableDialog> xDBWizardExecute( xDBWizard, UNO_QUERY ); - xDBWizardExecute->execute(); return xDBWizard; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
