From d2b287cdd4f5bbe93b136d9f2bf2bf2cebfcbdb6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 1 Oct 2008 12:28:29 +0000 Subject: CWS-TOOLING: integrate CWS dba31b --- dbaccess/inc/genericcontroller.hxx | 34 +- dbaccess/source/core/api/RowSetBase.hxx | 5 +- .../source/core/api/SingleSelectQueryComposer.cxx | 16 +- dbaccess/source/core/dataaccess/ModelImpl.cxx | 23 +- dbaccess/source/core/dataaccess/ModelImpl.hxx | 4 +- .../source/core/dataaccess/databasedocument.cxx | 24 + .../source/core/dataaccess/documentdefinition.cxx | 5 +- dbaccess/source/core/inc/core_resource.hrc | 6 +- dbaccess/source/core/inc/core_resource.hxx | 39 +- dbaccess/source/core/misc/ContainerMediator.cxx | 4 +- dbaccess/source/core/misc/makefile.mk | 4 +- dbaccess/source/core/misc/services.cxx | 15 +- dbaccess/source/core/resource/core_resource.cxx | 48 +- dbaccess/source/core/resource/strings.src | 204 +++++- dbaccess/source/filter/xml/makefile.mk | 6 +- dbaccess/source/filter/xml/xmlExport.cxx | 6 +- dbaccess/source/filter/xml/xmlExport.hxx | 4 +- .../source/filter/xml/xmlFileBasedDatabase.cxx | 4 +- dbaccess/source/inc/dsntypes.hxx | 45 +- dbaccess/source/ui/app/AppController.cxx | 34 +- dbaccess/source/ui/app/AppController.hxx | 5 +- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 4 +- dbaccess/source/ui/app/app.src | 7 +- dbaccess/source/ui/app/dbu_app.hrc | 5 +- dbaccess/source/ui/browser/genericcontroller.cxx | 184 ++++-- dbaccess/source/ui/browser/unodatbr.cxx | 7 +- dbaccess/source/ui/control/FieldDescControl.cxx | 70 +- dbaccess/source/ui/control/curledit.cxx | 6 +- dbaccess/source/ui/control/dbtreelistbox.cxx | 17 +- dbaccess/source/ui/dlg/AdabasStatDlg.cxx | 8 +- dbaccess/source/ui/dlg/CollectionView.cxx | 17 +- dbaccess/source/ui/dlg/ConnectionHelper.cxx | 55 +- dbaccess/source/ui/dlg/ConnectionHelper.hxx | 7 +- dbaccess/source/ui/dlg/ConnectionPage.cxx | 53 +- dbaccess/source/ui/dlg/ConnectionPage.hxx | 5 +- dbaccess/source/ui/dlg/ConnectionPageSetup.cxx | 8 +- dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 11 +- dbaccess/source/ui/dlg/DbAdminImpl.cxx | 85 ++- dbaccess/source/ui/dlg/DbAdminImpl.hxx | 5 +- dbaccess/source/ui/dlg/DriverSettings.cxx | 26 +- dbaccess/source/ui/dlg/DriverSettings.hxx | 5 +- dbaccess/source/ui/dlg/RelationDlg.cxx | 4 +- dbaccess/source/ui/dlg/UserAdminDlg.cxx | 4 +- dbaccess/source/ui/dlg/adminpages.cxx | 4 +- dbaccess/source/ui/dlg/adminpages.hxx | 4 +- dbaccess/source/ui/dlg/adtabdlg.cxx | 138 ++-- dbaccess/source/ui/dlg/advancedsettings.cxx | 8 +- dbaccess/source/ui/dlg/datasourceui.cxx | 4 +- dbaccess/source/ui/dlg/datasourceui.hxx | 4 +- dbaccess/source/ui/dlg/dbadmin.cxx | 51 +- dbaccess/source/ui/dlg/dbwiz.cxx | 70 +- dbaccess/source/ui/dlg/dbwizsetup.cxx | 195 +++--- dbaccess/source/ui/dlg/detailpages.cxx | 7 +- dbaccess/source/ui/dlg/dsselect.cxx | 8 +- dbaccess/source/ui/dlg/dsselect.hxx | 4 +- dbaccess/source/ui/dlg/generalpage.cxx | 53 +- dbaccess/source/ui/dlg/generalpage.hxx | 23 +- dbaccess/source/ui/inc/AdabasStatDlg.hxx | 4 +- dbaccess/source/ui/inc/IItemSetHelper.hxx | 4 +- dbaccess/source/ui/inc/RelationTableView.hxx | 21 +- dbaccess/source/ui/inc/TableController.hxx | 12 +- dbaccess/source/ui/inc/TableWindow.hxx | 31 +- dbaccess/source/ui/inc/TableWindowListBox.hxx | 7 +- dbaccess/source/ui/inc/UITools.hxx | 23 +- dbaccess/source/ui/inc/UserAdminDlg.hxx | 4 +- dbaccess/source/ui/inc/advancedsettingsdlg.hxx | 6 +- dbaccess/source/ui/inc/curledit.hxx | 5 +- dbaccess/source/ui/inc/dbadmin.hxx | 9 +- dbaccess/source/ui/inc/dbu_resource.hrc | 4 +- dbaccess/source/ui/inc/dbwiz.hxx | 12 +- dbaccess/source/ui/inc/dbwizsetup.hxx | 18 +- dbaccess/source/ui/inc/dsmeta.hxx | 12 +- dbaccess/source/ui/inc/unoadmin.hxx | 5 +- dbaccess/source/ui/misc/UITools.cxx | 26 +- dbaccess/source/ui/misc/charsets.cxx | 5 +- dbaccess/source/ui/misc/dbumiscres.src | 205 +----- dbaccess/source/ui/misc/dsmeta.cxx | 164 ++--- dbaccess/source/ui/misc/dsntypes.cxx | 732 --------------------- dbaccess/source/ui/misc/linkeddocuments.cxx | 6 +- dbaccess/source/ui/misc/makefile.mk | 3 +- dbaccess/source/ui/misc/singledoccontroller.cxx | 20 +- dbaccess/source/ui/querydesign/ConnectionLine.cxx | 48 +- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 5 +- dbaccess/source/ui/querydesign/TableWindow.cxx | 65 +- dbaccess/source/ui/querydesign/TableWindowData.cxx | 22 +- .../source/ui/querydesign/TableWindowListBox.cxx | 11 +- dbaccess/source/ui/querydesign/querycontroller.cxx | 18 +- dbaccess/source/ui/querydesign/querydlg.cxx | 15 +- .../source/ui/relationdesign/RTableConnection.cxx | 5 +- .../ui/relationdesign/RelationController.cxx | 4 +- .../source/ui/relationdesign/RelationTableView.cxx | 134 ++-- .../source/ui/tabledesign/FieldDescriptions.cxx | 24 +- dbaccess/source/ui/tabledesign/TEditControl.cxx | 32 +- dbaccess/source/ui/tabledesign/TableController.cxx | 40 +- dbaccess/source/ui/uno/unoadmin.cxx | 4 +- dbaccess/util/makefile.mk | 29 +- 96 files changed, 1518 insertions(+), 1977 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx index 2f13990c07e2..df84edac9d52 100644 --- a/dbaccess/inc/genericcontroller.hxx +++ b/dbaccess/inc/genericcontroller.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: genericcontroller.hxx,v $ - * $Revision: 1.13 $ + * $Revision: 1.13.24.2 $ * * This file is part of OpenOffice.org. * @@ -77,7 +77,7 @@ namespace dbaui // ==================================================================== // = optional // ==================================================================== - /** convenience wrapper around boost::optional, allowing type assignments + /** convenience wrapper around boost::optional, allowing typed assignments */ template < typename T > class optional : public ::boost::optional< T > @@ -134,21 +134,20 @@ namespace dbaui // = helper // ==================================================================== - // -------------------------------------------------------------------- // .................................................................... struct ControllerFeature : public ::com::sun::star::frame::DispatchInformation { sal_uInt16 nFeatureId; }; + // .................................................................... typedef ::std::map < ::rtl::OUString , ControllerFeature , ::std::less< ::rtl::OUString > > SupportedFeatures; - /// binary_function Functor object for class SupportedFeatures::value_type returntype is bool // .................................................................... - struct SupportedFeaturesEqualId : ::std::binary_function< SupportedFeatures::value_type, sal_Int32, bool > + struct CompareFeatureById : ::std::binary_function< SupportedFeatures::value_type, sal_Int32, bool > { // ................................................................ inline bool operator()( const SupportedFeatures::value_type& _aType, const sal_Int32& _nId ) const @@ -157,30 +156,29 @@ namespace dbaui } }; - // -------------------------------------------------------------------- // .................................................................... - typedef struct FeatureStruct + struct FeatureListener { ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xListener; sal_Int32 nId; sal_Bool bForceBroadcast; - } FeaturePair; + }; // .................................................................... - typedef ::std::deque< FeaturePair > FeaturePairDeque; + typedef ::std::deque< FeatureListener > FeatureListeners; - /// binary_function Functor object for class FeaturePair returntype is bool // .................................................................... - struct FeaturePairFunctor : ::std::binary_function< FeaturePair, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >, bool > + struct FindFeatureListener : ::std::binary_function< FeatureListener, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >, bool > { // ................................................................ - inline bool operator()( const FeaturePair& lhs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& rhs ) const + inline bool operator()( const FeatureListener& lhs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& rhs ) const { return !!( lhs.xListener == rhs ); } }; + // .................................................................... typedef ::comphelper::OBaseMutex OGenericUnoController_MBASE; typedef ::cppu::WeakComponentImplHelper11 < ::com::sun::star::frame::XDispatch @@ -230,7 +228,7 @@ namespace dbaui DECLARE_STL_MAP( sal_uInt16, FeatureState, ::std::less< sal_uInt16 >, StateCache ); DECLARE_STL_VECTOR( DispatchTarget, Dispatch); - FeaturePairDeque m_aFeaturesToInvalidate; + FeatureListeners m_aFeaturesToInvalidate; ::osl::Mutex m_aFeatureMutex; // locked when features are append to or remove from deque StateCache m_aStateCache; // save the current status of feature state @@ -339,7 +337,13 @@ namespace dbaui @see IController::registerCommandURL */ - bool isUserDefinedFeature( const sal_uInt16 nFeatureId ); + bool isUserDefinedFeature( const sal_uInt16 nFeatureId ) const; + + /** determines whether the given feature URL denotes a user-defined feature + + @see IController::registerCommandURL + */ + bool isUserDefinedFeature( const ::rtl::OUString& _rFeatureURL ) const; // connect to a datasource ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > connect( @@ -383,6 +387,8 @@ namespace dbaui virtual void startFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); virtual void stopFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); + void releaseNumberForComponent(); + virtual ~OGenericUnoController(); private: diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index 800ead748f64..cd20e12ee936 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RowSetBase.hxx,v $ - * $Revision: 1.39 $ + * $Revision: 1.39.68.1 $ * * This file is part of OpenOffice.org. * @@ -93,7 +93,7 @@ #ifndef DBACCESS_ROWSETCACHEITERATOR_HXX #include "RowSetCacheIterator.hxx" #endif - +#include "core_resource.hxx" #include #include @@ -127,6 +127,7 @@ namespace dbaccess public ::comphelper::OPropertyStateContainer, public ::comphelper::OPropertyArrayUsageHelper // this class hold the static property info { + OModuleClient m_aModuleClient; protected: typedef ::std::vector TDataColumns; ::osl::Mutex* m_pMutex; // this the mutex form the rowset itself diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 049ff93805bf..3eddeb562c3f 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: SingleSelectQueryComposer.cxx,v $ - * $Revision: 1.28 $ + * $Revision: 1.28.18.1 $ * * This file is part of OpenOffice.org. * @@ -724,19 +724,19 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr Reference< XResultSetMetaDataSupplier > xResMetaDataSup; try { - xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_QUERY_THROW ) ); - Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW ); - try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( sal_False ) ); } - catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - xResMetaDataSup.set( xStatement->executeQuery( sSql ), UNO_QUERY_THROW ); + xPreparedStatement.set( m_xConnection->prepareStatement( sSql ), UNO_QUERY_THROW ); + xResMetaDataSup.set( xPreparedStatement, UNO_QUERY_THROW ); xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_QUERY_THROW ); } catch( const Exception& ) { } if ( !xResultSetMeta.is() ) { - xPreparedStatement.set( m_xConnection->prepareStatement( sSql ), UNO_QUERY_THROW ); - xResMetaDataSup.set( xPreparedStatement, UNO_QUERY_THROW ); + xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_QUERY_THROW ) ); + Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW ); + try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( sal_False ) ); } + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + xResMetaDataSup.set( xStatement->executeQuery( sSql ), UNO_QUERY_THROW ); xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_QUERY_THROW ); } diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 3255f21a0a50..ed285b26b2cc 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ModelImpl.cxx,v $ - * $Revision: 1.32 $ + * $Revision: 1.32.18.1 $ * * This file is part of OpenOffice.org. * @@ -232,11 +232,22 @@ Reference< XStorage > SAL_CALL DocumentStorageAccess::getDocumentSubStorage( con //-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL DocumentStorageAccess::getDocumentSubStoragesNames( ) throw (IOException, RuntimeException) { - Sequence< ::rtl::OUString > aRet(2); - sal_Int32 nPos = 0; - aRet[nPos++] = m_pModelImplementation->getObjectContainerStorageName( ODatabaseModelImpl::E_FORM ); - aRet[nPos++] = m_pModelImplementation->getObjectContainerStorageName( ODatabaseModelImpl::E_REPORT ); - return aRet; + Reference< XStorage > xRootStor( m_pModelImplementation->getRootStorage() ); + if ( !xRootStor.is() ) + return Sequence< ::rtl::OUString >(); + + ::std::vector< ::rtl::OUString > aNames; + + Reference< XNameAccess > xNames( xRootStor, UNO_QUERY_THROW ); + Sequence< ::rtl::OUString > aElementNames( xNames->getElementNames() ); + for ( sal_Int32 i=0; iisStorageElement( aElementNames[i] ) ) + aNames.push_back( aElementNames[i] ); + } + return aNames.empty() + ? Sequence< ::rtl::OUString >() + : Sequence< ::rtl::OUString >( &aNames[0], aNames.size() ); } //-------------------------------------------------------------------------- diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index e1005fbe3610..f468e0923ca0 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ModelImpl.hxx,v $ - * $Revision: 1.24 $ + * $Revision: 1.24.26.1 $ * * This file is part of OpenOffice.org. * @@ -34,6 +34,7 @@ #include "apitools.hxx" #include "bookmarkcontainer.hxx" #include "ContentHelper.hxx" +#include "core_resource.hxx" /** === begin UNO includes === **/ #include @@ -152,6 +153,7 @@ public: }; private: + OModuleClient m_aModuleClient; ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel; ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDataSource > m_xDataSource; diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 0094a4a496c3..015633dbdd6c 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -40,6 +40,11 @@ #include #include #include +#include +#include + +#include + #include #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_ #include @@ -121,6 +126,8 @@ #include #include +#define MAP_LEN(x) x, sizeof(x) - 1 + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -1025,6 +1032,21 @@ void ODatabaseDocument::writeStorage( const Reference< XStorage >& _rxTargetStor Reference< XStatusIndicator > xStatusIndicator; lcl_extractAndStartStatusIndicator( _rMediaDescriptor, xStatusIndicator, aDelegatorArguments ); + /** property map for export info set */ + comphelper::PropertyMapEntry aExportInfoMap[] = + { + { MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((sal_Bool*)0), beans::PropertyAttribute::MAYBEVOID, 0}, + { MAP_LEN( "StreamName"), 0,&::getCppuType( (::rtl::OUString *)0 ),beans::PropertyAttribute::MAYBEVOID, 0 }, + { NULL, 0, 0, NULL, 0, 0 } + }; + uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) ); + + SvtSaveOptions aSaveOpt; + xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), uno::makeAny(aSaveOpt.IsPrettyPrinting())); + sal_Int32 nArgsLen = aDelegatorArguments.getLength(); + aDelegatorArguments.realloc(nArgsLen+1); + aDelegatorArguments[nArgsLen++] <<= xInfoSet; + Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW ); xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (rtl::OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) ); @@ -1033,9 +1055,11 @@ void ODatabaseDocument::writeStorage( const Reference< XStorage >& _rxTargetStor Sequence< PropertyValue > aMediaDescriptor; _rMediaDescriptor >>= aMediaDescriptor; + xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml")))); WriteThroughComponent( xComponent, "settings.xml", "com.sun.star.comp.sdb.XMLSettingsExporter", aDelegatorArguments, aMediaDescriptor, _rxTargetStorage ); + xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")))); WriteThroughComponent( xComponent, "content.xml", "com.sun.star.comp.sdb.DBExportFilter", aDelegatorArguments, aMediaDescriptor, _rxTargetStorage ); diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 242b320d78ea..c3cec1ca6eef 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: documentdefinition.cxx,v $ - * $Revision: 1.65 $ + * $Revision: 1.64.20.2 $ * * This file is part of OpenOffice.org. * @@ -1605,7 +1605,8 @@ Sequence< PropertyValue > ODocumentDefinition::fillLoadArgs( const Reference< XC aMediaDesc.put( "ComponentData", aComponentData.getPropertyValues() ); } - aMediaDesc.put( "DocumentTitle", m_pImpl->m_aProps.aTitle ); + if ( m_pImpl->m_aProps.aTitle.getLength() ) + aMediaDesc.put( "DocumentTitle", m_pImpl->m_aProps.aTitle ); // ......................................................................... // put the common load arguments into the document's media descriptor diff --git a/dbaccess/source/core/inc/core_resource.hrc b/dbaccess/source/core/inc/core_resource.hrc index e50889573ec9..e129dc1a66d2 100644 --- a/dbaccess/source/core/inc/core_resource.hrc +++ b/dbaccess/source/core/inc/core_resource.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: core_resource.hrc,v $ - * $Revision: 1.17 $ + * $Revision: 1.16.68.2 $ * * This file is part of OpenOffice.org. * @@ -37,6 +37,7 @@ //------------------------------------------------------------------------------ #define RID_CORE_STRINGS_START RID_DBACCESS_START +#define RID_CORE_OTHER_START RID_DBACCESS_START //------------------------------------------------------------------------------ //- String-IDs @@ -88,5 +89,8 @@ #define RID_STR_NAME_NOT_FOUND ( RID_CORE_STRINGS_START + 45 ) #define RID_STR_QUERY_DOES_NOT_EXIST ( RID_CORE_STRINGS_START + 46 ) +#define RSC_DATASOURCE_TYPES ( RID_CORE_OTHER_START + 1 ) +#define RSC_DATASOURCE_TYPE_UINAMES ( RID_CORE_OTHER_START + 2 ) + #endif // _DBA_CORE_RESOURCE_HRC_ diff --git a/dbaccess/source/core/inc/core_resource.hxx b/dbaccess/source/core/inc/core_resource.hxx index 5c9bba533c3c..8b660c044ada 100644 --- a/dbaccess/source/core/inc/core_resource.hxx +++ b/dbaccess/source/core/inc/core_resource.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: core_resource.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.68.2 $ * * This file is part of OpenOffice.org. * @@ -34,8 +34,9 @@ #ifndef _RTL_USTRING_HXX_ #include #endif +#include -class SimpleResMgr; +class ResMgr; //......................................................................... namespace dbaccess { @@ -52,25 +53,22 @@ namespace dbaccess //================================================================== class ResourceManager { - static SimpleResMgr* m_pImpl; + friend class OModuleClient; + static ::osl::Mutex s_aMutex; /// access safety + static sal_Int32 s_nClients; /// number of registered clients + static ResMgr* m_pImpl; private: // no instantiation allowed ResourceManager() { } ~ResourceManager() { } - // we'll instantiate one static member of the following class, which, in it's dtor, - // ensures that m_pImpl will be deleted - class EnsureDelete - { - public: - EnsureDelete() { } - ~EnsureDelete(); - }; - friend class EnsureDelete; - protected: static void ensureImplExists(); + /// register a client for the module + static void registerClient(); + /// revoke a client for the module + static void revokeClient(); public: /** loads the string with the specified resource id @@ -91,8 +89,23 @@ namespace dbaccess const sal_Char* _pPlaceholderAscii, const ::rtl::OUString& _rReplace ); + + static ResMgr* getResManager(); }; + //========================================================================= + //= OModuleClient + //========================================================================= + /** base class for objects which uses any global module-specific ressources + */ + class OModuleClient + { + public: + OModuleClient() { ResourceManager::registerClient(); } + ~OModuleClient() { ResourceManager::revokeClient(); } + }; + + //......................................................................... } //......................................................................... diff --git a/dbaccess/source/core/misc/ContainerMediator.cxx b/dbaccess/source/core/misc/ContainerMediator.cxx index 96434b74b774..30c27963105b 100644 --- a/dbaccess/source/core/misc/ContainerMediator.cxx +++ b/dbaccess/source/core/misc/ContainerMediator.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ContainerMediator.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.42.1 $ * * This file is part of OpenOffice.org. * @@ -166,7 +166,7 @@ void SAL_CALL OContainerMediator::elementRemoved( const ContainerEvent& _rEvent m_aForwardList.erase(sElementName); try { - Reference xNameContainer( m_xSettings, UNO_QUERY_THROW ); + Reference xNameContainer( m_xSettings, UNO_QUERY ); if ( xNameContainer.is() && m_xSettings->hasByName( sElementName ) ) xNameContainer->removeByName( sElementName ); } diff --git a/dbaccess/source/core/misc/makefile.mk b/dbaccess/source/core/misc/makefile.mk index bb5e21181df0..b274e11f0617 100644 --- a/dbaccess/source/core/misc/makefile.mk +++ b/dbaccess/source/core/misc/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.19 $ +# $Revision: 1.19.68.1 $ # # This file is part of OpenOffice.org. # @@ -39,6 +39,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/makefile.pmk # --- Files ------------------------------------- @@ -53,6 +54,7 @@ SLOFILES= \ $(SLO)$/warnings.obj \ $(SLO)$/DatabaseDataProvider.obj \ $(SLO)$/module_dba.obj \ + $(SLO)$/dsntypes.obj \ $(SLO)$/veto.obj # --- Targets ---------------------------------- diff --git a/dbaccess/source/core/misc/services.cxx b/dbaccess/source/core/misc/services.cxx index 7c57da9b9868..a83217b1f18e 100644 --- a/dbaccess/source/core/misc/services.cxx +++ b/dbaccess/source/core/misc/services.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: services.cxx,v $ - * $Revision: 1.18 $ + * $Revision: 1.18.68.1 $ * * This file is part of OpenOffice.org. * @@ -36,6 +36,7 @@ #include "module_dba.hxx" #include #include "DatabaseDataProvider.hxx" +#include "dbaccessdllapi.h" /********************************************************************************************/ @@ -54,7 +55,7 @@ extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument(); extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource(); extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory(); -namespace { +namespace dba{ //-------------------------------------------------------------------------- ::cppu::ImplementationEntry entries[] = { { &::dbaccess::DatabaseDataProvider::Create, &::dbaccess::DatabaseDataProvider::getImplementationName_Static, &::dbaccess::DatabaseDataProvider::getSupportedServiceNames_Static, @@ -86,7 +87,7 @@ extern "C" void SAL_CALL createRegistryInfo_DBA() //--------------------------------------------------------------------------------------- -extern "C" void SAL_CALL component_getImplementationEnvironment( +extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment ** ) @@ -96,7 +97,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( +extern "C" DBACCESS_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) @@ -107,7 +108,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( return ::dba::DbaModule::getInstance().writeComponentInfos( static_cast< XMultiServiceFactory* >( pServiceManager ), static_cast< XRegistryKey* >( pRegistryKey ) ) - && cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, entries); + && cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, dba::entries); } catch (InvalidRegistryException& ) { @@ -118,7 +119,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( } //--------------------------------------------------------------------------------------- -extern "C" void* SAL_CALL component_getFactory( +extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey) @@ -135,6 +136,6 @@ extern "C" void* SAL_CALL component_getFactory( xRet->acquire(); else return cppu::component_getFactoryHelper( - pImplementationName, pServiceManager, pRegistryKey, entries); + pImplementationName, pServiceManager, pRegistryKey, dba::entries); return xRet.get(); }; diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx index 0a96c0de821c..9783afae4bf8 100644 --- a/dbaccess/source/core/resource/core_resource.cxx +++ b/dbaccess/source/core/resource/core_resource.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: core_resource.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.68.2 $ * * This file is part of OpenOffice.org. * @@ -33,9 +33,7 @@ #include "core_resource.hxx" -#ifndef _TOOLS_SIMPLERESMGR_HXX_ -#include -#endif +#include // ---- needed as long as we have no contexts for components --- #ifndef _SV_SVAPP_HXX @@ -54,13 +52,9 @@ namespace dbaccess //================================================================== //= ResourceManager //================================================================== - SimpleResMgr* ResourceManager::m_pImpl = NULL; - - //------------------------------------------------------------------ - ResourceManager::EnsureDelete::~EnsureDelete() - { - delete ResourceManager::m_pImpl; - } + ::osl::Mutex ResourceManager::s_aMutex; + sal_Int32 ResourceManager::s_nClients = 0; + ResMgr* ResourceManager::m_pImpl = NULL; //------------------------------------------------------------------ void ResourceManager::ensureImplExists() @@ -72,13 +66,7 @@ namespace dbaccess ByteString sFileName("dba"); - m_pImpl = SimpleResMgr::Create(sFileName.GetBuffer(), aLocale); - - if (m_pImpl) - { - // now that we have an impl class make sure it's deleted on unloading the library - static ResourceManager::EnsureDelete s_aDeleteTheImplClass; - } + m_pImpl = ResMgr::CreateResMgr(sFileName.GetBuffer(), aLocale); } //------------------------------------------------------------------ @@ -88,7 +76,7 @@ namespace dbaccess ensureImplExists(); if (m_pImpl) - sReturn = m_pImpl->ReadString(_nResId); + sReturn = String(ResId(_nResId,*m_pImpl)); return sReturn; } @@ -100,6 +88,28 @@ namespace dbaccess sString.SearchAndReplaceAscii( _pPlaceholderAscii, _rReplace ); return sString; } + //------------------------------------------------------------------------- + void ResourceManager::registerClient() + { + ::osl::MutexGuard aGuard(s_aMutex); + ++s_nClients; + } + + //------------------------------------------------------------------------- + void ResourceManager::revokeClient() + { + ::osl::MutexGuard aGuard(s_aMutex); + if (!--s_nClients && m_pImpl) + { + delete m_pImpl; + m_pImpl = NULL; + } + } + ResMgr* ResourceManager::getResManager() + { + ensureImplExists(); + return m_pImpl; + } //......................................................................... } diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src index 05fe3d84b81a..ae81cd48ff03 100644 --- a/dbaccess/source/core/resource/strings.src +++ b/dbaccess/source/core/resource/strings.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: strings.src,v $ - * $Revision: 1.56 $ + * $Revision: 1.55.68.2 $ * * This file is part of OpenOffice.org. * @@ -29,6 +29,7 @@ ************************************************************************/ #include "core_resource.hrc" +#include "dbamiscres.hrc" String RID_STR_TRIED_OPEN_TABLE { @@ -239,3 +240,204 @@ String RID_STR_NAME_NOT_FOUND Text [ en-US ] = "Unable to find the document '$name$'."; }; +//------------------------------------------------------------------------- +Resource RSC_DATASOURCE_TYPES +{ + String STR_MYSQL_ODBC + { + Text ="sdbc:mysql:odbc:"; + }; + String STR_MYSQL_JDBC + { + Text ="sdbc:mysql:jdbc:"; + }; + String STR_ADABAS + { + Text ="sdbc:adabas:"; + }; + String STR_ORACLE_JDBC + { + Text ="jdbc:oracle:thin:"; + }; + String STR_JDBC + { + Text ="jdbc:"; + }; + String STR_ODBC + { + Text ="sdbc:odbc:"; + }; + String STR_DBASE + { + Text ="sdbc:dbase:"; + }; + String STR_MSACCESS + { + Text ="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="; + }; + String STR_MSACCESS2007 + { + Text ="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="; + }; + String STR_ADO + { + Text ="sdbc:ado:"; + }; + String STR_FLAT + { + Text ="sdbc:flat:"; + }; + String STR_CALC + { + Text ="sdbc:calc:"; + }; + String STR_MOZILLA + { + Text ="sdbc:address:mozilla:"; + }; + String STR_LDAP + { + Text ="sdbc:address:ldap:"; + }; + String STR_OUTLOOK + { + Text ="sdbc:address:outlook"; + }; + String STR_OUTLOOKEXP + { + Text ="sdbc:address:outlookexp"; + }; + String STR_EVOLUTION + { + Text ="sdbc:address:evolution:local"; + }; + String STR_EVOLUTION_GROUPWISE + { + Text ="sdbc:address:evolution:groupwise"; + }; + String STR_EVOLUTION_LDAP + { + Text ="sdbc:address:evolution:ldap"; + }; + String STR_KAB + { + Text ="sdbc:address:kab"; + }; + String STR_EMBEDDED_HSQLDB + { + Text = "sdbc:embedded:hsqldb"; + }; + String STR_MACAB + { + Text ="sdbc:address:macab"; + }; + String STR_THUNDERBIRD + { + Text ="sdbc:address:thunderbird:"; + }; + String STR_MYSQL_NATIVE + { + Text ="sdbc:mysqlc:"; + }; +}; + +Resource RSC_DATASOURCE_TYPE_UINAMES +{ + String STR_MYSQL_ODBC + { + Text[ en-US ] = "MySQL (ODBC)"; + }; + String STR_MYSQL_JDBC + { + Text[ en-US ] = "MySQL (JDBC)"; + }; + String STR_ADABAS + { + Text[ en-US ] = "Adabas D"; + }; + String STR_ORACLE_JDBC + { + Text[ en-US ] = "Oracle JDBC"; + }; + + String STR_JDBC + { + Text[ en-US ] = "JDBC"; + }; + String STR_ODBC + { + Text[ en-US ] = "ODBC"; + }; + String STR_DBASE + { + Text[ en-US ] = "dBASE"; + }; + String STR_MSACCESS + { + Text[ en-US ] = "Microsoft Access"; + }; + String STR_MSACCESS2007 + { + Text[ en-US ] = "Microsoft Access 2007"; + }; + String STR_ADO + { + Text[ en-US ] = "ADO"; + }; + String STR_FLAT + { + Text[ en-US ] = "Text"; + }; + String STR_CALC + { + Text[ en-US ] = "Spreadsheet"; + }; + String STR_MOZILLA + { + Text[ en-US ] = "Mozilla Address Book"; + }; + String STR_LDAP + { + Text[ en-US ] = "LDAP Address Book"; + }; + String STR_OUTLOOK + { + Text[ en-US ] = "Microsoft Outlook Address Book"; + }; + String STR_OUTLOOKEXP + { + Text[ en-US ] = "Microsoft Windows Address Book"; + }; + String STR_EVOLUTION + { + Text[ en-US ] = "Evolution Local"; + }; + String STR_EVOLUTION_GROUPWISE + { + Text[ en-US ] = "Groupwise"; + }; + String STR_EVOLUTION_LDAP + { + Text[ en-US ] = "Evolution LDAP"; + }; + String STR_KAB + { + Text[ en-US ] = "KDE Address Book"; + }; + String STR_MACAB + { + Text[ en-US ] = "Mac OS X Address Book"; + }; + String STR_EMBEDDED_HSQLDB + { + Text[ en-US ] = "HSQL database engine"; + }; + String STR_THUNDERBIRD + { + Text[ en-US ] = "Thunderbird Address Book"; + }; + String STR_MYSQL_NATIVE + { + Text[ en-US ] = "MySQL (Native)"; + }; +}; diff --git a/dbaccess/source/filter/xml/makefile.mk b/dbaccess/source/filter/xml/makefile.mk index e6c3814028a0..6eb3f1f47094 100644 --- a/dbaccess/source/filter/xml/makefile.mk +++ b/dbaccess/source/filter/xml/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.10 $ +# $Revision: 1.10.68.1 $ # # This file is part of OpenOffice.org. # @@ -97,10 +97,10 @@ SHL1STDLIBS=\ .IF "$(GUI)"!="WNT" || "$(COM)"=="GCC" SHL1STDLIBS+= \ - -ldbu$(DLLPOSTFIX) + -ldba$(DLLPOSTFIX) .ELSE SHL1STDLIBS+= \ - idbu.lib + idba.lib .ENDIF diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 614334c7b5a4..4441d77a2acd 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlExport.cxx,v $ - * $Revision: 1.22 $ + * $Revision: 1.22.18.1 $ * * This file is part of OpenOffice.org. * @@ -611,7 +611,7 @@ void ODBExport::exportConnectionData() ::rtl::OUString sValue; Reference xProp(getDataSource()); xProp->getPropertyValue(PROPERTY_URL) >>= sValue; - const dbaui::DATASOURCE_TYPE eType = m_aTypeCollection.getType(sValue); + const ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(sValue); if ( m_aTypeCollection.isFileSystemBased(eType) ) { SvXMLElementExport aDatabaseDescription(*this,XML_NAMESPACE_DB, XML_DATABASE_DESCRIPTION, sal_True, sal_True); @@ -621,7 +621,7 @@ void ODBExport::exportConnectionData() try { ::rtl::OUString sExtension; - if ( eType == dbaui::DST_MSACCESS ) + if ( eType == dbaccess::DST_MSACCESS ) sExtension = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("mdb")); else { diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx index 5e2e2445e6d9..26419b6f4e59 100644 --- a/dbaccess/source/filter/xml/xmlExport.hxx +++ b/dbaccess/source/filter/xml/xmlExport.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlExport.hxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.34.1 $ * * This file is part of OpenOffice.org. * @@ -151,7 +151,7 @@ class ODBExport : public SvXMLExport mutable UniReference < XMLPropertySetMapper > m_xRowStylesPropertySetMapper; Reference m_xDataSource; - ::dbaui::ODsnTypeCollection m_aTypeCollection; + ::dbaccess::ODsnTypeCollection m_aTypeCollection; sal_Bool m_bAllreadyFilled; void exportDataSource(); diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx index ccbdf3a94537..2a8e075ce93c 100644 --- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: xmlFileBasedDatabase.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.68.1 $ * * This file is part of OpenOffice.org. * @@ -114,7 +114,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport, } if ( sLocation.getLength() && sMediaType.getLength() ) { - ::rtl::OUString sURL(dbaui::ODsnTypeCollection::getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension)); + ::rtl::OUString sURL(dbaccess::ODsnTypeCollection::getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension)); sURL += sLocation; try { diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx index 575ac572a397..0651c0d5babc 100644 --- a/dbaccess/source/inc/dsntypes.hxx +++ b/dbaccess/source/inc/dsntypes.hxx @@ -8,7 +8,7 @@ * * $RCSfile: dsntypes.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.68.4 $ * * This file is part of OpenOffice.org. * @@ -29,18 +29,17 @@ * ************************************************************************/ -#ifndef _DBAUI_DSNTYPES_HXX_ -#define _DBAUI_DSNTYPES_HXX_ +#ifndef _DBACCESS_DSNTYPES_HXX_ +#define _DBACCESS_DSNTYPES_HXX_ #include -#include - #include #include "dbaccessdllapi.h" +#include //......................................................................... -namespace dbaui +namespace dbaccess { //......................................................................... @@ -148,6 +147,9 @@ public: /// check if the given data source tyoe is based on the file system - i.e. the URL is a prefix plus a file URL sal_Bool isFileSystemBased(DATASOURCE_TYPE _eType) const; + /// checks if the given data source type embeds its data into the database document + bool isEmbeddedDatabase( DATASOURCE_TYPE _eType ) const; + /** returns default settings for newly created databases of the given type. Currently implemented (and used) for DST_EMBEDDED_HSQLDB only @@ -177,12 +179,12 @@ protected: //------------------------------------------------------------------------- //- ODsnTypeCollection::TypeIterator //------------------------------------------------------------------------- -class ODsnTypeCollection::TypeIterator +class DBACCESS_DLLPUBLIC ODsnTypeCollection::TypeIterator { friend class ODsnTypeCollection; - friend bool operator==(const TypeIterator& lhs, const TypeIterator& rhs); - friend bool operator!=(const TypeIterator& lhs, const TypeIterator& rhs) { return !(lhs == rhs); } + friend bool DBACCESS_DLLPUBLIC operator==(const TypeIterator& lhs, const TypeIterator& rhs); + friend bool DBACCESS_DLLPUBLIC operator!=(const TypeIterator& lhs, const TypeIterator& rhs) { return !(lhs == rhs); } protected: const ODsnTypeCollection* m_pContainer; @@ -209,30 +211,9 @@ protected: TypeIterator(const ODsnTypeCollection* _pContainer, sal_Int32 _nInitialPos = 0); }; -//========================================================================= -//= DbuTypeCollectionItem -//========================================================================= -/** allows an ODsnTypeCollection to be transported in an SfxItemSet -*/ -class DbuTypeCollectionItem : public SfxPoolItem -{ - ODsnTypeCollection* m_pCollection; - -public: - TYPEINFO(); - DbuTypeCollectionItem(sal_Int16 nWhich = 0, ODsnTypeCollection* _pCollection = NULL); - DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource); - - virtual int operator==(const SfxPoolItem& _rItem) const; - virtual SfxPoolItem* Clone(SfxItemPool* _pPool = NULL) const; - - ODsnTypeCollection* getCollection() const { return m_pCollection; } -}; - - //......................................................................... -} // namespace dbaui +} // namespace dbaccess //......................................................................... -#endif // _DBAUI_DSNTYPES_HXX_ +#endif // _DBACCESS_DSNTYPES_HXX_ diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 24b4cb6d803c..398ead3525ca 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppController.cxx,v $ - * $Revision: 1.65 $ + * $Revision: 1.63.20.5 $ * * This file is part of OpenOffice.org. * @@ -938,8 +938,8 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const break; case SID_DB_APP_DSUSERADMIN: { - DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType; + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); + aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType; } break; case SID_DB_APP_DSRELDESIGN: @@ -955,23 +955,23 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType && DST_MOZILLA != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_MACAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); + aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType && ::dbaccess::DST_MOZILLA != eType && ::dbaccess::DST_EVOLUTION != eType && ::dbaccess::DST_KAB != eType && ::dbaccess::DST_MACAB != eType && ::dbaccess::DST_OUTLOOK != eType && ::dbaccess::DST_OUTLOOKEXP != eType; } break; case SID_DB_APP_DSCONNECTION_TYPE: aReturn.bEnabled = !isDataSourceReadOnly() && m_xDataSource.is(); if ( aReturn.bEnabled ) { - DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - aReturn.bEnabled = DST_EMBEDDED_HSQLDB != eType; + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); + aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType; } break; case SID_DB_APP_DSADVANCED_SETTINGS: aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - DATASOURCE_TYPE eType = m_aTypeCollection.getType( ::comphelper::getString( m_xDataSource->getPropertyValue( PROPERTY_URL ) ) ); + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType( ::comphelper::getString( m_xDataSource->getPropertyValue( PROPERTY_URL ) ) ); aReturn.bEnabled = AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( eType ); } break; @@ -1023,8 +1023,16 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_xDataSource.is(); if ( aReturn.bEnabled ) { - DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); - ::rtl::OUString sDSTypeName = m_aTypeCollection.getTypeDisplayName(eType); + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); + ::rtl::OUString sDSTypeName; + if ( m_aTypeCollection.isEmbeddedDatabase( eType ) ) + { + sDSTypeName = String( ModuleRes( RID_STR_EMBEDDED_DATABASE ) ); + } + else + { + sDSTypeName = m_aTypeCollection.getTypeDisplayName(eType); + } aReturn.sTitle = sDSTypeName; } break; @@ -1034,7 +1042,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const { ::rtl::OUString sURL; m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sURL; - DATASOURCE_TYPE eType = m_aTypeCollection.getType( sURL ); + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType( sURL ); String sDatabaseName; String sHostName; @@ -3032,7 +3040,9 @@ Any SAL_CALL OApplicationController::getSelection( ) throw (RuntimeException) ::osl::MutexGuard aGuard(m_aMutex); Sequence< NamedDatabaseObject > aCurrentSelection; - getContainer()->describeCurrentSelectionForType( getContainer()->getElementType(), aCurrentSelection ); + const ElementType eType( getContainer()->getElementType() ); + if ( eType != E_NONE ) + getContainer()->describeCurrentSelectionForType( eType, aCurrentSelection ); return makeAny( aCurrentSelection ); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index c4931de4c1d0..07be5b0bd4e1 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppController.hxx,v $ - * $Revision: 1.32 $ + * $Revision: 1.30.20.2 $ * * This file is part of OpenOffice.org. * @@ -132,7 +132,8 @@ namespace dbaui TContainerVector m_aCurrentContainers; // the containers where we are listener on TDocuments m_aDocuments; TFrames m_aSpecialSubFrames; // contains the query, table and relation frame - ODsnTypeCollection m_aTypeCollection; + ::dbaccess::ODsnTypeCollection + m_aTypeCollection; OTableCopyHelper m_aTableCopyHelper; TransferableClipboardListener* m_pClipbordNotifier; // notifier for changes in the clipboard diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 464953ad5aeb..2f0bd0b55877 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppDetailPageHelper.cxx,v $ - * $Revision: 1.33 $ + * $Revision: 1.33.24.1 $ * * This file is part of OpenOffice.org. * @@ -473,7 +473,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForControl( const Control& _r void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects ) { OSL_ENSURE( _eType < E_ELEMENT_TYPE_COUNT, "OAppDetailPageHelper::describeCurrentSelectionForType: invalid type!" ); - DBTreeListBox* pList = m_pLists[ _eType ]; + DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ] : NULL; OSL_ENSURE( pList, "OAppDetailPageHelper::describeCurrentSelectionForType: " "You really should ensure this type has already been viewed before!" ); if ( !pList ) diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index 86d5fc9a1df0..4a2387f67585 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: app.src,v $ - * $Revision: 1.17 $ + * $Revision: 1.17.68.1 $ * * This file is part of OpenOffice.org. * @@ -465,3 +465,8 @@ String STR_SUB_DOCS_WITH_SCRIPTS_DETAIL "Note that you won't be able to embed macros or scripts into the database document until " "this migration is done. "; }; + +String RID_STR_EMBEDDED_DATABASE +{ + Text [ en-US ] = "Embedded database"; +}; diff --git a/dbaccess/source/ui/app/dbu_app.hrc b/dbaccess/source/ui/app/dbu_app.hrc index 27d97df06fe1..63aa923ce30f 100644 --- a/dbaccess/source/ui/app/dbu_app.hrc +++ b/dbaccess/source/ui/app/dbu_app.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbu_app.hrc,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.68.1 $ * * This file is part of OpenOffice.org. * @@ -67,11 +67,12 @@ #define RID_STR_TABLES_HELP_TEXT_WIZARD RID_STR_APP_START + 28 #define RID_STR_FORMS_HELP_TEXT_WIZARD RID_STR_APP_START + 29 #define RID_STR_REPORT_HELP_TEXT RID_STR_APP_START + 30 +#define RID_STR_EMBEDDED_DATABASE RID_STR_APP_START + 31 // please adjust checking before insert new strings -#if RID_STR_REPORT_HELP_TEXT > RID_STR_APP_END +#if RID_STR_EMBEDDED_DATABASE > RID_STR_APP_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 7d818a0e674b..108a8b258b6e 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: genericcontroller.cxx,v $ - * $Revision: 1.94 $ + * $Revision: 1.94.24.2 $ * * This file is part of OpenOffice.org. * @@ -169,15 +169,77 @@ const ::rtl::OUString& getConfirmDeletionURL() namespace dbaui { +//========================================================================== +//= UserDefinedFeatures +//========================================================================== +class UserDefinedFeatures +{ +public: + UserDefinedFeatures( const Reference< XController >& _rxController ); + + FeatureState getState( const URL& _rFeatureURL ); + void execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs ); + +private: + ::com::sun::star::uno::WeakReference< XController > m_aController; +}; + +//-------------------------------------------------------------------------- +UserDefinedFeatures::UserDefinedFeatures( const Reference< XController >& _rxController ) + :m_aController( _rxController ) +{ +} + +//-------------------------------------------------------------------------- +FeatureState UserDefinedFeatures::getState( const URL& /*_rFeatureURL*/ ) +{ + // for now, enable all the time + // TODO: we should ask the dispatcher. However, this is laborious, since you cannot ask a dispatcher + // directly, but need to add a status listener. + FeatureState aState; + aState.bEnabled = sal_True; + return aState; +} + +//-------------------------------------------------------------------------- +void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< PropertyValue>& _rArgs ) +{ + try + { + Reference< XController > xController( (Reference< XController >)m_aController, UNO_SET_THROW ); + Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW ); + Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch( + _rFeatureURL, + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), + FrameSearchFlag::AUTO + ) ); + + if ( xDispatch == xController ) + { + OSL_ENSURE( false, "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" ); + xDispatch.clear(); + } + + if ( xDispatch.is() ) + xDispatch->dispatch( _rFeatureURL, _rArgs ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + //========================================================================== //= OGenericUnoController_Data //========================================================================== struct OGenericUnoController_Data { ::sfx2::UserInputInterception m_aUserInputInterception; + UserDefinedFeatures m_aUserDefinedFeatures; OGenericUnoController_Data( OGenericUnoController& _rController, ::osl::Mutex& _rMutex ) :m_aUserInputInterception( _rController, _rMutex ) + ,m_aUserDefinedFeatures( _rController.getXController() ) { } }; @@ -189,7 +251,6 @@ DBG_NAME(OGenericUnoController) // ------------------------------------------------------------------------- OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFactory >& _rM) :OGenericUnoController_Base(m_aMutex) - ,m_pData( new OGenericUnoController_Data( *this, m_aMutex ) ) #ifdef DBG_UTIL ,m_bDescribingSupportedFeatures( false ) #endif @@ -203,6 +264,12 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto ,m_bCurrentlyModified(sal_False) ,m_bExternalTitle(sal_False) { + osl_incrementInterlockedCount( &m_refCount ); + { + m_pData.reset( new OGenericUnoController_Data( *this, m_aMutex ) ); + } + osl_decrementInterlockedCount( &m_refCount ); + DBG_CTOR(OGenericUnoController,NULL); try @@ -218,7 +285,6 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto // ----------------------------------------------------------------------------- OGenericUnoController::OGenericUnoController() :OGenericUnoController_Base(m_aMutex) - ,m_pData( new OGenericUnoController_Data( *this, m_aMutex ) ) #ifdef DBG_UTIL ,m_bDescribingSupportedFeatures( false ) #endif @@ -559,7 +625,7 @@ sal_Bool OGenericUnoController::isFeatureSupported( sal_Int32 _nId ) SupportedFeatures::iterator aFeaturePos = ::std::find_if( m_aSupportedFeatures.begin(), m_aSupportedFeatures.end(), - ::std::bind2nd( SupportedFeaturesEqualId(), _nId ) + ::std::bind2nd( CompareFeatureById(), _nId ) ); return ( m_aSupportedFeatures.end() != aFeaturePos && aFeaturePos->first.getLength()); @@ -580,7 +646,7 @@ void OGenericUnoController::InvalidateFeature_Impl() #endif sal_Bool bEmpty = sal_True; - FeaturePair aNextFeature; + FeatureListener aNextFeature; { ::osl::MutexGuard aGuard( m_aFeatureMutex); bEmpty = m_aFeaturesToInvalidate.empty(); @@ -599,7 +665,7 @@ void OGenericUnoController::InvalidateFeature_Impl() SupportedFeatures::iterator aFeaturePos = ::std::find_if( m_aSupportedFeatures.begin(), m_aSupportedFeatures.end(), - ::std::bind2nd( SupportedFeaturesEqualId(), aNextFeature.nId ) + ::std::bind2nd( CompareFeatureById(), aNextFeature.nId ) ); #if OSL_DEBUG_LEVEL > 0 @@ -631,16 +697,16 @@ void OGenericUnoController::InvalidateFeature_Impl() // ----------------------------------------------------------------------- void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast ) { - FeaturePair aPair; - aPair.nId = _nId; - aPair.xListener = _xListener; - aPair.bForceBroadcast = _bForceBroadcast; + FeatureListener aListener; + aListener.nId = _nId; + aListener.xListener = _xListener; + aListener.bForceBroadcast = _bForceBroadcast; sal_Bool bWasEmpty; { - ::osl::MutexGuard aGuard( m_aFeatureMutex); + ::osl::MutexGuard aGuard( m_aFeatureMutex ); bWasEmpty = m_aFeaturesToInvalidate.empty(); - m_aFeaturesToInvalidate.push_back(aPair); + m_aFeaturesToInvalidate.push_back( aListener ); } if ( bWasEmpty ) @@ -691,7 +757,9 @@ Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, co // URL's we can handle ourself? if ( aURL.Complete.equals( getConfirmDeletionURL() ) - || ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() ) + || ( ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() ) + && !isUserDefinedFeature( aURL.Complete ) + ) ) { xReturn = this; @@ -825,15 +893,27 @@ void OGenericUnoController::removeStatusListener(const Reference< XStatusListene } // now remove the listener from the deque - ::osl::MutexGuard aGuard( m_aFeatureMutex); + ::osl::MutexGuard aGuard( m_aFeatureMutex ); m_aFeaturesToInvalidate.erase( ::std::remove_if( m_aFeaturesToInvalidate.begin(), m_aFeaturesToInvalidate.end(), - ::std::bind2nd(FeaturePairFunctor(),aListener)) + ::std::bind2nd(FindFeatureListener(),aListener)) ,m_aFeaturesToInvalidate.end()); } - - +// ----------------------------------------------------------------------------- +void OGenericUnoController::releaseNumberForComponent() +{ + try + { + Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY ); + if ( xUntitledProvider.is() ) + xUntitledProvider->releaseNumberForComponent(static_cast(this)); + } + catch( const Exception& ) + { + // NII + } +} // ----------------------------------------------------------------------- void OGenericUnoController::disposing() { @@ -856,16 +936,7 @@ void OGenericUnoController::disposing() m_aFeaturesToInvalidate.clear(); } - try - { - Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY ); - if ( xUntitledProvider.is() ) - xUntitledProvider->releaseNumberForComponent(static_cast(this)); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + releaseNumberForComponent(); // check out from all the objects we are listening // the frame @@ -932,24 +1003,20 @@ void OGenericUnoController::describeSupportedFeatures() } //------------------------------------------------------------------------------ -FeatureState OGenericUnoController::GetState(sal_uInt16 nId) const +FeatureState OGenericUnoController::GetState( sal_uInt16 _nId ) const { FeatureState aReturn; // (disabled automatically) - try - { - switch (nId) - { - case ID_BROWSER_UNDO: - case ID_BROWSER_SAVEDOC: - aReturn.bEnabled = sal_True; - break; - } - } - catch( const Exception& ) + switch ( _nId ) { - DBG_UNHANDLED_EXCEPTION(); + case ID_BROWSER_UNDO: + case ID_BROWSER_SAVEDOC: + aReturn.bEnabled = sal_True; + break; + default: + aReturn = m_pData->m_aUserDefinedFeatures.getState( getURLForId( _nId ) ); + break; } return aReturn; @@ -960,27 +1027,10 @@ void OGenericUnoController::Execute( sal_uInt16 _nId, const Sequence< PropertyVa { OSL_ENSURE( isUserDefinedFeature( _nId ), "OGenericUnoController::Execute: responsible for user defined features only!" ); - URL aFeatureURL( getURLForId( _nId ) ); - - // user defined features can be handled by dispatch interceptors only. So, we need to do - // a queryDispatch, and dispatch the URL - try - { - Reference< XDispatch > xDispatch( queryDispatch( - aFeatureURL, - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ), - FrameSearchFlag::AUTO - ) ); - if ( xDispatch == *this ) - xDispatch.clear(); - if ( xDispatch.is() ) - xDispatch->dispatch( aFeatureURL, _rArgs ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + // user defined features can be handled by dispatch interceptors resp. protocol handlers only. + // So, we need to do a queryDispatch, and dispatch the URL + m_pData->m_aUserDefinedFeatures.execute( getURLForId( _nId ), _rArgs ); } //------------------------------------------------------------------------------ @@ -992,7 +1042,7 @@ URL OGenericUnoController::getURLForId(sal_Int32 _nId) const SupportedFeatures::const_iterator aIter = ::std::find_if( m_aSupportedFeatures.begin(), m_aSupportedFeatures.end(), - ::std::bind2nd( SupportedFeaturesEqualId(), _nId ) + ::std::bind2nd( CompareFeatureById(), _nId ) ); if ( m_aSupportedFeatures.end() != aIter && aIter->first.getLength() ) @@ -1005,11 +1055,21 @@ URL OGenericUnoController::getURLForId(sal_Int32 _nId) const } //------------------------------------------------------------------------- -bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId ) +bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId ) const { return ( _nFeatureId >= FIRST_USER_DEFINED_FEATURE ) && ( _nFeatureId < LAST_USER_DEFINED_FEATURE ); } +//------------------------------------------------------------------------- +bool OGenericUnoController::isUserDefinedFeature( const ::rtl::OUString& _rFeatureURL ) const +{ + SupportedFeatures::const_iterator pos = m_aSupportedFeatures.find( _rFeatureURL ); + OSL_PRECOND( pos != m_aSupportedFeatures.end(), + "OGenericUnoController::isUserDefinedFeature: this is no supported feature at all!" ); + + return ( pos != m_aSupportedFeatures.end() ) ? isUserDefinedFeature( pos->second.nFeatureId ) : false; +} + //------------------------------------------------------------------------- sal_Bool SAL_CALL OGenericUnoController::supportsService(const ::rtl::OUString& ServiceName) throw(RuntimeException) { diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 5e0c768d4374..e2e02c6ab9df 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: unodatbr.cxx,v $ - * $Revision: 1.203 $ + * $Revision: 1.203.8.2 $ * * This file is part of OpenOffice.org. * @@ -846,6 +846,8 @@ sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeExceptio throw DisposedException( ::rtl::OUString(), *this ); bRet = SbaXDataBrowserController::suspend(bSuspend); + if ( bRet && getView() ) + getView()->Hide(); m_bInSuspend = sal_False; } @@ -2291,6 +2293,9 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::rtl::OUString& _rDataSourceNam } else m_pTreeView->getListBox().Select(pCommand); + + m_pTreeView->getListBox().MakeVisible(pCommand); + m_pTreeView->getListBox().SetCursor(pCommand); } else if (!pCommandType) { diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 2ba9aad04a98..322b044316a6 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FieldDescControl.cxx,v $ - * $Revision: 1.49 $ + * $Revision: 1.49.68.1 $ * * This file is part of OpenOffice.org. * @@ -155,12 +155,12 @@ using namespace ::com::sun::star::util; // fuer die Controls auf der OFieldDescGenPage #define CONTROL_SPACING_X 18 // 6 -#define CONTROL_SPACING_Y 5 -#define CONTROL_HEIGHT 20 +#define CONTROL_SPACING_Y 4 +#define CONTROL_HEIGHT 10 #define CONTROL_WIDTH_1 160 // 100 #define CONTROL_WIDTH_2 100 // 60 #define CONTROL_WIDTH_3 250 -#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - CONTROL_HEIGHT - 5) +#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - 20 - 5) #define SBA_DEF_RANGEFORMAT (100 + 143) // RangeItem #define SBA_DEF_FMTVALUE (100 + 144) // SfxULONG, Format @@ -451,10 +451,12 @@ void OFieldDescControl::CheckScrollBars() sal_uInt16 nActive = CountActiveAggregates(); // welches ist das letzte, was ganz drauf passt ? sal_uInt16 nLastVisible; + const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); if (bNeedHScrollBar) - nLastVisible = static_cast((szOverallSize.Height() - CONTROL_SPACING_Y - nHScrollHeight) / (CONTROL_SPACING_Y + CONTROL_HEIGHT)); + nLastVisible = static_cast((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight)); else - nLastVisible = static_cast((szOverallSize.Height() - CONTROL_SPACING_Y) / (CONTROL_SPACING_Y + CONTROL_HEIGHT)); + nLastVisible = static_cast((szOverallSize.Height() - nControl_Spacing_y) / (nControl_Spacing_y + nControlHeight)); bNeedVScrollBar = nActive>nLastVisible; if (bNeedVScrollBar) @@ -467,7 +469,7 @@ void OFieldDescControl::CheckScrollBars() // durch die vertikale brauche ich jetzt ploetzlich doch eine horizontale bNeedHScrollBar = sal_True; // nLastVisible anpassen - nLastVisible = static_cast((szOverallSize.Height() - CONTROL_SPACING_Y - nHScrollHeight) / (CONTROL_SPACING_Y + CONTROL_HEIGHT)); + nLastVisible = static_cast((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight)); // bNeedVScrollBar aendert sich nicht : es ist schon auf sal_True und nLastVisible wird hoechstens kleiner } } @@ -534,7 +536,9 @@ void OFieldDescControl::ScrollAllAggregates() if (m_nOldVThumb != m_pVertScroll->GetThumbPos()) { - nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (CONTROL_SPACING_Y + CONTROL_HEIGHT); + const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); + nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (nControl_Spacing_y + nControlHeight); m_nOldVThumb = m_pVertScroll->GetThumbPos(); } @@ -994,9 +998,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pRequired->SelectEntryPos(1); pRequired->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - // SetPosSize( (Control**)&pRequiredText, m_nPos, 0 ); - // SetPosSize( (Control**)&pRequired, m_nPos, 2 ); - pRequired->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pRequired->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1020,9 +1021,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pAutoIncrement->SelectEntryPos(0); pAutoIncrement->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - // SetPosSize( (Control**)&pAutoIncrementText, m_nPos, 0 ); - // SetPosSize( (Control**)&pAutoIncrement, m_nPos, 2 ); - pAutoIncrement->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pAutoIncrement->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1044,8 +1042,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pTextLen->SetStrictFormat(TRUE); pTextLen->SetHelpId(HID_TAB_ENT_TEXT_LEN); - // SetPosSize( (Control**)&pTextLenText, m_nPos, 0 ); - // SetPosSize( (Control**)&pTextLen, m_nPos, 1 ); pTextLen->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pTextLen->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1072,9 +1068,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) m_pType->SelectEntryPos(0); m_pType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - // SetPosSize( (Control**)&m_pTypeText, m_nPos, 0 ); - // SetPosSize( (Control**)&m_pType, m_nPos, 2 ); - m_pType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); m_pType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1101,9 +1094,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) m_pColumnName->setCheck( isSQL92CheckEnabled(getConnection()) ); } - // SetPosSize( (Control**)&m_pColumnNameText, m_nPos, 0 ); - // SetPosSize( (Control**)&m_pColumnName, m_nPos, 1 ); - m_pColumnName->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); m_pColumnName->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1129,9 +1119,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pNumType->SelectEntryPos(2); pNumType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - // SetPosSize( (Control**)&pNumTypeText, m_nPos, 0 ); - // SetPosSize( (Control**)&pNumType, m_nPos, 1 ); - pNumType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pNumType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1153,8 +1140,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pLength->SetStrictFormat(TRUE); pLength->SetHelpId(HID_TAB_ENT_LEN); - // SetPosSize( (Control**)&pLengthText, m_nPos, 0 ); - // SetPosSize( (Control**)&pLength, m_nPos, 1 ); pLength->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pLength->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1177,9 +1162,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pScale->SetHelpId(HID_TAB_ENT_SCALE); - // SetPosSize( (Control**)&pScaleText, m_nPos, 0 ); - // SetPosSize( (Control**)&pScale, m_nPos, 1 ); - pScale->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pScale->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1201,7 +1183,8 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pFormat = new PushButton( this, ModuleRes(PB_FORMAT) ); pFormat->SetHelpId(HID_TAB_ENT_FORMAT); - pFormat->SetSizePixel(Size(CONTROL_HEIGHT, CONTROL_HEIGHT)); + const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + pFormat->SetSizePixel(Size(nControlHeight, nControlHeight)); pFormat->SetClickHdl( LINK( this, OFieldDescControl, FormatClickHdl ) ); pFormatSample->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); @@ -1229,8 +1212,6 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pBoolDefault->InsertEntry(aYes); pBoolDefault->InsertEntry(aNo); pBoolDefault->SetHelpId(HID_TAB_ENT_BOOL_DEFAULT); - // SetPosSize( (Control**)&pBoolDefaultText, m_nPos, 0 ); - // SetPosSize( (Control**)&pBoolDefault, m_nPos, 3 ); pBoolDefault->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); pBoolDefault->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1406,47 +1387,48 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n ////////////////////////////////////////////////////////////////////// // Groesse ermitteln + const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); Size aSize; switch( nCol ) { case 0: aSize.Width() = CONTROL_WIDTH_1; - aSize.Height() = CONTROL_HEIGHT; + aSize.Height() = nControlHeight; break; case 1: if ( isRightAligned() ) aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); else aSize.Width() = CONTROL_WIDTH_2; - aSize.Height() = CONTROL_HEIGHT; + aSize.Height() = nControlHeight; break; case 2: if ( isRightAligned() ) aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); else aSize.Width() = CONTROL_WIDTH_2; - aSize.Height() = long(1.5*CONTROL_HEIGHT); + aSize.Height() = long(1.5*nControlHeight); break; case 3: if ( isRightAligned() ) aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); else aSize.Width() = CONTROL_WIDTH_3; - aSize.Height() = CONTROL_HEIGHT; + aSize.Height() = nControlHeight; break; case 4: if ( isRightAligned() ) aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); else aSize.Width() = CONTROL_WIDTH_4; - aSize.Height() = CONTROL_HEIGHT; + aSize.Height() = nControlHeight; break; default: if ( isRightAligned() ) aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); else aSize.Width() = CONTROL_WIDTH_1; - aSize.Height() = CONTROL_HEIGHT; + aSize.Height() = nControlHeight; } @@ -1475,12 +1457,18 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n aPosition.X() = 0; } - aPosition.Y() += ((nRow+1)*CONTROL_SPACING_Y) + - (nRow*CONTROL_HEIGHT); + (*ppControl)->SetSizePixel( aSize ); + aSize = (*ppControl)->GetSizePixel( ); + + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); + aPosition.Y() += ((nRow+1)*nControl_Spacing_y) + + (nRow*nControlHeight); ////////////////////////////////////////////////////////////////////// // Control anzeigen (*ppControl)->SetPosSizePixel( aPosition, aSize ); + aSize = (*ppControl)->GetSizePixel(); + (*ppControl)->Show(); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 99edbb1a58d7..8dc6cd76abb8 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: curledit.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.52.1 $ * * This file is part of OpenOffice.org. * @@ -111,9 +111,9 @@ void OConnectionURLEdit::SetText(const String& _rStr, const Selection& /*_rNewSe if (!bIsEmpty) { // determine the type of the new URL described by the new text - DATASOURCE_TYPE eType = m_aTypeCollection.getType(_rStr); + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(_rStr); // and the prefix belonging to this type - if (DST_UNKNOWN != eType) + if ( ::dbaccess::DST_UNKNOWN != eType) sPrefix = m_aTypeCollection.getDatasourcePrefix(eType); else { DBG_ERROR("OConnectionURLEdit::SetText : the new text is no valid connection URL!"); diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 3dd452faef42..89b0d790909d 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbtreelistbox.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.20.26.1 $ * * This file is part of OpenOffice.org. * @@ -562,6 +562,10 @@ namespace USHORT nCount = _rMenu.GetItemCount(); for ( USHORT pos = 0; pos < nCount; ++pos ) { + // do not adjust separators + if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) + continue; + USHORT nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); @@ -572,7 +576,16 @@ namespace } USHORT nCommandId = _rCommandController.registerCommandURL( aCommand ); - _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemBits( nId ), pos ); + _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemImage( nId ), + _rMenu.GetItemBits( nId ), pos ); + + // more things to preserve: + // - the help command + ::rtl::OUString sHelpURL = _rMenu.GetHelpCommand( nId ); + if ( sHelpURL.getLength() ) + _rMenu.SetHelpCommand( nCommandId, sHelpURL ); + + // remove the "old" item _rMenu.RemoveItem( pos+1 ); } } diff --git a/dbaccess/source/ui/dlg/AdabasStatDlg.cxx b/dbaccess/source/ui/dlg/AdabasStatDlg.cxx index fc0b822006b5..459d8ac1ba4d 100644 --- a/dbaccess/source/ui/dlg/AdabasStatDlg.cxx +++ b/dbaccess/source/ui/dlg/AdabasStatDlg.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AdabasStatDlg.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.15.68.1 $ * * This file is part of OpenOffice.org. * @@ -103,11 +103,11 @@ DBG_NAME(OAdabasStatPageDlg) delete pExampleSet; pExampleSet = new SfxItemSet(*GetInputSetImpl()); - DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*GetInputSetImpl()); + ::dbaccess::DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*GetInputSetImpl()); switch ( eType ) { - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: AddTabPage(TAB_PAG_ADABAS_SETTINGS, String(ModuleRes(STR_PAGETITLE_ADABAS_STATISTIC)), ODriversSettings::CreateAdabas,0, sal_False, 1); break; default: @@ -179,7 +179,7 @@ DBG_NAME(OAdabasStatPageDlg) return m_pImpl->getDriver(); } // ----------------------------------------------------------------------------- - DATASOURCE_TYPE OAdabasStatPageDlg::getDatasourceType(const SfxItemSet& _rSet) const + ::dbaccess::DATASOURCE_TYPE OAdabasStatPageDlg::getDatasourceType(const SfxItemSet& _rSet) const { return m_pImpl->getDatasourceType(_rSet); } diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 7c1d053825ad..183fb995b04c 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: CollectionView.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.50.1 $ * * This file is part of OpenOffice.org. * @@ -366,10 +366,17 @@ void OCollectionView::initCurrentPath() { if ( m_xContent.is() ) { - ::rtl::OUString sCID = m_xContent->getIdentifier()->getContentIdentifier(); - const static ::rtl::OUString sFormsCID(RTL_CONSTASCII_USTRINGPARAM("private:forms")); - m_bCreateForm = sFormsCID.compareTo(sCID) == 0; - m_aFTCurrentPath.SetText(sCID.copy(8)); + const ::rtl::OUString sCID = m_xContent->getIdentifier()->getContentIdentifier(); + const static ::rtl::OUString s_sFormsCID(RTL_CONSTASCII_USTRINGPARAM("private:forms")); + const static ::rtl::OUString s_sReportsCID(RTL_CONSTASCII_USTRINGPARAM("private:reports")); + m_bCreateForm = s_sFormsCID.compareTo(sCID) == 0; + ::rtl::OUString sPath(RTL_CONSTASCII_USTRINGPARAM("/")); + if ( m_bCreateForm && sCID.getLength() != s_sFormsCID.getLength()) + sPath = sCID.copy(s_sFormsCID.getLength()); + else if ( !m_bCreateForm && sCID.getLength() != s_sReportsCID.getLength() ) + sPath = sCID.copy(s_sReportsCID.getLength()); + + m_aFTCurrentPath.SetText(sPath); Reference xChild(m_xContent,UNO_QUERY); bEnable = xChild.is() && Reference(xChild->getParent(),UNO_QUERY).is(); } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 7872cfae9c29..9c2e2d91fb98 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionHelper.cxx,v $ - * $Revision: 1.19 $ + * $Revision: 1.19.48.1 $ * * This file is part of OpenOffice.org. * @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dsnItem.hxx" #ifndef DBAUI_CONNECTIONHELPER_HXX #include "ConnectionHelper.hxx" #endif @@ -224,7 +225,7 @@ DBG_NAME(OConnectionHelper) BOOL bEnableBrowseButton = m_pCollection->supportsBrowsing(m_eType); m_aFT_Connection.Show(); m_aET_Connection.Show(); - m_aET_Connection.ShowPrefix(DST_JDBC == m_eType ); + m_aET_Connection.ShowPrefix( ::dbaccess::DST_JDBC == m_eType ); m_aPB_Connection.Show(sal_True); LocalResourceAccess aLocRes( PAGE_CONNECTION, RSC_TABPAGE ); @@ -255,7 +256,7 @@ DBG_NAME(OConnectionHelper) switch ( m_eType ) { - case DST_CALC: + case ::dbaccess::DST_CALC: m_pAdminDialog->enableConfirmSettings( getURLNoPrefix().Len() > 0 ); break; default: @@ -269,8 +270,8 @@ DBG_NAME(OConnectionHelper) OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); switch ( m_eType ) { - case DST_DBASE: - case DST_FLAT: + case ::dbaccess::DST_DBASE: + case ::dbaccess::DST_FLAT: { try { @@ -322,7 +323,7 @@ DBG_NAME(OConnectionHelper) } } break; - case DST_CALC: + case ::dbaccess::DST_CALC: { ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN ,SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC) @@ -330,7 +331,7 @@ DBG_NAME(OConnectionHelper) askForFileName(aFileDlg); } break; - case DST_MSACCESS: + case ::dbaccess::DST_MSACCESS: { ::rtl::OUString sExt(RTL_CONSTASCII_USTRINGPARAM("*.mdb")); String sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME)); @@ -340,7 +341,7 @@ DBG_NAME(OConnectionHelper) askForFileName(aFileDlg); } break; - case DST_MSACCESS_2007: + case ::dbaccess::DST_MSACCESS_2007: { ::rtl::OUString sAccdb(RTL_CONSTASCII_USTRINGPARAM("*.accdb")); String sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME)); @@ -350,7 +351,7 @@ DBG_NAME(OConnectionHelper) askForFileName(aFileDlg); } break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: { // collect all names from the config dir // and all dir's of the DBWORK/wrk or DBROOT/wrk dir @@ -417,7 +418,7 @@ DBG_NAME(OConnectionHelper) if (RET_OK == aSelector.Execute()) { setURLNoPrefix(aSelector.GetSelected()); - // checkCreateDatabase(DST_ADABAS); + // checkCreateDatabase( ::dbaccess::DST_ADABAS); SetRoadmapStateValue(sal_True); callModifiedHdl(); } @@ -431,8 +432,8 @@ DBG_NAME(OConnectionHelper) } } break; - case DST_MYSQL_ODBC: - case DST_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: + case ::dbaccess::DST_ODBC: { // collect all ODBC data source names ::rtl::OUString sCurrDatasource=getURLNoPrefix(); @@ -448,7 +449,7 @@ DBG_NAME(OConnectionHelper) } break; #ifdef _ADO_DATALINK_BROWSE_ - case DST_ADO: + case ::dbaccess::DST_ADO: { ::rtl::OUString sOldDataSource=getURLNoPrefix(); ::rtl::OUString sNewDataSource; @@ -465,11 +466,11 @@ DBG_NAME(OConnectionHelper) } break; #endif - case DST_MOZILLA: - case DST_THUNDERBIRD: + case ::dbaccess::DST_MOZILLA: + case ::dbaccess::DST_THUNDERBIRD: { MozillaProductType profileType = MozillaProductType_Mozilla; - if (m_eType == DST_THUNDERBIRD) + if (m_eType == ::dbaccess::DST_THUNDERBIRD) profileType = MozillaProductType_Thunderbird; Reference xFactory = ::comphelper::getProcessServiceFactory(); @@ -811,11 +812,11 @@ DBG_NAME(OConnectionHelper) //------------------------------------------------------------------------- long OConnectionHelper::PreNotify( NotifyEvent& _rNEvt ) { - if ( (DST_DBASE == m_eType) - || (DST_FLAT == m_eType) - || (DST_MSACCESS == m_eType) - || (DST_MSACCESS_2007 == m_eType) - || (DST_CALC == m_eType) ) + if ( ( ::dbaccess::DST_DBASE == m_eType) + || ( ::dbaccess::DST_FLAT == m_eType) + || ( ::dbaccess::DST_MSACCESS == m_eType) + || ( ::dbaccess::DST_MSACCESS_2007 == m_eType) + || ( ::dbaccess::DST_CALC == m_eType) ) switch (_rNEvt.GetType()) { case EVENT_GETFOCUS: @@ -932,11 +933,11 @@ DBG_NAME(OConnectionHelper) String sOldPath; sOldPath = m_aET_Connection.GetSavedValueNoPrefix(); sURL = m_aET_Connection.GetTextNoPrefix(); - if ( (DST_DBASE == m_eType) - || (DST_FLAT == m_eType) - || (DST_MSACCESS == m_eType) - || (DST_MSACCESS_2007 == m_eType) - || (DST_CALC == m_eType) ) + if ( ( ::dbaccess::DST_DBASE == m_eType) + || ( ::dbaccess::DST_FLAT == m_eType) + || ( ::dbaccess::DST_MSACCESS == m_eType) + || ( ::dbaccess::DST_MSACCESS_2007 == m_eType) + || ( ::dbaccess::DST_CALC == m_eType) ) { if ((sURL != sOldPath) && (0 != sURL.Len())) { // the text changed since entering the control @@ -945,7 +946,7 @@ DBG_NAME(OConnectionHelper) OFileNotation aTransformer(sURL); sURL = aTransformer.get(OFileNotation::N_URL); - if ( (DST_CALC == m_eType) || (DST_MSACCESS == m_eType) || (DST_MSACCESS_2007 == m_eType) ) + if ( ( ::dbaccess::DST_CALC == m_eType) || ( ::dbaccess::DST_MSACCESS == m_eType) || ( ::dbaccess::DST_MSACCESS_2007 == m_eType) ) { // #106016# -------------------------- if( pathExists(sURL, sal_True) == PATH_NOT_EXIST ) { diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 6e67f2b92d22..c25751960648 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionHelper.hxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.66.1 $ * * This file is part of OpenOffice.org. * @@ -77,13 +77,14 @@ namespace dbaui FixedText m_aFT_Connection; OConnectionURLEdit m_aET_Connection; PushButton m_aPB_Connection; - DATASOURCE_TYPE m_eType; // the type can't be changed in this class, so we hold it as member. + ::dbaccess::DATASOURCE_TYPE + m_eType; // the type can't be changed in this class, so we hold it as member. public: // setting/retrieving the current connection URL // necessary because for some types, the URL must be decoded for display purposes - ODsnTypeCollection* m_pCollection; /// the DSN type collection instance + ::dbaccess::ODsnTypeCollection* m_pCollection; /// the DSN type collection instance virtual long PreNotify( NotifyEvent& _rNEvt ); // OGenericAdministrationPage::fillControls diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 73755124cecd..9b7f2484cc88 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionPage.cxx,v $ - * $Revision: 1.25 $ + * $Revision: 1.25.26.1 $ * * This file is part of OpenOffice.org. * @@ -155,6 +155,7 @@ #ifndef _SFX_DOCFILT_HACK_HXX #include #endif +#include "dsnItem.hxx" #if defined(WIN) || defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif @@ -248,61 +249,61 @@ namespace dbaui LocalResourceAccess aLocRes( PAGE_CONNECTION, RSC_TABPAGE ); switch( m_eType ) { - case DST_DBASE: + case ::dbaccess::DST_DBASE: m_aFT_Connection.SetText(String(ModuleRes(STR_DBASE_PATH_OR_FILE))); m_aET_Connection.SetHelpId(HID_DSADMIN_DBASE_PATH); break; - case DST_FLAT: + case ::dbaccess::DST_FLAT: m_aFT_Connection.SetText(String(ModuleRes(STR_FLAT_PATH_OR_FILE))); m_aET_Connection.SetHelpId(HID_DSADMIN_FLAT_PATH); break; - case DST_CALC: + case ::dbaccess::DST_CALC: m_aFT_Connection.SetText(String(ModuleRes(STR_CALC_PATH_OR_FILE))); m_aET_Connection.SetHelpId(HID_DSADMIN_CALC_PATH); break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: m_aFT_Connection.SetText(String(ModuleRes(STR_ADABAS_DATABASE_NAME))); m_aET_Connection.SetHelpId(HID_DSADMIN_ADABAS_DATABASE); break; - case DST_ADO: + case ::dbaccess::DST_ADO: m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL))); break; - case DST_MSACCESS: - case DST_MSACCESS_2007: + case ::dbaccess::DST_MSACCESS: + case ::dbaccess::DST_MSACCESS_2007: m_aFT_Connection.SetText(String(ModuleRes(STR_MSACCESS_MDB_FILE))); m_aET_Connection.SetHelpId(HID_DSADMIN_MSACCESS_MDB_FILE); break; - case DST_MYSQL_NATIVE: - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_JDBC: m_aFT_Connection.SetText(String(ModuleRes(STR_MYSQL_DATABASE_NAME))); m_aET_Connection.SetHelpId(HID_DSADMIN_MYSQL_DATABASE); break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: m_aFT_Connection.SetText(String(ModuleRes(STR_ORACLE_DATABASE_NAME))); m_aET_Connection.SetHelpId(HID_DSADMIN_ORACLE_DATABASE); break; - case DST_MYSQL_ODBC: - case DST_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: + case ::dbaccess::DST_ODBC: m_aFT_Connection.SetText(String(ModuleRes(STR_NAME_OF_ODBC_DATASOURCE))); - m_aET_Connection.SetHelpId( m_eType == DST_MYSQL_ODBC ? HID_DSADMIN_MYSQL_ODBC_DATASOURCE : HID_DSADMIN_ODBC_DATASOURCE); + m_aET_Connection.SetHelpId( m_eType == ::dbaccess::DST_MYSQL_ODBC ? HID_DSADMIN_MYSQL_ODBC_DATASOURCE : HID_DSADMIN_ODBC_DATASOURCE); break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: m_aFT_Connection.SetText(String(ModuleRes(STR_HOSTNAME))); m_aET_Connection.SetHelpId( HID_DSADMIN_LDAP_HOSTNAME ); break; - case DST_MOZILLA: + case ::dbaccess::DST_MOZILLA: m_aFT_Connection.SetText(String(ModuleRes(STR_MOZILLA_PROFILE_NAME))); m_aET_Connection.SetHelpId( HID_DSADMIN_MOZILLA_PROFILE_NAME ); break; - case DST_THUNDERBIRD: + case ::dbaccess::DST_THUNDERBIRD: m_aFT_Connection.SetText(String(ModuleRes(STR_THUNDERBIRD_PROFILE_NAME))); m_aET_Connection.SetHelpId( HID_DSADMIN_THUNDERBIRD_PROFILE_NAME ); break; - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_EVOLUTION: - case DST_KAB: - case DST_MACAB: + case ::dbaccess::DST_OUTLOOK: + case ::dbaccess::DST_OUTLOOKEXP: + case ::dbaccess::DST_EVOLUTION: + case ::dbaccess::DST_KAB: + case ::dbaccess::DST_MACAB: m_aFT_Connection.SetText(String(ModuleRes(STR_NO_ADDITIONAL_SETTINGS))); { String sText = m_aFT_Connection.GetText(); @@ -313,7 +314,7 @@ namespace dbaui } m_aET_Connection.Hide(); break; - case DST_JDBC: + case ::dbaccess::DST_JDBC: m_aFT_Connection.SetText(String(ModuleRes(STR_COMMONURL))); // run through default: @@ -350,7 +351,7 @@ namespace dbaui String sUrl = pUrlItem->GetValue(); setURL( sUrl ); - BOOL bEnableJDBC = m_eType == DST_JDBC; + BOOL bEnableJDBC = m_eType == ::dbaccess::DST_JDBC; m_aJavaDriver.SetText(pJdbcDrvItem->GetValue()); m_aJavaDriverLabel.Show(bEnableJDBC); @@ -404,7 +405,7 @@ namespace dbaui fillBool(_rSet,&m_aPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething); - if ( m_eType == DST_JDBC ) + if ( m_eType == ::dbaccess::DST_JDBC ) { fillString(_rSet,&m_aJavaDriver, DSID_JDBCDRIVERCLASS, bChangedSomething); } @@ -440,7 +441,7 @@ namespace dbaui { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); BOOL bEnableTestConnection = !m_aET_Connection.IsVisible() || (m_aET_Connection.GetTextNoPrefix().Len() != 0); - if ( m_eType == DST_JDBC ) + if ( m_eType == ::dbaccess::DST_JDBC ) bEnableTestConnection = bEnableTestConnection && (m_aJavaDriver.GetText().Len() != 0); m_aTestConnection.Enable(bEnableTestConnection); return true; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index 89a155a45bc6..c9ae69e57278 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionPage.hxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.68.1 $ * * This file is part of OpenOffice.org. * @@ -58,7 +58,8 @@ namespace dbaui */ class OConnectionTabPage : public OConnectionHelper { - ODsnTypeCollection* m_pCollection; /// the DSN type collection instance + ::dbaccess::ODsnTypeCollection* + m_pCollection; /// the DSN type collection instance sal_Bool m_bUserGrabFocus : 1; protected: // connection diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index ed344f53fc43..18897b83f088 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionPageSetup.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.68.1 $ * * This file is part of OpenOffice.org. * @@ -272,12 +272,12 @@ namespace dbaui m_eType = m_pAdminDialog->getDatasourceType(_rSet); // special handling for oracle, this can only happen // if the user enters the same url as used for Oracle and we are on the JDBC path - if ( DST_ORACLE_JDBC == m_eType ) - m_eType = DST_JDBC; + if ( ::dbaccess::DST_ORACLE_JDBC == m_eType ) + m_eType = ::dbaccess::DST_JDBC; OConnectionHelper::implInitControls(_rSet, _bSaveValue); - if ( m_eType >= DST_USERDEFINE1 ) + if ( m_eType >= ::dbaccess::DST_USERDEFINE1 ) { String sDisplayName = m_pCollection->getTypeDisplayName(m_eType); FixedText* ppTextControls[] ={&m_aFT_Connection}; diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 34339bfecef8..129c2cdd216a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DBSetupConnectionPages.cxx,v $ - * $Revision: 1.19 $ + * $Revision: 1.19.18.1 $ * * This file is part of OpenOffice.org. * @@ -60,6 +60,7 @@ #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" #endif +#include "dsnItem.hxx" #ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" #endif @@ -282,12 +283,12 @@ DBG_NAME(OTextConnectionPageSetup) if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() ) { DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION)); - ODsnTypeCollection* pCollection = NULL; + ::dbaccess::ODsnTypeCollection* pCollection = NULL; if (pCollectionItem) pCollection = pCollectionItem->getCollection(); DBG_ASSERT(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); - String sUrl = pCollection->getDatasourcePrefix(DST_LDAP); + String sUrl = pCollection->getDatasourcePrefix( ::dbaccess::DST_LDAP); sUrl += m_aETHostServer.GetText(); _rSet.Put(SfxStringItem(DSID_CONNECTURL, sUrl)); bChangedSomething = sal_True; @@ -388,11 +389,11 @@ DBG_NAME(OMySQLIntroPageSetup) void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/) { DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION)); - ODsnTypeCollection* pCollection = NULL; + ::dbaccess::ODsnTypeCollection* pCollection = NULL; if (pCollectionItem) { pCollection = pCollectionItem->getCollection(); - String sUrl = pCollection->getDatasourcePrefix(DST_MYSQL_NATIVE); + String sUrl = pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_NATIVE); uno::Reference< sdbc::XDriverAccess > xDriverManager( m_xORB->createInstance( SERVICE_SDBC_DRIVERMANAGER ), uno::UNO_QUERY ); if ( xDriverManager.is() && xDriverManager->getDriverByURL( sUrl ).is() ) { diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 4a4497d669d2..779814ca508b 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DbAdminImpl.cxx,v $ - * $Revision: 1.26 $ + * $Revision: 1.26.18.1 $ * * This file is part of OpenOffice.org. * @@ -119,7 +119,7 @@ #ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ #include #endif - +#include "dsnItem.hxx" #include #include @@ -471,19 +471,19 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc return m_xDatasource; } //------------------------------------------------------------------------- -DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) +::dbaccess::DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) { SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True ); SFX_ITEMSET_GET( _rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True ); DBG_ASSERT( pConnectURL && pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); if ( !pConnectURL || !pTypeCollection ) - return DST_UNKNOWN; + return ::dbaccess::DST_UNKNOWN; String sConnectURL = pConnectURL->GetValue(); - ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); + ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); DBG_ASSERT( pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!" ); if ( !pCollection ) - return DST_UNKNOWN; + return ::dbaccess::DST_UNKNOWN; return pCollection->getType( sConnectURL ); } @@ -498,25 +498,25 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const { String sNewUrl; - DATASOURCE_TYPE eType = getDatasourceType(*m_pItemSetHelper->getOutputSet()); + ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*m_pItemSetHelper->getOutputSet()); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); - ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); + ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); switch( eType ) { - case DST_DBASE: - case DST_FLAT: - case DST_CALC: + case ::dbaccess::DST_DBASE: + case ::dbaccess::DST_FLAT: + case ::dbaccess::DST_CALC: break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: { SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); sNewUrl = lcl_createHostWithPort(pHostName,NULL); @@ -527,8 +527,8 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const sNewUrl += sUrl; } break; - case DST_MSACCESS: - case DST_MSACCESS_2007: + case ::dbaccess::DST_MSACCESS: + case ::dbaccess::DST_MSACCESS_2007: { ::rtl::OUString sFileName = pCollection->cutPrefix(pUrlItem->GetValue()); ::rtl::OUString sNewFileName; @@ -538,8 +538,8 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const } } break; - case DST_MYSQL_NATIVE: - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_JDBC: { SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_MYSQL_PORTNUMBER, sal_True); @@ -559,7 +559,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const } } break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: { SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_ORACLE_PORTNUMBER, sal_True); @@ -583,7 +583,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const } } break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: { // SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True); @@ -591,7 +591,7 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const sNewUrl += lcl_createHostWithPort(NULL,pPortNumber); } break; - case DST_JDBC: + case ::dbaccess::DST_JDBC: // run through default: break; @@ -769,7 +769,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS // us) // first determine which of all the items are relevant for the data source (depends on the connection url) - DATASOURCE_TYPE eType = getDatasourceType(_rSource); + ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(_rSource); ::std::vector< sal_Int32> aDetailIds; ODriversSettings::getSupportedIndirectSettings(eType,aDetailIds); @@ -874,7 +874,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS } // here we have a special entry for types from oracle - if ( eType == DST_ORACLE_JDBC ) + if ( eType == ::dbaccess::DST_ORACLE_JDBC ) { Sequence< Any > aTypeSettings; static const ::rtl::OUString s_sCondition(RTL_CONSTASCII_USTRINGPARAM("Column(2) = ")); @@ -1077,14 +1077,14 @@ String ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest) // ----------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) { - DATASOURCE_TYPE eType = getDatasourceType(_rDest); + ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(_rDest); SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); DBG_ASSERT(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!"); - ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); + ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); DBG_ASSERT(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); USHORT nPortNumberId = 0; @@ -1097,14 +1097,14 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) switch( eType ) { - case DST_MYSQL_NATIVE: - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_JDBC: nPortNumberId = DSID_MYSQL_PORTNUMBER; break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: nPortNumberId = DSID_ORACLE_PORTNUMBER; break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: nPortNumberId = DSID_CONN_LDAP_PORTNUMBER; break; default: @@ -1144,6 +1144,37 @@ void ODbDataSourceAdministrationHelper::setDataSourceOrName( const Any& _rDataSo // hmm. We could reset m_xDatasource/m_xModel, probably, and continue working m_aDataSourceOrName = _rDataSourceOrName; } +//========================================================================= +//= DbuTypeCollectionItem +//========================================================================= +TYPEINIT1(DbuTypeCollectionItem, SfxPoolItem); +//------------------------------------------------------------------------- +DbuTypeCollectionItem::DbuTypeCollectionItem(sal_Int16 _nWhich, ::dbaccess::ODsnTypeCollection* _pCollection) + :SfxPoolItem(_nWhich) + ,m_pCollection(_pCollection) +{ +} + +//------------------------------------------------------------------------- +DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource) + :SfxPoolItem(_rSource) + ,m_pCollection(_rSource.getCollection()) +{ +} + +//------------------------------------------------------------------------- +int DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const +{ + DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem); + return pCompare && (pCompare->getCollection() == getCollection()); +} + +//------------------------------------------------------------------------- +SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* /*_pPool*/) const +{ + return new DbuTypeCollectionItem(*this); +} + //......................................................................... } // namespace dbaui //......................................................................... diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index 78ac41d9ffb7..70a0c07a6722 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DbAdminImpl.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.68.1 $ * * This file is part of OpenOffice.org. * @@ -64,6 +64,7 @@ #ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ #include #endif +#include class Window; //......................................................................... @@ -141,7 +142,7 @@ namespace dbaui /** extracts the connection type from the given set

The connection type is determined by the value of the DSN item, analyzed by the TypeCollection item. */ - static DATASOURCE_TYPE getDatasourceType( const SfxItemSet& _rSet ); + static ::dbaccess::DATASOURCE_TYPE getDatasourceType( const SfxItemSet& _rSet ); /** returns the connection URL @return diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx index 24e3342c4e5e..d9ae183a0c7a 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.cxx +++ b/dbaccess/source/ui/dlg/DriverSettings.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DriverSettings.cxx,v $ - * $Revision: 1.17 $ + * $Revision: 1.17.18.1 $ * * This file is part of OpenOffice.org. * @@ -37,7 +37,7 @@ using namespace dbaui; -void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::std::vector< sal_Int32>& _out_rDetailsIds ) +void ODriversSettings::getSupportedIndirectSettings( ::dbaccess::DATASOURCE_TYPE _eType, ::std::vector< sal_Int32>& _out_rDetailsIds ) { // for a number of settings, we do not need to use hard-coded here, but can ask a // central DataSourceUI instance. @@ -68,12 +68,12 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s // the rest is hard-coded. On the long run, all of this should be done via DataSourceUI::hasSetting switch ( _eType ) { - case DST_DBASE: + case ::dbaccess::DST_DBASE: _out_rDetailsIds.push_back(DSID_SHOWDELETEDROWS); _out_rDetailsIds.push_back(DSID_CHARSET); break; - case DST_FLAT: + case ::dbaccess::DST_FLAT: _out_rDetailsIds.push_back(DSID_FIELDDELIMITER); _out_rDetailsIds.push_back(DSID_TEXTDELIMITER); _out_rDetailsIds.push_back(DSID_DECIMALDELIMITER); @@ -83,7 +83,7 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s _out_rDetailsIds.push_back(DSID_CHARSET); break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: _out_rDetailsIds.push_back(DSID_CHARSET); _out_rDetailsIds.push_back(DSID_CONN_SHUTSERVICE); _out_rDetailsIds.push_back(DSID_CONN_DATAINC); @@ -92,40 +92,40 @@ void ODriversSettings::getSupportedIndirectSettings( DATASOURCE_TYPE _eType, ::s _out_rDetailsIds.push_back(DSID_CONN_CTRLPWD); break; - case DST_ADO: + case ::dbaccess::DST_ADO: _out_rDetailsIds.push_back(DSID_CHARSET); break; - case DST_ODBC: + case ::dbaccess::DST_ODBC: _out_rDetailsIds.push_back(DSID_ADDITIONALOPTIONS); _out_rDetailsIds.push_back(DSID_CHARSET); _out_rDetailsIds.push_back(DSID_USECATALOG); break; - case DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_NATIVE: _out_rDetailsIds.push_back(DSID_CHARSET); _out_rDetailsIds.push_back(DSID_CONN_SOCKET); break; - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_JDBC: _out_rDetailsIds.push_back(DSID_CHARSET); _out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS); break; - case DST_MYSQL_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: _out_rDetailsIds.push_back(DSID_CHARSET); break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: _out_rDetailsIds.push_back(DSID_CONN_LDAP_BASEDN); _out_rDetailsIds.push_back(DSID_CONN_LDAP_ROWCOUNT); _out_rDetailsIds.push_back(DSID_CONN_LDAP_USESSL); break; - case DST_JDBC: + case ::dbaccess::DST_JDBC: _out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS); break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: _out_rDetailsIds.push_back(DSID_JDBCDRIVERCLASS); _out_rDetailsIds.push_back(DSID_IGNORECURRENCY); break; diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx index d6953e2bb958..29a68d35a5a5 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.hxx +++ b/dbaccess/source/ui/dlg/DriverSettings.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DriverSettings.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.68.1 $ * * This file is part of OpenOffice.org. * @@ -33,6 +33,7 @@ #ifndef _DBAUI_DSNTYPES_HXX_ #include "dsntypes.hxx" #endif +#include #include class SfxTabPage; @@ -52,7 +53,7 @@ namespace dbaui @param _out_rDetailsIds Will be filled. */ - static void getSupportedIndirectSettings( DATASOURCE_TYPE _eType,::std::vector< sal_Int32>& _out_rDetailsIds ); + static void getSupportedIndirectSettings( ::dbaccess::DATASOURCE_TYPE _eType,::std::vector< sal_Int32>& _out_rDetailsIds ); /** Creates the detail page for Dbase */ diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index ed054fd909fc..0a02981858ee 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationDlg.cxx,v $ - * $Revision: 1.29 $ + * $Revision: 1.29.24.1 $ * * This file is part of OpenOffice.org. * @@ -246,7 +246,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) try { ORelationTableConnectionData* pOrigConnData = static_cast(m_pOrigConnData.get()); - if (*pConnData != *pOrigConnData || pConnData->Update()) + if ( *pConnData == *pOrigConnData || pConnData->Update()) { m_pOrigConnData->CopyFrom( *m_pConnData ); EndDialog( RET_OK ); diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 8ce378b453b5..bc070485fea2 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UserAdminDlg.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.68.1 $ * * This file is part of OpenOffice.org. * @@ -228,7 +228,7 @@ DBG_NAME(OUserAdminDlg) return m_pImpl->getDriver(); } // ----------------------------------------------------------------------------- - DATASOURCE_TYPE OUserAdminDlg::getDatasourceType(const SfxItemSet& _rSet) const + ::dbaccess::DATASOURCE_TYPE OUserAdminDlg::getDatasourceType(const SfxItemSet& _rSet) const { return m_pImpl->getDatasourceType(_rSet); } diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 4dd216e32ea8..a6fbd46ba6b0 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: adminpages.cxx,v $ - * $Revision: 1.52 $ + * $Revision: 1.52.40.1 $ * * This file is part of OpenOffice.org. * @@ -183,7 +183,7 @@ namespace dbaui return 0L; } // ----------------------------------------------------------------------- - sal_Bool OGenericAdministrationPage::getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr) + sal_Bool OGenericAdministrationPage::getSelectedDataSource(::dbaccess::DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr) { // collect all ODBC data source names StringBag aOdbcDatasources; diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 11dc24a42614..d1ef46a37cf1 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: adminpages.hxx,v $ - * $Revision: 1.35 $ + * $Revision: 1.35.68.1 $ * * This file is part of OpenOffice.org. * @@ -166,7 +166,7 @@ namespace dbaui @return if an error occured, otherwise */ - sal_Bool getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr); + sal_Bool getSelectedDataSource(::dbaccess::DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn,::rtl::OUString& _sCurr); // svt::IWizardPage virtual void initializePage(); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 081a42d069fb..d5ce1cdd47e5 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: adtabdlg.cxx,v $ - * $Revision: 1.30 $ + * $Revision: 1.30.68.2 $ * * This file is part of OpenOffice.org. * @@ -30,74 +30,36 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBAUI_QYDLGTAB_HXX + #include "adtabdlg.hxx" -#endif -#ifndef DBAUI_ADTABDLG_HRC #include "adtabdlg.hrc" -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX #include -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include -#endif -#ifndef _SVTOOLS_LOCALRESACCESS_HXX_ #include -#endif -#ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" -#endif -#ifndef _DBU_RESOURCE_HRC_ #include "dbu_resource.hrc" -#endif -#ifndef _DBU_DLG_HRC_ #include "dbu_dlg.hrc" -#endif -#ifndef _SFXSIDS_HRC #include -#endif -#ifndef DBAUI_QUERYTABLEVIEW_HXX #include "QueryTableView.hxx" -#endif -#ifndef DBAUI_QUERYDESIGNVIEW_HXX #include "QueryDesignView.hxx" -#endif -#ifndef DBAUI_QUERYCONTROLLER_HXX #include "querycontroller.hxx" -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _COM_SUN_STAR_SDB_XQUERIESSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XVIEWSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef DBACCESS_IMAGEPROVIDER_HXX #include "imageprovider.hxx" -#endif +#include +#include "cppuhelper/basemutex.hxx" #include // slot ids using namespace dbaui; +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::sdb; @@ -115,23 +77,42 @@ TableObjectListFacade::~TableObjectListFacade() //============================================================================== //= TableListFacade //============================================================================== -class TableListFacade : public TableObjectListFacade +class TableListFacade : public ::cppu::BaseMutex + , public TableObjectListFacade + , public ::comphelper::OContainerListener { OTableTreeListBox& m_rTableList; Reference< XConnection > m_xConnection; + ::rtl::Reference< comphelper::OContainerListenerAdapter> + m_pContainerListener; + bool m_bAllowViews; public: TableListFacade( OTableTreeListBox& _rTableList, const Reference< XConnection >& _rxConnection ) - :m_rTableList( _rTableList ) + : ::comphelper::OContainerListener(m_aMutex) + ,m_rTableList( _rTableList ) ,m_xConnection( _rxConnection ) + ,m_bAllowViews(true) { } + virtual ~TableListFacade(); + +private: virtual void updateTableObjectList( bool _bAllowViews ); virtual String getSelectedName( String& _out_rAliasName ) const; virtual bool isLeafSelected() const; + // OContainerListener + virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); }; +TableListFacade::~TableListFacade() +{ + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); +} //------------------------------------------------------------------------------ String TableListFacade::getSelectedName( String& _out_rAliasName ) const { @@ -174,21 +155,44 @@ String TableListFacade::getSelectedName( String& _out_rAliasName ) const _out_rAliasName = aTableName; return aComposedName; } - +// ----------------------------------------------------------------------------- +void TableListFacade::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + updateTableObjectList(m_bAllowViews); +} +// ----------------------------------------------------------------------------- +void TableListFacade::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + updateTableObjectList(m_bAllowViews); +} +// ----------------------------------------------------------------------------- +void TableListFacade::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ +} //------------------------------------------------------------------------------ void TableListFacade::updateTableObjectList( bool _bAllowViews ) { + m_bAllowViews = _bAllowViews; m_rTableList.Clear(); try { Reference< XTablesSupplier > xTableSupp( m_xConnection, UNO_QUERY_THROW ); + Reference< XViewsSupplier > xViewSupp; Reference< XNameAccess > xTables, xViews; Sequence< ::rtl::OUString > sTables, sViews; xTables = xTableSupp->getTables(); if ( xTables.is() ) + { + if ( !m_pContainerListener.is() ) + { + Reference< XContainer> xContainer(xTables,uno::UNO_QUERY); + if ( xContainer.is() ) + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } sTables = xTables->getElementNames(); + } // if ( xTables.is() ) xViewSupp.set( xTableSupp, UNO_QUERY ); if ( xViewSupp.is() ) @@ -241,22 +245,53 @@ bool TableListFacade::isLeafSelected() const //============================================================================== //= QueryListFacade //============================================================================== -class QueryListFacade : public TableObjectListFacade +class QueryListFacade : public ::cppu::BaseMutex + , public TableObjectListFacade + , public ::comphelper::OContainerListener { SvTreeListBox& m_rQueryList; Reference< XConnection > m_xConnection; + ::rtl::Reference< comphelper::OContainerListenerAdapter> + m_pContainerListener; public: QueryListFacade( SvTreeListBox& _rQueryList, const Reference< XConnection >& _rxConnection ) - :m_rQueryList( _rQueryList ) + : ::comphelper::OContainerListener(m_aMutex) + ,m_rQueryList( _rQueryList ) ,m_xConnection( _rxConnection ) { } - + virtual ~QueryListFacade(); +private: virtual void updateTableObjectList( bool _bAllowViews ); virtual String getSelectedName( String& _out_rAliasName ) const; virtual bool isLeafSelected() const; + // OContainerListener + virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); }; +QueryListFacade::~QueryListFacade() +{ + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); +} +// ----------------------------------------------------------------------------- +void QueryListFacade::_elementInserted( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) +{ + ::rtl::OUString sName; + if ( _rEvent.Accessor >>= sName ) + m_rQueryList.InsertEntry( sName ); +} +// ----------------------------------------------------------------------------- +void QueryListFacade::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + updateTableObjectList(true); +} +// ----------------------------------------------------------------------------- +void QueryListFacade::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ +} //------------------------------------------------------------------------------ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ ) @@ -275,6 +310,11 @@ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ ) Reference< XQueriesSupplier > xSuppQueries( m_xConnection, UNO_QUERY_THROW ); Reference< XNameAccess > xQueries( xSuppQueries->getQueries(), UNO_QUERY_THROW ); + if ( !m_pContainerListener.is() ) + { + Reference< XContainer> xContainer(xQueries,UNO_QUERY_THROW); + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } Sequence< ::rtl::OUString > aQueryNames = xQueries->getElementNames(); const ::rtl::OUString* pQuery = aQueryNames.getConstArray(); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 89116e4feab8..ffc6e1cb8080 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: advancedsettings.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.68.1 $ * * This file is part of OpenOffice.org. * @@ -408,7 +408,7 @@ namespace dbaui delete pExampleSet; pExampleSet = new SfxItemSet(*GetInputSetImpl()); - DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*_pItems); + ::dbaccess::DATASOURCE_TYPE eType = m_pImpl->getDatasourceType(*_pItems); DataSourceMetaData aMeta( eType ); const AdvancedSettingsSupport& rAdvancedSupport( aMeta.getAdvancedSettingsSupport() ); @@ -434,7 +434,7 @@ namespace dbaui } // ----------------------------------------------------------------------- - bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( DATASOURCE_TYPE _eType ) + bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( ::dbaccess::DATASOURCE_TYPE _eType ) { DataSourceMetaData aMeta( _eType ); const AdvancedSettingsSupport& rSupport( aMeta.getAdvancedSettingsSupport() ); @@ -501,7 +501,7 @@ namespace dbaui } // ----------------------------------------------------------------------------- - DATASOURCE_TYPE AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const + ::dbaccess::DATASOURCE_TYPE AdvancedSettingsDialog::getDatasourceType(const SfxItemSet& _rSet) const { return m_pImpl->getDatasourceType(_rSet); } diff --git a/dbaccess/source/ui/dlg/datasourceui.cxx b/dbaccess/source/ui/dlg/datasourceui.cxx index 7cde64deeca3..a255222c13b3 100644 --- a/dbaccess/source/ui/dlg/datasourceui.cxx +++ b/dbaccess/source/ui/dlg/datasourceui.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: datasourceui.cxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.68.1 $ * * This file is part of OpenOffice.org. * @@ -52,7 +52,7 @@ namespace dbaui //= DataSourceUI //==================================================================== //-------------------------------------------------------------------- - DataSourceUI::DataSourceUI( DATASOURCE_TYPE _eType ) + DataSourceUI::DataSourceUI( ::dbaccess::DATASOURCE_TYPE _eType ) :m_aDSMeta( DataSourceMetaData( _eType ) ) { } diff --git a/dbaccess/source/ui/dlg/datasourceui.hxx b/dbaccess/source/ui/dlg/datasourceui.hxx index 59759e9dea66..9fa356503ed4 100644 --- a/dbaccess/source/ui/dlg/datasourceui.hxx +++ b/dbaccess/source/ui/dlg/datasourceui.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: datasourceui.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.68.1 $ * * This file is part of OpenOffice.org. * @@ -52,7 +52,7 @@ namespace dbaui class DataSourceUI { public: - DataSourceUI( DATASOURCE_TYPE _eType ); + DataSourceUI( ::dbaccess::DATASOURCE_TYPE _eType ); DataSourceUI( const DataSourceMetaData& _rDSMeta ); ~DataSourceUI(); diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 2961078207ba..dbcf11dc0fc5 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbadmin.cxx,v $ - * $Revision: 1.108 $ + * $Revision: 1.108.18.1 $ * * This file is part of OpenOffice.org. * @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dsnItem.hxx" #ifndef _DBAUI_DBADMIN_HXX_ #include "dbadmin.hxx" #endif @@ -181,43 +182,43 @@ void ODbAdminDialog::implSelectDatasource(const ::com::sun::star::uno::Any& _aDa Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource(); resetPages(xDatasource); - DATASOURCE_TYPE eType = getDatasourceType(*getOutputSet()); + ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*getOutputSet()); // and insert the new ones switch ( eType ) { - case DST_DBASE: + case ::dbaccess::DST_DBASE: addDetailPage(PAGE_DBASE, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateDbase); // bResetPasswordRequired = sal_True; break; - case DST_ADO: + case ::dbaccess::DST_ADO: addDetailPage(PAGE_ADO, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateAdo); break; - case DST_FLAT: + case ::dbaccess::DST_FLAT: addDetailPage(PAGE_TEXT, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateText); // bResetPasswordRequired = sal_True; break; - case DST_ODBC: + case ::dbaccess::DST_ODBC: addDetailPage(PAGE_ODBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateODBC); break; - case DST_MYSQL_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: addDetailPage(PAGE_MYSQL_ODBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLODBC); break; - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_JDBC: addDetailPage(PAGE_MYSQL_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLJDBC); break; - case DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_NATIVE: addDetailPage(PAGE_MYSQL_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateMySQLNATIVE); break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: addDetailPage(PAGE_ORACLE_JDBC, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateOracleJDBC); break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: // for adabas we have more than one page // CAUTION: the order of inserting pages matters. // the major detail page should be inserted last always (thus, it becomes the first page after @@ -225,19 +226,19 @@ void ODbAdminDialog::implSelectDatasource(const ::com::sun::star::uno::Any& _aDa addDetailPage(PAGE_ADABAS, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateAdabas); break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: addDetailPage(PAGE_LDAP,STR_PAGETITLE_ADVANCED,ODriversSettings::CreateLDAP); break; - case DST_USERDEFINE1: /// first user defined driver - case DST_USERDEFINE2: - case DST_USERDEFINE3: - case DST_USERDEFINE4: - case DST_USERDEFINE5: - case DST_USERDEFINE6: - case DST_USERDEFINE7: - case DST_USERDEFINE8: - case DST_USERDEFINE9: - case DST_USERDEFINE10: + case ::dbaccess::DST_USERDEFINE1: /// first user defined driver + case ::dbaccess::DST_USERDEFINE2: + case ::dbaccess::DST_USERDEFINE3: + case ::dbaccess::DST_USERDEFINE4: + case ::dbaccess::DST_USERDEFINE5: + case ::dbaccess::DST_USERDEFINE6: + case ::dbaccess::DST_USERDEFINE7: + case ::dbaccess::DST_USERDEFINE8: + case ::dbaccess::DST_USERDEFINE9: + case ::dbaccess::DST_USERDEFINE10: { LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); String aTitle(ModuleRes(STR_PAGETITLE_ADVANCED)); @@ -385,7 +386,7 @@ Reference< XDriver > ODbAdminDialog::getDriver() return m_pImpl->getDriver(); } // ----------------------------------------------------------------------------- -DATASOURCE_TYPE ODbAdminDialog::getDatasourceType(const SfxItemSet& _rSet) const +::dbaccess::DATASOURCE_TYPE ODbAdminDialog::getDatasourceType(const SfxItemSet& _rSet) const { return m_pImpl->getDatasourceType(_rSet); } @@ -395,7 +396,7 @@ void ODbAdminDialog::clearPassword() m_pImpl->clearPassword(); } //------------------------------------------------------------------------- -SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ODsnTypeCollection* _pTypeCollection) +SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection) { // just to be sure .... _rpSet = NULL; @@ -408,7 +409,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp SfxPoolItem** pCounter = _rppDefaults; // want to modify this without affecting the out param _rppDefaults *pCounter++ = new SfxStringItem(DSID_NAME, String()); *pCounter++ = new SfxStringItem(DSID_ORIGINALNAME, String()); - *pCounter++ = new SfxStringItem(DSID_CONNECTURL, _pTypeCollection ? _pTypeCollection->getDatasourcePrefix( DST_ADABAS ) : String()); + *pCounter++ = new SfxStringItem(DSID_CONNECTURL, _pTypeCollection ? _pTypeCollection->getDatasourcePrefix( ::dbaccess::DST_ADABAS ) : String()); *pCounter++ = new OStringListItem(DSID_TABLEFILTER, Sequence< ::rtl::OUString >(&sFilterAll, 1)); *pCounter++ = new DbuTypeCollectionItem(DSID_TYPECOLLECTION, _pTypeCollection); *pCounter++ = new SfxBoolItem(DSID_INVALID_SELECTION, sal_False); diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 2f5ddfb15ddb..ae2e827616ac 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbwiz.cxx,v $ - * $Revision: 1.21 $ + * $Revision: 1.21.68.1 $ * * This file is part of OpenOffice.org. * @@ -169,12 +169,12 @@ IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage) m_eType = _pTabPage->GetSelectedType(); switch(m_eType) { - case DST_MOZILLA: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_EVOLUTION: - case DST_KAB: - case DST_MACAB: + case ::dbaccess::DST_MOZILLA: + case ::dbaccess::DST_OUTLOOK: + case ::dbaccess::DST_OUTLOOKEXP: + case ::dbaccess::DST_EVOLUTION: + case ::dbaccess::DST_KAB: + case ::dbaccess::DST_MACAB: enableButtons(WZB_NEXT,sal_False); enableButtons(WZB_FINISH,sal_True); break; @@ -194,12 +194,12 @@ WizardTypes::WizardState ODbTypeWizDialog::determineNextState( WizardState _nCur case START_PAGE: switch(m_eType) { - case DST_MOZILLA: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_EVOLUTION: - case DST_KAB: - case DST_MACAB: + case ::dbaccess::DST_MOZILLA: + case ::dbaccess::DST_OUTLOOK: + case ::dbaccess::DST_OUTLOOKEXP: + case ::dbaccess::DST_EVOLUTION: + case ::dbaccess::DST_KAB: + case ::dbaccess::DST_MACAB: nNextState = WZS_INVALID_STATE; break; default: @@ -210,47 +210,47 @@ WizardTypes::WizardState ODbTypeWizDialog::determineNextState( WizardState _nCur case CONNECTION_PAGE: switch(m_eType) { - case DST_MOZILLA: - case DST_THUNDERBIRD: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_EVOLUTION: - case DST_KAB: - case DST_MACAB: - case DST_MSACCESS: - case DST_MSACCESS_2007: - case DST_JDBC: - case DST_CALC: + case ::dbaccess::DST_MOZILLA: + case ::dbaccess::DST_THUNDERBIRD: + case ::dbaccess::DST_OUTLOOK: + case ::dbaccess::DST_OUTLOOKEXP: + case ::dbaccess::DST_EVOLUTION: + case ::dbaccess::DST_KAB: + case ::dbaccess::DST_MACAB: + case ::dbaccess::DST_MSACCESS: + case ::dbaccess::DST_MSACCESS_2007: + case ::dbaccess::DST_JDBC: + case ::dbaccess::DST_CALC: nNextState = WZS_INVALID_STATE; break; - case DST_DBASE: + case ::dbaccess::DST_DBASE: nNextState = ADDITIONAL_PAGE_DBASE; break; - case DST_FLAT: + case ::dbaccess::DST_FLAT: nNextState = ADDITIONAL_PAGE_FLAT; break; - case DST_LDAP: + case ::dbaccess::DST_LDAP: nNextState = ADDITIONAL_PAGE_LDAP; break; - case DST_ADABAS: + case ::dbaccess::DST_ADABAS: nNextState = ADDITIONAL_PAGE_ADABAS; break; - case DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_NATIVE: nNextState = ADDITIONAL_PAGE_MYSQL_NATIVE; break; - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_JDBC: nNextState = ADDITIONAL_PAGE_MYSQL_JDBC; break; - case DST_MYSQL_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: nNextState = ADDITIONAL_PAGE_MYSQL_ODBC; break; - case DST_ORACLE_JDBC: + case ::dbaccess::DST_ORACLE_JDBC: nNextState = ADDITIONAL_PAGE_ORACLE_JDBC; break; - case DST_ADO: + case ::dbaccess::DST_ADO: nNextState = ADDITIONAL_PAGE_ADO; break; - case DST_ODBC: + case ::dbaccess::DST_ODBC: nNextState = ADDITIONAL_PAGE_ODBC; break; default: @@ -289,7 +289,7 @@ Reference< XDriver > ODbTypeWizDialog::getDriver() return m_pImpl->getDriver(); } // ----------------------------------------------------------------------------- -DATASOURCE_TYPE ODbTypeWizDialog::getDatasourceType(const SfxItemSet& _rSet) const +::dbaccess::DATASOURCE_TYPE ODbTypeWizDialog::getDatasourceType(const SfxItemSet& _rSet) const { return m_pImpl->getDatasourceType(_rSet); } diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index cc1d11b7daa1..e151f2214d4b 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbwizsetup.cxx,v $ - * $Revision: 1.35 $ + * $Revision: 1.35.8.1 $ * * This file is part of OpenOffice.org. * @@ -37,6 +37,7 @@ #include "dbadminsetup.hrc" #include "dbu_dlg.hrc" #include "dsitems.hxx" +#include "dsnItem.hxx" #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX #include @@ -282,8 +283,8 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP ) , m_pOutSet(NULL) - , m_eType( DST_UNKNOWN ) - , m_eOldType( DST_UNKNOWN ) + , m_eType( ::dbaccess::DST_UNKNOWN ) + , m_eOldType( ::dbaccess::DST_UNKNOWN ) , m_bResetting(sal_False) , m_bApplied(sal_False) , m_bUIEnabled( sal_True ) @@ -333,31 +334,31 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent enableButtons(WZB_FINISH, sal_True); enableAutomaticNextButtonState(); - declareAuthDepPath( DST_ADO, ADO_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_DBASE, DBASE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_DBASE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_FLAT, TEXT_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_TEXT, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_ADO, ADO_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_DBASE, DBASE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_DBASE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_FLAT, TEXT_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_TEXT, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); declarePath ( SPREADSHEET_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_SPREADSHEET, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_ODBC, ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_JDBC, JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MYSQL_ODBC, MYSQL_ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MYSQL_JDBC, MYSQL_JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_NATIVE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_ORACLE_JDBC, ORACLE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ORACLE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_ADABAS, ADABAS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADABAS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_LDAP, LDAP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_LDAP, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MSACCESS, MSACCESS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MSACCESS_2007, MSACCESS2007_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_OUTLOOKEXP, OUTLOOKEXP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_OUTLOOK, OUTLOOK_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MOZILLA, MOZILLA_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_THUNDERBIRD, THUNDERBIRD_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_EVOLUTION, EVOLUTION_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_EVOLUTION_GROUPWISE,EVOLUTION_PATH_GROUPWISE, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_KAB, KAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_MACAB, MACAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1); + declareAuthDepPath( ::dbaccess::DST_ODBC, ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_JDBC, JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MYSQL_ODBC, MYSQL_ODBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_ODBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MYSQL_JDBC, MYSQL_JDBC_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_JDBC, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_NATIVE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_ORACLE_JDBC, ORACLE_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ORACLE, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_ADABAS, ADABAS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_ADABAS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_LDAP, LDAP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_LDAP, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MSACCESS, MSACCESS_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MSACCESS_2007, MSACCESS2007_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_OUTLOOKEXP, OUTLOOKEXP_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_OUTLOOK, OUTLOOK_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MOZILLA, MOZILLA_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_THUNDERBIRD, THUNDERBIRD_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_EVOLUTION, EVOLUTION_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_EVOLUTION_GROUPWISE,EVOLUTION_PATH_GROUPWISE, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_KAB, KAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_MACAB, MACAB_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1); declareAuthDepPath( getDefaultDatabaseType(),CREATENEW_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); - declareAuthDepPath( DST_USERDEFINE1, USERDEFINED_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_USERDEFINED,PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); + declareAuthDepPath( ::dbaccess::DST_USERDEFINE1, USERDEFINED_PATH, PAGE_DBSETUPWIZARD_INTRO, PAGE_DBSETUPWIZARD_USERDEFINED,PAGE_DBSETUPWIZARD_AUTHENTIFICATION, PAGE_DBSETUPWIZARD_FINAL, -1 ); declarePath ( OPEN_DOC_PATH, PAGE_DBSETUPWIZARD_INTRO, -1 ); m_pPrevPage->SetHelpId(HID_DBWIZ_PREVIOUS); @@ -369,7 +370,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent ActivatePage(); } -void ODbTypeWizDialogSetup::declareAuthDepPath( DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... ) +void ODbTypeWizDialogSetup::declareAuthDepPath( ::dbaccess::DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... ) { bool bHasAuthentication = DataSourceMetaData::getAuthentication( _eType ) != AuthNone; @@ -491,47 +492,47 @@ void ODbTypeWizDialogSetup::activateDatabasePath() case OGeneralPage::eConnectExternal: { m_eType = VerifyDataSourceType(m_pGeneralPage->GetSelectedType()); - if (m_eType == DST_UNKNOWN) + if (m_eType == ::dbaccess::DST_UNKNOWN) m_eType = m_eOldType; struct _map_type_to_path { - DATASOURCE_TYPE eType; + ::dbaccess::DATASOURCE_TYPE eType; RoadmapWizardTypes::PathId nPathId; } aKnownTypesAndPaths[] = { - { DST_DBASE, DBASE_PATH }, - { DST_ADO, ADO_PATH }, - { DST_FLAT, TEXT_PATH }, - { DST_CALC, SPREADSHEET_PATH }, - { DST_ODBC, ODBC_PATH }, - { DST_JDBC, JDBC_PATH }, - { DST_MYSQL_JDBC, MYSQL_JDBC_PATH }, - { DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH }, - { DST_MYSQL_ODBC, MYSQL_ODBC_PATH }, - { DST_ORACLE_JDBC, ORACLE_PATH }, - { DST_ADABAS, ADABAS_PATH }, - { DST_LDAP, LDAP_PATH }, - { DST_MSACCESS, MSACCESS_PATH }, - { DST_MSACCESS_2007,MSACCESS2007_PATH }, - { DST_OUTLOOKEXP, OUTLOOKEXP_PATH }, - { DST_OUTLOOK, OUTLOOK_PATH }, - { DST_MOZILLA, MOZILLA_PATH }, - { DST_THUNDERBIRD, THUNDERBIRD_PATH }, - { DST_EVOLUTION, EVOLUTION_PATH }, - { DST_EVOLUTION_GROUPWISE, EVOLUTION_PATH_GROUPWISE }, - { DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP }, - { DST_KAB, KAB_PATH }, - { DST_MACAB, MACAB_PATH }, - { DST_USERDEFINE1, USERDEFINED_PATH }, - { DST_USERDEFINE2, USERDEFINED_PATH }, - { DST_USERDEFINE3, USERDEFINED_PATH }, - { DST_USERDEFINE4, USERDEFINED_PATH }, - { DST_USERDEFINE5, USERDEFINED_PATH }, - { DST_USERDEFINE6, USERDEFINED_PATH }, - { DST_USERDEFINE7, USERDEFINED_PATH }, - { DST_USERDEFINE8, USERDEFINED_PATH }, - { DST_USERDEFINE9, USERDEFINED_PATH }, - { DST_USERDEFINE10, USERDEFINED_PATH } + { ::dbaccess::DST_DBASE, DBASE_PATH }, + { ::dbaccess::DST_ADO, ADO_PATH }, + { ::dbaccess::DST_FLAT, TEXT_PATH }, + { ::dbaccess::DST_CALC, SPREADSHEET_PATH }, + { ::dbaccess::DST_ODBC, ODBC_PATH }, + { ::dbaccess::DST_JDBC, JDBC_PATH }, + { ::dbaccess::DST_MYSQL_JDBC, MYSQL_JDBC_PATH }, + { ::dbaccess::DST_MYSQL_NATIVE, MYSQL_NATIVE_PATH }, + { ::dbaccess::DST_MYSQL_ODBC, MYSQL_ODBC_PATH }, + { ::dbaccess::DST_ORACLE_JDBC, ORACLE_PATH }, + { ::dbaccess::DST_ADABAS, ADABAS_PATH }, + { ::dbaccess::DST_LDAP, LDAP_PATH }, + { ::dbaccess::DST_MSACCESS, MSACCESS_PATH }, + { ::dbaccess::DST_MSACCESS_2007,MSACCESS2007_PATH }, + { ::dbaccess::DST_OUTLOOKEXP, OUTLOOKEXP_PATH }, + { ::dbaccess::DST_OUTLOOK, OUTLOOK_PATH }, + { ::dbaccess::DST_MOZILLA, MOZILLA_PATH }, + { ::dbaccess::DST_THUNDERBIRD, THUNDERBIRD_PATH }, + { ::dbaccess::DST_EVOLUTION, EVOLUTION_PATH }, + { ::dbaccess::DST_EVOLUTION_GROUPWISE, EVOLUTION_PATH_GROUPWISE }, + { ::dbaccess::DST_EVOLUTION_LDAP, EVOLUTION_PATH_LDAP }, + { ::dbaccess::DST_KAB, KAB_PATH }, + { ::dbaccess::DST_MACAB, MACAB_PATH }, + { ::dbaccess::DST_USERDEFINE1, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE2, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE3, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE4, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE5, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE6, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE7, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE8, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE9, USERDEFINED_PATH }, + { ::dbaccess::DST_USERDEFINE10, USERDEFINED_PATH } }; size_t i = 0; @@ -591,15 +592,15 @@ sal_Bool ODbTypeWizDialogSetup::IsConnectionUrlRequired() { switch ( m_eType ) { - case DST_KAB: - case DST_MACAB: - case DST_EVOLUTION: - case DST_EVOLUTION_GROUPWISE: - case DST_EVOLUTION_LDAP: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_MOZILLA: - case DST_THUNDERBIRD: + case ::dbaccess::DST_KAB: + case ::dbaccess::DST_MACAB: + case ::dbaccess::DST_EVOLUTION: + case ::dbaccess::DST_EVOLUTION_GROUPWISE: + case ::dbaccess::DST_EVOLUTION_LDAP: + case ::dbaccess::DST_OUTLOOK: + case ::dbaccess::DST_OUTLOOKEXP: + case ::dbaccess::DST_MOZILLA: + case ::dbaccess::DST_THUNDERBIRD: return sal_False; default: return sal_True; @@ -650,21 +651,21 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver() } -DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const DATASOURCE_TYPE _DatabaseType) const +::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE _DatabaseType) const { - DATASOURCE_TYPE LocDatabaseType = _DatabaseType; - if ((LocDatabaseType == DST_MYSQL_JDBC) || (LocDatabaseType == DST_MYSQL_ODBC) || (LocDatabaseType == DST_MYSQL_NATIVE)) + ::dbaccess::DATASOURCE_TYPE LocDatabaseType = _DatabaseType; + if ((LocDatabaseType == ::dbaccess::DST_MYSQL_JDBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_ODBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_NATIVE)) { if (m_pMySQLIntroPage != NULL) { switch( m_pMySQLIntroPage->getMySQLMode() ) { case OMySQLIntroPageSetup::VIA_JDBC: - return DST_MYSQL_JDBC; + return ::dbaccess::DST_MYSQL_JDBC; case OMySQLIntroPageSetup::VIA_NATIVE: - return DST_MYSQL_NATIVE; + return ::dbaccess::DST_MYSQL_NATIVE; case OMySQLIntroPageSetup::VIA_ODBC: - return DST_MYSQL_ODBC; + return ::dbaccess::DST_MYSQL_ODBC; } } } @@ -674,9 +675,9 @@ DATASOURCE_TYPE ODbTypeWizDialogSetup::VerifyDataSourceType(const DATASOURCE_TYP // ----------------------------------------------------------------------------- -DATASOURCE_TYPE ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const +::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const { - DATASOURCE_TYPE LocDatabaseType = m_pImpl->getDatasourceType(_rSet); + ::dbaccess::DATASOURCE_TYPE LocDatabaseType = m_pImpl->getDatasourceType(_rSet); return VerifyDataSourceType(LocDatabaseType); } @@ -724,16 +725,16 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState) break; case PAGE_DBSETUPWIZARD_MYSQL_ODBC: - m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_ODBC))); + m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_ODBC))); pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet); break; case PAGE_DBSETUPWIZARD_MYSQL_JDBC: - m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_JDBC))); + m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_JDBC))); pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( this, *m_pOutSet); break; case PAGE_DBSETUPWIZARD_MYSQL_NATIVE: - m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_MYSQL_NATIVE))); + m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_MYSQL_NATIVE))); pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLNATIVETabPage( this, *m_pOutSet); break; @@ -812,16 +813,16 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplModifiedHdl, OGenericAdministrationPage*, _ // ----------------------------------------------------------------------------- IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, /*_pMySQLIntroPageSetup*/) { - const DATASOURCE_TYPE eType = getDatasourceType(*m_pOutSet); + const ::dbaccess::DATASOURCE_TYPE eType = getDatasourceType(*m_pOutSet); switch( eType ) { - case DST_MYSQL_ODBC: + case ::dbaccess::DST_MYSQL_ODBC: activatePath( MYSQL_ODBC_PATH, sal_True); break; - case DST_MYSQL_JDBC: + case ::dbaccess::DST_MYSQL_JDBC: activatePath( MYSQL_JDBC_PATH, sal_True); break; - case DST_MYSQL_NATIVE: + case ::dbaccess::DST_MYSQL_NATIVE: activatePath( MYSQL_NATIVE_PATH, sal_True); break; default: @@ -887,7 +888,7 @@ sal_Bool ODbTypeWizDialogSetup::leaveState(WizardState _nState) return sal_True; if ( _nState == PAGE_DBSETUPWIZARD_INTRO ) { - OSL_ENSURE(m_eType != DST_UNKNOWN && m_eOldType != DST_UNKNOWN,"Type unknown"); + OSL_ENSURE(m_eType != ::dbaccess::DST_UNKNOWN && m_eOldType != ::dbaccess::DST_UNKNOWN,"Type unknown"); if ( m_eType != m_eOldType ) resetPages(m_pImpl->getCurrentDataSource()); } @@ -1023,14 +1024,14 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() } //------------------------------------------------------------------------- - DATASOURCE_TYPE ODbTypeWizDialogSetup::getDefaultDatabaseType() const + ::dbaccess::DATASOURCE_TYPE ODbTypeWizDialogSetup::getDefaultDatabaseType() const { - DATASOURCE_TYPE eRet = DST_DBASE; + ::dbaccess::DATASOURCE_TYPE eRet = ::dbaccess::DST_DBASE; - ::rtl::OUString sURL = m_pCollection->getDatasourcePrefix( DST_EMBEDDED_HSQLDB ); + ::rtl::OUString sURL = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_EMBEDDED_HSQLDB ); Reference< XDriverAccess > xDriverManager( getORB()->createInstance( SERVICE_SDBC_DRIVERMANAGER ), UNO_QUERY ); if ( xDriverManager.is() && xDriverManager->getDriverByURL( sURL ).is() ) - eRet = DST_EMBEDDED_HSQLDB; + eRet = ::dbaccess::DST_EMBEDDED_HSQLDB; return eRet; } @@ -1039,23 +1040,23 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() void ODbTypeWizDialogSetup::CreateDatabase() { ::rtl::OUString sUrl; - DATASOURCE_TYPE eType = getDefaultDatabaseType(); - if ( eType == DST_EMBEDDED_HSQLDB ) + ::dbaccess::DATASOURCE_TYPE eType = getDefaultDatabaseType(); + if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB ) { - sUrl = m_pCollection->getDatasourcePrefix( DST_EMBEDDED_HSQLDB ); + sUrl = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_EMBEDDED_HSQLDB ); Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource(); OSL_ENSURE(xDatasource.is(),"DataSource is null!"); if ( xDatasource.is() ) - xDatasource->setPropertyValue( PROPERTY_INFO, makeAny( m_pCollection->getDefaultDBSettings( DST_EMBEDDED_HSQLDB ) ) ); + xDatasource->setPropertyValue( PROPERTY_INFO, makeAny( m_pCollection->getDefaultDBSettings( ::dbaccess::DST_EMBEDDED_HSQLDB ) ) ); m_pImpl->translateProperties(xDatasource,*m_pOutSet); } - if ( eType == DST_DBASE ) + if ( eType == ::dbaccess::DST_DBASE ) { Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY); INetURLObject aDBPathURL(m_sWorkPath); aDBPathURL.Append(m_aDocURL.getBase()); createUniqueFolderName(&aDBPathURL); - ::rtl::OUString sPrefix = m_pCollection->getDatasourcePrefix(DST_DBASE); + ::rtl::OUString sPrefix = m_pCollection->getDatasourcePrefix( ::dbaccess::DST_DBASE); sUrl = aDBPathURL.GetMainURL( INetURLObject::NO_DECODE); xSimpleFileAccess->createFolder(sUrl); //OFileNotation aFileNotation(sUrl); diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index e461f478a4cc..1dc117fc474a 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: detailpages.cxx,v $ - * $Revision: 1.53 $ + * $Revision: 1.53.18.1 $ * * This file is part of OpenOffice.org. * @@ -39,6 +39,7 @@ #include "dsitems.hxx" #include "dbfindex.hxx" #include "localresaccess.hxx" +#include "dsnItem.hxx" #include "dbaccess_helpid.hrc" #include "dbu_dlg.hrc" @@ -311,7 +312,7 @@ namespace dbaui // get the DSN string (needed for the index dialog) SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); - ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; + ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL; if (pTypeCollection && pUrlItem && pUrlItem->GetValue().Len()) m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue()); @@ -1058,7 +1059,7 @@ namespace dbaui //------------------------------------------------------------------------ SfxTabPage* ODriversSettings::CreateSpecialSettingsPage( Window* _pParent, const SfxItemSet& _rAttrSet ) { - DATASOURCE_TYPE eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet ); + ::dbaccess::DATASOURCE_TYPE eType = ODbDataSourceAdministrationHelper::getDatasourceType( _rAttrSet ); DataSourceMetaData aMetaData( eType ); return new SpecialSettingsPage( _pParent, _rAttrSet, aMetaData ); } diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index 85c7adb2920e..7c67ebda24bf 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dsselect.cxx,v $ - * $Revision: 1.23 $ + * $Revision: 1.23.68.1 $ * * This file is part of OpenOffice.org. * @@ -107,7 +107,7 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::ui::dialogs; using namespace ::comphelper; //================================================================== -ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringBag& _rDatasources, DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet) +ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringBag& _rDatasources, ::dbaccess::DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet) :ModalDialog(_pParent, ModuleRes(DLG_DATASOURCE_SELECTION)) ,m_aDescription (this, ModuleRes(FT_DESCRIPTION)) ,m_aDatasource (this, ModuleRes(LB_DATASOURCE)) @@ -120,7 +120,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB ,m_aCreateAdabasDB (this, ModuleRes(PB_CREATE)) ,m_pOutputSet(_pOutputSet) { - if (DST_ADABAS == _eType) + if ( ::dbaccess::DST_ADABAS == _eType) { // set a new title (indicating that we're browsing local data sources only) SetText(ModuleRes(STR_LOCAL_DATASOURCES)); m_aDescription.SetText(ModuleRes(STR_DESCRIPTION2)); @@ -158,7 +158,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB fillListBox(_rDatasources); #ifdef HAVE_ODBC_ADMINISTRATION // allow ODBC datasource managenment - if ( DST_ODBC == _eType || DST_MYSQL_ODBC == _eType ) + if ( ::dbaccess::DST_ODBC == _eType || ::dbaccess::DST_MYSQL_ODBC == _eType ) { m_aManageDatasources.Show(); m_aManageDatasources.Enable(); diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index d5b0fe9e8b4e..0a2bb0e7fe0a 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dsselect.hxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.68.1 $ * * This file is part of OpenOffice.org. * @@ -72,7 +72,7 @@ protected: #endif public: - ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet = NULL ); + ODatasourceSelectDialog( Window* _pParent, const StringBag& _rDatasources, ::dbaccess::DATASOURCE_TYPE _eType,SfxItemSet* _pOutputSet = NULL ); ~ODatasourceSelectDialog(); inline String GetSelected() const { return m_aDatasource.GetSelectEntry();} diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 79e1f50854e2..63a914b8b3c7 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: generalpage.cxx,v $ - * $Revision: 1.57 $ + * $Revision: 1.56.68.2 $ * * This file is part of OpenOffice.org. * @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dsnItem.hxx" #ifndef _DBAUI_GENERALPAGE_HXX_ #include "generalpage.hxx" #endif @@ -119,8 +120,8 @@ namespace dbaui ,m_sMySQLEntry (ModuleRes(STR_MYSQLENTRY)) ,m_eOriginalCreationMode (eCreateNew) ,m_pCollection (NULL) - ,m_eCurrentSelection (DST_UNKNOWN) - ,m_eNotSupportedKnownType (DST_UNKNOWN) + ,m_eCurrentSelection ( ::dbaccess::DST_UNKNOWN) + ,m_eNotSupportedKnownType ( ::dbaccess::DST_UNKNOWN) ,m_eLastMessage (smNone) ,m_bDisplayingInvalid (sal_False) ,m_bUserGrabFocus (sal_True) @@ -158,10 +159,10 @@ namespace dbaui { struct DisplayedType { - DATASOURCE_TYPE eType; + ::dbaccess::DATASOURCE_TYPE eType; String sDisplayName; - DisplayedType( DATASOURCE_TYPE _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } + DisplayedType( ::dbaccess::DATASOURCE_TYPE _eType, const String& _rDisplayName ) : eType( _eType ), sDisplayName( _rDisplayName ) { } }; typedef ::std::vector< DisplayedType > DisplayedTypes; @@ -201,12 +202,12 @@ namespace dbaui { DisplayedTypes aDisplayedTypes; - for ( ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); + for ( ::dbaccess::ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); aTypeLoop != m_pCollection->end(); ++aTypeLoop ) { - DATASOURCE_TYPE eType = aTypeLoop.getType(); + ::dbaccess::DATASOURCE_TYPE eType = aTypeLoop.getType(); if ( xDriverManager.is() ) { // we have a driver manager to check @@ -235,7 +236,7 @@ namespace dbaui //------------------------------------------------------------------------- - void OGeneralPage::setParentTitle(DATASOURCE_TYPE _eSelectedType) + void OGeneralPage::setParentTitle(::dbaccess::DATASOURCE_TYPE _eSelectedType) { if (!m_DBWizardMode) { @@ -271,7 +272,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::switchMessage(const DATASOURCE_TYPE _eType) + void OGeneralPage::switchMessage(const ::dbaccess::DATASOURCE_TYPE _eType) { SPECIAL_MESSAGE eMessage = smNone; if ( _eType == m_eNotSupportedKnownType ) @@ -298,7 +299,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::onTypeSelected(const DATASOURCE_TYPE _eType) + void OGeneralPage::onTypeSelected(const ::dbaccess::DATASOURCE_TYPE _eType) { // the the new URL text as indicated by the selection history implSetCurrentType( _eType ); @@ -381,9 +382,9 @@ namespace dbaui sConnectURL = pUrlItem->GetValue(); } - DATASOURCE_TYPE eOldSelection = m_eCurrentSelection; - m_eNotSupportedKnownType = DST_UNKNOWN; - implSetCurrentType( DST_UNKNOWN ); + ::dbaccess::DATASOURCE_TYPE eOldSelection = m_eCurrentSelection; + m_eNotSupportedKnownType = ::dbaccess::DST_UNKNOWN; + implSetCurrentType( ::dbaccess::DST_UNKNOWN ); // compare the DSN prefix with the registered ones String sDisplayName; @@ -408,7 +409,7 @@ namespace dbaui } if (m_aRB_CreateDatabase.IsChecked() && m_DBWizardMode) - sDisplayName = m_pCollection->getTypeDisplayName(DST_JDBC); + sDisplayName = m_pCollection->getTypeDisplayName( ::dbaccess::DST_JDBC); m_pDatasourceType->SelectEntry(sDisplayName); // notify our listener that our type selection has changed (if so) @@ -427,22 +428,22 @@ namespace dbaui // For the databaseWizard we only have one entry for the MySQL Database, // because we have a seperate tabpage to retrieve the respective datasource type - // (DST_MYSQL_ODBC || DST_MYSQL_JDBC). Therefore we use DST_MYSQL_JDBC as a temporary + // ( ::dbaccess::DST_MYSQL_ODBC || ::dbaccess::DST_MYSQL_JDBC). Therefore we use ::dbaccess::DST_MYSQL_JDBC as a temporary // representative for all MySQl databases) // Also, embedded databases (embedded HSQL, at the moment), are not to appear in the list of // databases to connect to. - bool OGeneralPage::approveDataSourceType( DATASOURCE_TYPE eType, String& _inout_rDisplayName ) + bool OGeneralPage::approveDataSourceType( ::dbaccess::DATASOURCE_TYPE eType, String& _inout_rDisplayName ) { - if ( m_DBWizardMode && ( eType == DST_MYSQL_JDBC ) ) + if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_JDBC ) ) _inout_rDisplayName = m_sMySQLEntry; - else if ( m_DBWizardMode && ( eType == DST_MYSQL_ODBC ) ) + else if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_ODBC ) ) _inout_rDisplayName = String(); - else if ( m_DBWizardMode && ( eType == DST_MYSQL_NATIVE ) ) + else if ( m_DBWizardMode && ( eType == ::dbaccess::DST_MYSQL_NATIVE ) ) _inout_rDisplayName = String(); - else if ( eType == DST_EMBEDDED_HSQLDB ) + else if ( eType == ::dbaccess::DST_EMBEDDED_HSQLDB ) _inout_rDisplayName = String(); return _inout_rDisplayName.Len() > 0; @@ -450,7 +451,7 @@ namespace dbaui // ----------------------------------------------------------------------- - void OGeneralPage::insertDatasourceTypeEntryData(DATASOURCE_TYPE _eType, String sDisplayName) + void OGeneralPage::insertDatasourceTypeEntryData(::dbaccess::DATASOURCE_TYPE _eType, String sDisplayName) { // insert a (temporary) entry sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName); @@ -479,7 +480,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::implSetCurrentType( const DATASOURCE_TYPE _eType ) + void OGeneralPage::implSetCurrentType( const ::dbaccess::DATASOURCE_TYPE _eType ) { if ( _eType == m_eCurrentSelection ) return; @@ -491,7 +492,7 @@ namespace dbaui void OGeneralPage::Reset(const SfxItemSet& _rCoreAttrs) { // reset all locale data - implSetCurrentType( DST_UNKNOWN ); + implSetCurrentType( ::dbaccess::DST_UNKNOWN ); // this ensures that our type selection link will be called, even if the new is is the same as the // current one OGenericAdministrationPage::Reset(_rCoreAttrs); @@ -507,7 +508,7 @@ namespace dbaui { if ( m_aRB_CreateDatabase.IsChecked() ) { - _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix(DST_DBASE))); + _rCoreAttrs.Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getDatasourcePrefix( ::dbaccess::DST_DBASE))); bChangedSomething = sal_True; bCommitTypeSelection = false; } @@ -524,7 +525,7 @@ namespace dbaui if ( bCommitTypeSelection ) { USHORT nEntry = m_pDatasourceType->GetSelectEntryPos(); - DATASOURCE_TYPE eSelectedType = static_cast(reinterpret_cast(m_pDatasourceType->GetEntryData(nEntry))); + ::dbaccess::DATASOURCE_TYPE eSelectedType = static_cast< ::dbaccess::DATASOURCE_TYPE>(reinterpret_cast(m_pDatasourceType->GetEntryData(nEntry))); if (m_DBWizardMode) { if ( ( m_pDatasourceType->GetSavedValue() != nEntry ) @@ -554,7 +555,7 @@ namespace dbaui { // get the type from the entry data sal_Int16 nSelected = _pBox->GetSelectEntryPos(); - DATASOURCE_TYPE eSelectedType = static_cast(reinterpret_cast(_pBox->GetEntryData(nSelected))); + ::dbaccess::DATASOURCE_TYPE eSelectedType = static_cast< ::dbaccess::DATASOURCE_TYPE>(reinterpret_cast(_pBox->GetEntryData(nSelected))); setParentTitle(eSelectedType); // let the impl method do all the stuff diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index fe7c42a92d21..24f89ff3569f 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: generalpage.hxx,v $ - * $Revision: 1.22 $ + * $Revision: 1.22.68.1 $ * * This file is part of OpenOffice.org. * @@ -104,9 +104,10 @@ namespace dbaui m_aControlDependencies; - ODsnTypeCollection* m_pCollection; /// the DSN type collection instance - DATASOURCE_TYPE m_eCurrentSelection; /// currently selected type - DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... + ::dbaccess::ODsnTypeCollection* + m_pCollection; /// the DSN type collection instance + ::dbaccess::DATASOURCE_TYPE m_eCurrentSelection; /// currently selected type + ::dbaccess::DATASOURCE_TYPE m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered .... enum SPECIAL_MESSAGE { @@ -121,8 +122,8 @@ namespace dbaui Link m_aChooseDocumentHandler; /// to be called when a recent document has been definately chosen sal_Bool m_bDisplayingInvalid : 1; // the currently displayed data source is deleted sal_Bool m_bUserGrabFocus : 1; - bool approveDataSourceType( DATASOURCE_TYPE eType, String& _inout_rDisplayName ); - void insertDatasourceTypeEntryData(DATASOURCE_TYPE eType, String sDisplayName); + bool approveDataSourceType( ::dbaccess::DATASOURCE_TYPE eType, String& _inout_rDisplayName ); + void insertDatasourceTypeEntryData(::dbaccess::DATASOURCE_TYPE eType, String sDisplayName); public: static SfxTabPage* Create(Window* pParent, const SfxItemSet& _rAttrSet, sal_Bool _bDBWizardMode = sal_False); @@ -137,7 +138,7 @@ namespace dbaui DocumentDescriptor GetSelectedDocument() const; /// get the currently selected datasource type - DATASOURCE_TYPE GetSelectedType() const { return m_eCurrentSelection; } + ::dbaccess::DATASOURCE_TYPE GetSelectedType() const { return m_eCurrentSelection; } protected: // SfxTabPage overridables @@ -155,15 +156,15 @@ namespace dbaui protected: - void onTypeSelected(const DATASOURCE_TYPE _eType); + void onTypeSelected(const ::dbaccess::DATASOURCE_TYPE _eType); void initializeTypeList(); - void implSetCurrentType( const DATASOURCE_TYPE _eType ); + void implSetCurrentType( const ::dbaccess::DATASOURCE_TYPE _eType ); - void switchMessage(const DATASOURCE_TYPE _eType); + void switchMessage(const ::dbaccess::DATASOURCE_TYPE _eType); /// sets the the title of the parent dialog - void setParentTitle(DATASOURCE_TYPE _eSelectedType); + void setParentTitle(::dbaccess::DATASOURCE_TYPE _eSelectedType); DECL_LINK(OnDatasourceTypeSelected, ListBox*); DECL_LINK(OnSetupModeSelected, RadioButton*); diff --git a/dbaccess/source/ui/inc/AdabasStatDlg.hxx b/dbaccess/source/ui/inc/AdabasStatDlg.hxx index c87aeaef4093..68c95b3500f0 100644 --- a/dbaccess/source/ui/inc/AdabasStatDlg.hxx +++ b/dbaccess/source/ui/inc/AdabasStatDlg.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AdabasStatDlg.hxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.68.1 $ * * This file is part of OpenOffice.org. * @@ -86,7 +86,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual sal_Bool saveDatasource(); virtual void setTitle(const ::rtl::OUString& _sTitle); diff --git a/dbaccess/source/ui/inc/IItemSetHelper.hxx b/dbaccess/source/ui/inc/IItemSetHelper.hxx index ad234fa305d5..c4c2904487fe 100644 --- a/dbaccess/source/ui/inc/IItemSetHelper.hxx +++ b/dbaccess/source/ui/inc/IItemSetHelper.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: IItemSetHelper.hxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.68.1 $ * * This file is part of OpenOffice.org. * @@ -62,7 +62,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const = 0; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection() = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver() = 0; - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const = 0; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const = 0; virtual void clearPassword() = 0; virtual sal_Bool saveDatasource() = 0; virtual void setTitle(const ::rtl::OUString& _sTitle) = 0; diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx index 15b6a03192a4..7ddd30df0aaa 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationTableView.hxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.26.1 $ * * This file is part of OpenOffice.org. * @@ -30,18 +30,24 @@ #ifndef DBAUI_RELATION_TABLEVIEW_HXX #define DBAUI_RELATION_TABLEVIEW_HXX -#ifndef DBAUI_JOINTABLEVIEW_HXX #include "JoinTableView.hxx" -#endif +#include +#include +#include namespace dbaui { class ORelationDesignView; - class ORelationTableView : public OJoinTableView + class ORelationTableView : public ::cppu::BaseMutex + , public OJoinTableView + , public ::comphelper::OContainerListener { OTableConnection* m_pExistingConnection; // is set when a connection was draged on an existing connection TTableConnectionData::value_type m_pCurrentlyTabConnData; // set when we creating a connection with more than one keycolumn - protected: + ::rtl::Reference< comphelper::OContainerListenerAdapter> + m_pContainerListener; + bool m_bInRemove; + virtual void ConnDoubleClicked( OTableConnection* pConnection ); virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE); @@ -51,6 +57,11 @@ namespace dbaui */ virtual bool allowQueries() const; + // OContainerListener + virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + public: ORelationTableView( Window* pParent, ORelationDesignView* pView ); virtual ~ORelationTableView(); diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index 121cd4ce5891..7f9d3bc5eb7e 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableController.hxx,v $ - * $Revision: 1.40 $ + * $Revision: 1.40.68.1 $ * * This file is part of OpenOffice.org. * @@ -60,6 +60,7 @@ #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include #endif +#include "dsntypes.hxx" class FixedText; namespace dbaui @@ -70,10 +71,11 @@ namespace dbaui class OTableController : public OTableController_BASE { private: - OModuleClient m_aModuleClient; + OModuleClient m_aModuleClient; ::std::vector< ::boost::shared_ptr > m_vRowList; - OTypeInfoMap m_aTypeInfo; - ::std::vector m_aTypeInfoIndex; + OTypeInfoMap m_aTypeInfo; + ::std::vector m_aTypeInfoIndex; + ::dbaccess::ODsnTypeCollection m_aTypeCollection; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xTable; @@ -125,7 +127,7 @@ namespace dbaui sal_Bool isAddAllowed() const; sal_Bool isDropAllowed() const; sal_Bool isAlterAllowed() const; - + bool isAutoIncrementPrimaryKey() const; inline sal_Bool isAutoIncrementValueEnabled() const { return m_bAllowAutoIncrementValue; } inline const ::rtl::OUString& getAutoIncrementValue() const { return m_sAutoIncrementValue; } diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 47f4b5f96c4d..075c8e9424fc 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableWindow.hxx,v $ - * $Revision: 1.19 $ + * $Revision: 1.19.68.2 $ * * This file is part of OpenOffice.org. * @@ -30,28 +30,17 @@ #ifndef DBAUI_TABLEWINDOW_HXX #define DBAUI_TABLEWINDOW_HXX -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include -#endif -#ifndef DBAUI_TABLEWINDOWTITLE_HXX #include "TableWindowTitle.hxx" -#endif -#ifndef _RTTI_HXX #include -#endif -#ifndef DBAUI_TABLEWINDOWDATA_HXX +#include #include "TableWindowData.hxx" -#endif #include -#ifndef _SV_WINDOW_HXX #include -#endif -#ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_ -#include -#endif + +#include +#include "cppuhelper/basemutex.hxx" class SvLBoxEntry; namespace dbaui @@ -69,7 +58,9 @@ namespace dbaui class OJoinTableView; class OTableWindowAccess; - class OTableWindow : public Window + class OTableWindow : public ::cppu::BaseMutex + ,public ::comphelper::OContainerListener + ,public Window { friend class OTableWindowTitle; friend class OTableWindowListBox; @@ -83,12 +74,18 @@ namespace dbaui private: TTableWindowData::value_type m_pData; + ::rtl::Reference< comphelper::OContainerListenerAdapter> + m_pContainerListener; sal_Int32 m_nMoveCount; // how often the arrow keys was pressed sal_Int32 m_nMoveIncrement; // how many pixel we should move UINT16 m_nSizingFlags; BOOL m_bActive; void Draw3DBorder( const Rectangle& rRect ); + // OContainerListener + virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); + virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException); protected: virtual void Resize(); diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index de1896e7a4ef..9c78b163358f 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableWindowListBox.hxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.11.68.2 $ * * This file is part of OpenOffice.org. * @@ -30,13 +30,8 @@ #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX #define DBAUI_TABLEWINDOWLISTBOX_HXX -#ifndef _SVTREEBOX_HXX #include -#endif - -#ifndef _DBACCESS_UI_CALLBACKS_HXX_ #include "callbacks.hxx" -#endif struct AcceptDropEvent; struct ExecuteDropEvent; diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 4e900ac49482..297cdceb9b36 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UITools.hxx,v $ - * $Revision: 1.37 $ + * $Revision: 1.37.26.1 $ * * This file is part of OpenOffice.org. * @@ -105,7 +105,7 @@ class SvLBoxEntry; namespace dbaui { // ......................................................................... - class ODsnTypeCollection; + //class ODsnTypeCollection; class DBTreeListBox; /** creates a new connection and appends the eventlistener @@ -369,25 +369,6 @@ namespace dbaui @return the configuration node name of user defined drivers. */ - ::rtl::OUString getUserDefinedDriverNodeName(); - - /** returns the configuration node name of user defined driver type display name. - @return - the configuration node name of user defined driver type display name. - */ - ::rtl::OUString getDriverTypeDisplayNodeName(); - - /** returns the configuration node name of user defined driver DSN prefix. - @return - the configuration node name of user defined driver DSN prefix. - */ - ::rtl::OUString getDriverDsnPrefixNodeName(); - - /** returns the configuration node name of user defined driver extension. - @return - the configuration node name of user defined driver extension. - */ - ::rtl::OUString getDriverExtensionNodeName(); /** returns the result of the user action when view the query dialog. @param _pParent diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx index 736fc65e9d66..0f482be4baf8 100644 --- a/dbaccess/source/ui/inc/UserAdminDlg.hxx +++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UserAdminDlg.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.68.1 $ * * This file is part of OpenOffice.org. * @@ -90,7 +90,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual sal_Bool saveDatasource(); virtual void setTitle(const ::rtl::OUString& _sTitle); diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx index 94a78ba1d5ea..5f690f96893b 100644 --- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx +++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: advancedsettingsdlg.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.68.1 $ * * This file is part of OpenOffice.org. * @@ -72,7 +72,7 @@ namespace dbaui virtual ~AdvancedSettingsDialog(); /// determines whether or not the given data source type has any advanced setting - static bool doesHaveAnyAdvancedSettings( DATASOURCE_TYPE _eType ); + static bool doesHaveAnyAdvancedSettings( ::dbaccess::DATASOURCE_TYPE _eType ); virtual const SfxItemSet* getOutputSet() const; virtual SfxItemSet* getWriteOutputSet(); @@ -83,7 +83,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual sal_Bool saveDatasource(); virtual void setTitle(const ::rtl::OUString& _sTitle); diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index db3a95b9ae47..1a4570512ec0 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: curledit.hxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.68.1 $ * * This file is part of OpenOffice.org. * @@ -55,7 +55,8 @@ namespace dbaui */ class OConnectionURLEdit : public Edit { - ODsnTypeCollection m_aTypeCollection; + ::dbaccess::ODsnTypeCollection + m_aTypeCollection; FixedText* m_pForcedPrefix; String m_sSaveValueNoPrefix; BOOL m_bShowPrefix; // when the prefix will be visible, otherwise not diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index aa00cec1a92f..94bfb2633c9e 100644 --- a/dbaccess/source/ui/inc/dbadmin.hxx +++ b/dbaccess/source/ui/inc/dbadmin.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbadmin.hxx,v $ - * $Revision: 1.36 $ + * $Revision: 1.36.68.1 $ * * This file is part of OpenOffice.org. * @@ -43,7 +43,6 @@ #ifndef _COMPHELPER_UNO3_HXX_ #include #endif - #include FORWARD_DECLARE_INTERFACE(beans,XPropertySet) @@ -55,8 +54,6 @@ namespace dbaui { //......................................................................... -class ODsnTypeCollection; - //========================================================================= //= ODbAdminDialog //========================================================================= @@ -90,7 +87,7 @@ public: @param _pTypeCollection pointer to an ODatasourceMap. May be NULL, in this case the pool will not contain a typecollection default. */ - static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ODsnTypeCollection* _pTypeCollection); + static SfxItemSet* createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults, ::dbaccess::ODsnTypeCollection* _pTypeCollection); /** destroy and item set / item pool / pool defaults previously created by createItemSet */ static void destroyItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rpPool, SfxPoolItem**& _rppDefaults); @@ -108,7 +105,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual sal_Bool saveDatasource(); virtual void setTitle(const ::rtl::OUString& _sTitle); diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 0d4a39731633..4c60de3e9c8e 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbu_resource.hrc,v $ - * $Revision: 1.104 $ + * $Revision: 1.104.68.1 $ * * This file is part of OpenOffice.org. * @@ -390,7 +390,7 @@ //======================================================================== // untyped resources -#define RSC_DATASOURCE_TYPES RID_UNTYPED_START + 1 +// free #define RSC_CHARSETS RID_UNTYPED_START + 2 #define RSC_DATASOURCE_TYPE_UINAMES RID_UNTYPED_START + 3 #define RSC_QUERY_OBJECT_TYPE RID_UNTYPED_START + 4 diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx index 5a923b17ccbb..c0526a0d7533 100644 --- a/dbaccess/source/ui/inc/dbwiz.hxx +++ b/dbaccess/source/ui/inc/dbwiz.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbwiz.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.68.1 $ * * This file is part of OpenOffice.org. * @@ -55,13 +55,15 @@ FORWARD_DECLARE_INTERFACE(beans,XPropertySet) FORWARD_DECLARE_INTERFACE(sdbc,XConnection) FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory) +namespace dbaccess +{ + class ODsnTypeCollection; +} //......................................................................... namespace dbaui { //......................................................................... -class ODsnTypeCollection; - //========================================================================= //= ODbTypeWizDialog //========================================================================= @@ -75,7 +77,7 @@ private: OModuleClient m_aModuleClient; ::std::auto_ptr m_pImpl; SfxItemSet* m_pOutSet; - DATASOURCE_TYPE m_eType; + ::dbaccess::DATASOURCE_TYPE m_eType; sal_Bool m_bResetting : 1; /// sal_True while we're resetting the pages sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing @@ -99,7 +101,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual sal_Bool saveDatasource(); virtual void setTitle(const ::rtl::OUString& _sTitle); diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index 326356621e22..b25bbad01a8e 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbwizsetup.hxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.68.1 $ * * This file is part of OpenOffice.org. * @@ -66,7 +66,6 @@ namespace dbaui { //......................................................................... -class ODsnTypeCollection; class OGenericAdministrationPage; //========================================================================= @@ -85,8 +84,8 @@ private: OModuleClient m_aModuleClient; ::std::auto_ptr m_pImpl; SfxItemSet* m_pOutSet; - DATASOURCE_TYPE m_eType; - DATASOURCE_TYPE m_eOldType; + ::dbaccess::DATASOURCE_TYPE m_eType; + ::dbaccess::DATASOURCE_TYPE m_eOldType; sal_Bool m_bResetting : 1; /// sal_True while we're resetting the pages sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing sal_Bool m_bUIEnabled : 1; /// if the UI is enabled, false otherwise. Cannot be switched back to , once it is @@ -109,7 +108,8 @@ private: String m_sWorkPath; OGeneralPage* m_pGeneralPage; OMySQLIntroPageSetup* m_pMySQLIntroPage; - ODsnTypeCollection* m_pCollection; /// the DSN type collection instance + ::dbaccess::ODsnTypeCollection* + m_pCollection; /// the DSN type collection instance @@ -131,7 +131,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const; virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); - virtual DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + virtual ::dbaccess::DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; virtual void clearPassword(); virtual void setTitle(const ::rtl::OUString& _sTitle); virtual void enableConfirmSettings( bool _bEnable ); @@ -182,7 +182,7 @@ private: the first state in this path, following by an arbitrary number of others, as in RoadmapWizard::declarePath. */ - void declareAuthDepPath( DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... ); + void declareAuthDepPath( ::dbaccess::DATASOURCE_TYPE _eType, PathId _nPathId, WizardState _nFirstState, ... ); void RegisterDataSourceByLocation(const ::rtl::OUString& sPath); sal_Bool SaveDatabaseDocument(); @@ -190,9 +190,9 @@ private: String createUniqueFileName(const INetURLObject& rURL); void CreateDatabase(); void createUniqueFolderName(INetURLObject* pURL); - DATASOURCE_TYPE VerifyDataSourceType(const DATASOURCE_TYPE _DatabaseType) const; + ::dbaccess::DATASOURCE_TYPE VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE _DatabaseType) const; - DATASOURCE_TYPE getDefaultDatabaseType() const; + ::dbaccess::DATASOURCE_TYPE getDefaultDatabaseType() const; void updateTypeDependentStates(); sal_Bool callSaveAsDialog(); diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index 866d2cc8c65f..174d42803086 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dsmeta.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.68.2 $ * * This file is part of OpenOffice.org. * @@ -70,7 +70,7 @@ namespace dbaui class DataSourceMetaData { public: - DataSourceMetaData( DATASOURCE_TYPE _eType ); + DataSourceMetaData( ::dbaccess::DATASOURCE_TYPE _eType ); ~DataSourceMetaData(); /// returns a struct describing this data source type's support for our known advanced settings @@ -79,7 +79,7 @@ namespace dbaui /// determines whether or not the data source requires authentication AuthenticationMode getAuthentication() const; - static AuthenticationMode getAuthentication( DATASOURCE_TYPE _eType ); + static AuthenticationMode getAuthentication( ::dbaccess::DATASOURCE_TYPE _eType ); private: ::boost::shared_ptr< DataSourceMetaData_Impl > m_pImpl; @@ -108,6 +108,7 @@ namespace dbaui bool bBooleanComparisonMode; bool bFormsCheckRequiredFields; bool bIgnoreCurrency; + bool bAutoIncrementIsPrimaryKey; // Note: If you extend this list, you need to adjust the ctor (of course) // and (maybe) the implementation of supportsAnySpecialSetting @@ -127,6 +128,7 @@ namespace dbaui ,bBooleanComparisonMode ( true ) ,bFormsCheckRequiredFields ( true ) ,bIgnoreCurrency ( false ) + ,bAutoIncrementIsPrimaryKey ( false ) { } @@ -152,7 +154,9 @@ namespace dbaui || ( bUseDOSLineEnds == true ) || ( bBooleanComparisonMode == true ) || ( bFormsCheckRequiredFields == true ) - || ( bIgnoreCurrency == true ); + || ( bIgnoreCurrency == true ) + || ( bAutoIncrementIsPrimaryKey == true ) + ; } //........................................................................ diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx index 6bf62063b3c2..17f44436ec22 100644 --- a/dbaccess/source/ui/inc/unoadmin.hxx +++ b/dbaccess/source/ui/inc/unoadmin.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: unoadmin.hxx,v $ - * $Revision: 1.13 $ + * $Revision: 1.13.68.1 $ * * This file is part of OpenOffice.org. * @@ -67,7 +67,8 @@ protected: SfxItemSet* m_pDatasourceItems; // item set for the dialog SfxItemPool* m_pItemPool; // item pool for the item set for the dialog SfxPoolItem** m_pItemPoolDefaults; // pool defaults - ODsnTypeCollection* m_pCollection; // datasource type collection + ::dbaccess::ODsnTypeCollection* + m_pCollection; // datasource type collection ::com::sun::star::uno::Any m_aInitialSelection; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index e689f7b26431..3e026d4e5116 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: UITools.cxx,v $ - * $Revision: 1.81 $ + * $Revision: 1.81.24.1 $ * * This file is part of OpenOffice.org. * @@ -1627,30 +1627,6 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType return pTypeInfo; } // ----------------------------------------------------------------------------- -::rtl::OUString getUserDefinedDriverNodeName() -{ - static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/UserDefinedDriverSettings")); - return s_sNodeName; -} -// ----------------------------------------------------------------------------- -::rtl::OUString getDriverTypeDisplayNodeName() -{ - static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DriverTypeDisplayName")); - return s_sNodeName; -} -// ----------------------------------------------------------------------------- -::rtl::OUString getDriverDsnPrefixNodeName() -{ - static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DriverDsnPrefix")); - return s_sNodeName; -} -// ----------------------------------------------------------------------------- -::rtl::OUString getDriverExtensionNodeName() -{ - static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("Extension")); - return s_sNodeName; -} -// ----------------------------------------------------------------------------- sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) { vos::OGuard aGuard( Application::GetSolarMutex() ); diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx index c062736de285..cfed1e3d1ddd 100644 --- a/dbaccess/source/ui/misc/charsets.cxx +++ b/dbaccess/source/ui/misc/charsets.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: charsets.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.68.1 $ * * This file is part of OpenOffice.org. * @@ -37,9 +37,6 @@ #ifndef _TOOLS_DEBUG_HXX #include #endif -#ifndef _DBU_MISCRES_HRC_ -#include "dbumiscres.hrc" -#endif #ifndef _DBU_MISC_HRC_ #include "dbu_misc.hrc" #endif diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index ca0551abc0df..f58b0b8b23ba 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dbumiscres.src,v $ - * $Revision: 1.80 $ + * $Revision: 1.80.68.1 $ * * This file is part of OpenOffice.org. * @@ -31,210 +31,7 @@ #ifndef _DBU_MISC_HRC_ #include "dbu_misc.hrc" #endif -#ifndef _DBU_MISCRES_HRC_ -#include "dbumiscres.hrc" -#endif -//------------------------------------------------------------------------- -Resource RSC_DATASOURCE_TYPES -{ - String STR_MYSQL_ODBC - { - Text ="sdbc:mysql:odbc:"; - }; - String STR_MYSQL_JDBC - { - Text ="sdbc:mysql:jdbc:"; - }; - String STR_ADABAS - { - Text ="sdbc:adabas:"; - }; - String STR_ORACLE_JDBC - { - Text ="jdbc:oracle:thin:"; - }; - String STR_JDBC - { - Text ="jdbc:"; - }; - String STR_ODBC - { - Text ="sdbc:odbc:"; - }; - String STR_DBASE - { - Text ="sdbc:dbase:"; - }; - String STR_MSACCESS - { - Text ="sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="; - }; - String STR_MSACCESS2007 - { - Text ="sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="; - }; - String STR_ADO - { - Text ="sdbc:ado:"; - }; - String STR_FLAT - { - Text ="sdbc:flat:"; - }; - String STR_CALC - { - Text ="sdbc:calc:"; - }; - String STR_MOZILLA - { - Text ="sdbc:address:mozilla:"; - }; - String STR_LDAP - { - Text ="sdbc:address:ldap:"; - }; - String STR_OUTLOOK - { - Text ="sdbc:address:outlook"; - }; - String STR_OUTLOOKEXP - { - Text ="sdbc:address:outlookexp"; - }; - String STR_EVOLUTION - { - Text ="sdbc:address:evolution:local"; - }; - String STR_EVOLUTION_GROUPWISE - { - Text ="sdbc:address:evolution:groupwise"; - }; - String STR_EVOLUTION_LDAP - { - Text ="sdbc:address:evolution:ldap"; - }; - String STR_KAB - { - Text ="sdbc:address:kab"; - }; - String STR_EMBEDDED_HSQLDB - { - Text = "sdbc:embedded:hsqldb"; - }; - String STR_MACAB - { - Text ="sdbc:address:macab"; - }; - String STR_THUNDERBIRD - { - Text ="sdbc:address:thunderbird:"; - }; - String STR_MYSQL_NATIVE - { - Text ="sdbc:mysqlc:"; - }; -}; -Resource RSC_DATASOURCE_TYPE_UINAMES -{ - String STR_MYSQL_ODBC - { - Text[ en-US ] = "MySQL (ODBC)"; - }; - String STR_MYSQL_JDBC - { - Text[ en-US ] = "MySQL (JDBC)"; - }; - String STR_ADABAS - { - Text[ en-US ] = "Adabas D"; - }; - String STR_ORACLE_JDBC - { - Text[ en-US ] = "Oracle JDBC"; - }; - - String STR_JDBC - { - Text[ en-US ] = "JDBC"; - }; - String STR_ODBC - { - Text[ en-US ] = "ODBC"; - }; - String STR_DBASE - { - Text[ en-US ] = "dBASE"; - }; - String STR_MSACCESS - { - Text[ en-US ] = "Microsoft Access"; - }; - String STR_MSACCESS2007 - { - Text[ en-US ] = "Microsoft Access 2007"; - }; - String STR_ADO - { - Text[ en-US ] = "ADO"; - }; - String STR_FLAT - { - Text[ en-US ] = "Text"; - }; - String STR_CALC - { - Text[ en-US ] = "Spreadsheet"; - }; - String STR_MOZILLA - { - Text[ en-US ] = "Mozilla Address Book"; - }; - String STR_LDAP - { - Text[ en-US ] = "LDAP Address Book"; - }; - String STR_OUTLOOK - { - Text[ en-US ] = "Microsoft Outlook Address Book"; - }; - String STR_OUTLOOKEXP - { - Text[ en-US ] = "Microsoft Windows Address Book"; - }; - String STR_EVOLUTION - { - Text[ en-US ] = "Evolution Local"; - }; - String STR_EVOLUTION_GROUPWISE - { - Text[ en-US ] = "Groupwise"; - }; - String STR_EVOLUTION_LDAP - { - Text[ en-US ] = "Evolution LDAP"; - }; - String STR_KAB - { - Text[ en-US ] = "KDE Address Book"; - }; - String STR_MACAB - { - Text[ en-US ] = "Mac OS X Address Book"; - }; - String STR_EMBEDDED_HSQLDB - { - Text[ en-US ] = "HSQL database engine"; - }; - String STR_THUNDERBIRD - { - Text[ en-US ] = "Thunderbird Address Book"; - }; - String STR_MYSQL_NATIVE - { - Text[ en-US ] = "MySQL (Native)"; - }; -}; Resource RSC_CHARSETS { diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 98e7ef3afe33..10f955e4a7d2 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dsmeta.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.8.2 $ * * This file is part of OpenOffice.org. * @@ -47,7 +47,7 @@ namespace dbaui { // strange ctor, but makes instantiating this class more readable (see below) InitAdvanced( short _Generated, short _SQL, short _Append, short _As, short _Outer, short _Priv, short _Param, - short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur ) + short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur,short _AutoPKey ) :AdvancedSettingsSupport() { bGeneratedValues = ( _Generated != 0 ); @@ -65,6 +65,7 @@ namespace dbaui bBooleanComparisonMode = ( _Bool != 0 ); bFormsCheckRequiredFields = ( _Required != 0 ); bIgnoreCurrency = ( _IgnoreCur != 0 ); + bAutoIncrementIsPrimaryKey = ( _AutoPKey != 0 ); } enum Special { All, None }; @@ -87,6 +88,7 @@ namespace dbaui bBooleanComparisonMode = ( _eType == All ); bFormsCheckRequiredFields = ( _eType == All ); bIgnoreCurrency = false; // Oracle special + bAutoIncrementIsPrimaryKey = false; // hsqldb special } }; @@ -110,95 +112,95 @@ namespace dbaui //= global tables //==================================================================== //-------------------------------------------------------------------- - static const AdvancedSettingsSupport& getAdvancedSettingsSupport( DATASOURCE_TYPE _eType ) + static const AdvancedSettingsSupport& getAdvancedSettingsSupport( ::dbaccess::DATASOURCE_TYPE _eType ) { - typedef ::std::map< DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport; + typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport; static AdvancedSupport s_aSupport; if ( s_aSupport.empty() ) { - s_aSupport[ DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_CALC ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ); - s_aSupport[ DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); - s_aSupport[ DST_JDBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ODBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 ); - s_aSupport[ DST_MOZILLA ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_LDAP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_KAB ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_MACAB ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 ); - s_aSupport[ DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_CALC ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ); + s_aSupport[ ::dbaccess::DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + s_aSupport[ ::dbaccess::DST_JDBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ODBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MOZILLA ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_LDAP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_KAB ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_MACAB ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1 ); + s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ORACLE_JDBC ].bIgnoreCurrency = true; + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ].bIgnoreCurrency = true; } return s_aSupport[ _eType ]; } //-------------------------------------------------------------------- - static AuthenticationMode getAuthenticationMode( DATASOURCE_TYPE _eType ) + static AuthenticationMode getAuthenticationMode( ::dbaccess::DATASOURCE_TYPE _eType ) { - typedef ::std::map< DATASOURCE_TYPE, FeatureSupport > Supported; + typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, FeatureSupport > Supported; static Supported s_aSupport; if ( s_aSupport.empty() ) { - s_aSupport[ DST_MSACCESS ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ADABAS ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_CALC ] = FeatureSupport( AuthPwd ); - s_aSupport[ DST_DBASE ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_FLAT ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ODBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ADO ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MOZILLA ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_THUNDERBIRD ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_LDAP ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_OUTLOOK ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_OUTLOOKEXP ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_KAB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MACAB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MSACCESS_2007 ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MSACCESS ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ADABAS ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_CALC ] = FeatureSupport( AuthPwd ); + s_aSupport[ ::dbaccess::DST_DBASE ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_FLAT ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ODBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ADO ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MOZILLA ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_LDAP ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_OUTLOOK ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_KAB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MACAB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd ); } return s_aSupport[ _eType ].eAuthentication; } @@ -209,16 +211,16 @@ namespace dbaui class DataSourceMetaData_Impl { public: - DataSourceMetaData_Impl( DATASOURCE_TYPE _eType ); + DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType ); - inline DATASOURCE_TYPE getType() const { return m_eType; } + inline ::dbaccess::DATASOURCE_TYPE getType() const { return m_eType; } private: - DATASOURCE_TYPE m_eType; + ::dbaccess::DATASOURCE_TYPE m_eType; }; //-------------------------------------------------------------------- - DataSourceMetaData_Impl::DataSourceMetaData_Impl( DATASOURCE_TYPE _eType ) + DataSourceMetaData_Impl::DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType ) :m_eType( _eType ) { } @@ -227,7 +229,7 @@ namespace dbaui //= DataSourceMetaData //==================================================================== //-------------------------------------------------------------------- - DataSourceMetaData::DataSourceMetaData( DATASOURCE_TYPE _eType ) + DataSourceMetaData::DataSourceMetaData( ::dbaccess::DATASOURCE_TYPE _eType ) :m_pImpl( new DataSourceMetaData_Impl( _eType ) ) { } @@ -250,7 +252,7 @@ namespace dbaui } //-------------------------------------------------------------------- - AuthenticationMode DataSourceMetaData::getAuthentication( DATASOURCE_TYPE _eType ) + AuthenticationMode DataSourceMetaData::getAuthentication( ::dbaccess::DATASOURCE_TYPE _eType ) { return getAuthenticationMode( _eType ); } diff --git a/dbaccess/source/ui/misc/dsntypes.cxx b/dbaccess/source/ui/misc/dsntypes.cxx index 45aad375b52f..e69de29bb2d1 100644 --- a/dbaccess/source/ui/misc/dsntypes.cxx +++ b/dbaccess/source/ui/misc/dsntypes.cxx @@ -1,732 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: dsntypes.cxx,v $ - * $Revision: 1.41 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_dbaccess.hxx" -#ifndef _DBAUI_DSNTYPES_HXX_ -#include "dsntypes.hxx" -#endif -#ifndef _DBU_MISC_HRC_ -#include "dbu_misc.hrc" -#endif -#ifndef _DBU_MISCRES_HRC_ -#include "dbumiscres.hrc" -#endif -#ifndef _UNOTOOLS_CONFIGNODE_HXX_ -#include -#endif -#ifndef DBAUI_TOOLS_HXX -#include "UITools.hxx" -#endif -#ifndef _TOOLS_RC_HXX -#include -#endif -// --- needed because of the solar mutex -#ifndef _VOS_MUTEX_HXX_ -#include -#endif -#ifndef _SV_SVAPP_HXX -#include -#endif -#ifndef _OSL_FILE_HXX_ -#include -#endif -// --- -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC -#include "dbustrings.hrc" -#endif -#ifndef _DBAUI_MODULE_DBU_HXX_ -#include "moduledbu.hxx" -#endif -#include -//......................................................................... -namespace dbaui -{ -//......................................................................... - - using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::lang; - using namespace ::com::sun::star::sdbc; - - namespace - { - void lcl_extractHostAndPort(const String& _sUrl,String& _sHostname,sal_Int32& _nPortNumber) - { - if ( _sUrl.GetTokenCount(':') >= 2 ) - { - _sHostname = _sUrl.GetToken(0,':'); - _nPortNumber = _sUrl.GetToken(1,':').ToInt32(); - } - } - class ODataSourceTypeStringListResource : public Resource - { - ::std::vector m_aStrings; - public: - ODataSourceTypeStringListResource(USHORT _nResId ) : Resource(ModuleRes(_nResId)) - { - m_aStrings.reserve(STR_END); - for (int i = STR_MYSQL_ODBC; i < STR_END ; ++i) - { - m_aStrings.push_back(String(ModuleRes(sal::static_int_cast(i)))); - } - - } - ~ODataSourceTypeStringListResource() - { - FreeResource(); - } - /** fill the vector with our readed strings - @param _rToFill - Vector to fill. - */ - inline void fill( ::std::vector& _rToFill ) - { - _rToFill = m_aStrings; - } - - - /** returns the String with a given resource id - @param _nResId - The resource id. It will not be checked if this id exists. - - @return String - The string. - */ - String getString(USHORT _nResId) - { - return String(ModuleRes(_nResId)); - } - }; - } -//========================================================================= -//= ODsnTypeCollection -//========================================================================= -DBG_NAME(ODsnTypeCollection) -//------------------------------------------------------------------------- -ODsnTypeCollection::ODsnTypeCollection() -#ifdef DBG_UTIL -:m_nLivingIterators(0) -#endif -{ - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - DBG_CTOR(ODsnTypeCollection,NULL); - ODataSourceTypeStringListResource aTypes(RSC_DATASOURCE_TYPES); - aTypes.fill(m_aDsnPrefixes); - - ODataSourceTypeStringListResource aDisplayNames(RSC_DATASOURCE_TYPE_UINAMES); - aDisplayNames.fill(m_aDsnTypesDisplayNames); - - - DBG_ASSERT(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(), - "ODsnTypeCollection::ODsnTypeCollection : invalid resources !"); - String sCurrentType; - - for (StringVector::iterator aIter = m_aDsnPrefixes.begin();aIter != m_aDsnPrefixes.end();++aIter) - { - m_aDsnTypes.push_back(implDetermineType(*aIter)); - } -} - -//------------------------------------------------------------------------- -ODsnTypeCollection::~ODsnTypeCollection() -{ - DBG_DTOR(ODsnTypeCollection,NULL); - DBG_ASSERT(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still living iterator objects!"); -} -// ----------------------------------------------------------------------------- -void ODsnTypeCollection::initUserDriverTypes(const Reference< XMultiServiceFactory >& _rxORB) -{ - // read the user driver out of the configuration - // the config node where all pooling relevant info are stored under - ::utl::OConfigurationTreeRoot aUserDefinedDriverRoot = ::utl::OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, ::dbaui::getUserDefinedDriverNodeName(), -1, ::utl::OConfigurationTreeRoot::CM_READONLY); - - if ( aUserDefinedDriverRoot.isValid() ) - { - Sequence< ::rtl::OUString > aDriverKeys = aUserDefinedDriverRoot.getNodeNames(); - const ::rtl::OUString* pDriverKeys = aDriverKeys.getConstArray(); - const ::rtl::OUString* pDriverKeysEnd = pDriverKeys + aDriverKeys.getLength(); - for (sal_Int32 i=0;pDriverKeys != pDriverKeysEnd && i <= DST_USERDEFINE10; ++pDriverKeys) - { - ::utl::OConfigurationNode aThisDriverSettings = aUserDefinedDriverRoot.openNode(*pDriverKeys); - if ( aThisDriverSettings.isValid() ) - { - // read the needed information - ::rtl::OUString sDsnPrefix,sDsnTypeDisplayName,sExtension; - aThisDriverSettings.getNodeValue(getDriverTypeDisplayNodeName()) >>= sDsnTypeDisplayName; - aThisDriverSettings.getNodeValue(getDriverDsnPrefixNodeName()) >>= sDsnPrefix; - aThisDriverSettings.getNodeValue(getDriverExtensionNodeName()) >>= sExtension; - - m_aDsnTypesDisplayNames.push_back(sDsnTypeDisplayName); - m_aDsnPrefixes.push_back(sDsnPrefix); - m_aDsnTypes.push_back(static_cast(DST_USERDEFINE1 + i++)); - m_aUserExtensions.push_back(sExtension); - } - } - } -} - -//------------------------------------------------------------------------- -DATASOURCE_TYPE ODsnTypeCollection::getType(const String& _rDsn) const -{ - DATASOURCE_TYPE eType = DST_UNKNOWN; - // look for user defined driver types - StringVector::const_iterator aIter = m_aDsnPrefixes.begin(); - StringVector::const_iterator aEnd = m_aDsnPrefixes.end(); - for (; aIter != aEnd; ++aIter) - { - if ( _rDsn.Len() >= aIter->Len() && aIter->EqualsIgnoreCaseAscii(_rDsn,0, aIter->Len()) ) - { - size_t nPos = (aIter - m_aDsnPrefixes.begin()); - if ( nPos < m_aDsnTypes.size() ) - { - eType = m_aDsnTypes[nPos]; - break; - } - } - } - return eType; -} - -//------------------------------------------------------------------------- -String ODsnTypeCollection::getTypeDisplayName(DATASOURCE_TYPE _eType) const -{ - String sDisplayName; - - sal_Int32 nIndex = implDetermineTypeIndex(_eType); - if ((nIndex >= 0) && (nIndex < (sal_Int32)m_aDsnTypesDisplayNames.size())) - sDisplayName = m_aDsnTypesDisplayNames[nIndex]; - - return sDisplayName; -} - -//------------------------------------------------------------------------- -String ODsnTypeCollection::getDatasourcePrefix(DATASOURCE_TYPE _eType) const -{ - String sPrefix; - sal_Int32 nIndex = implDetermineTypeIndex(_eType); - if ((nIndex >= 0) && (nIndex < (sal_Int32)m_aDsnPrefixes.size())) - sPrefix = m_aDsnPrefixes[nIndex]; - - return sPrefix; -} - -//------------------------------------------------------------------------- -String ODsnTypeCollection::cutPrefix(const String& _rDsn) const -{ - DATASOURCE_TYPE eType = getType(_rDsn); - String sPrefix = getDatasourcePrefix(eType); - return _rDsn.Copy(sPrefix.Len()); -} -// ----------------------------------------------------------------------------- -String ODsnTypeCollection::getMediaType(DATASOURCE_TYPE _eType) const -{ - String sRet; - switch (_eType) - { - case DST_DBASE: - sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/dbase")); - break; - case DST_FLAT: - sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/csv")); - break; - case DST_CALC: - sRet = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET; - break; - case DST_MSACCESS: - case DST_MSACCESS_2007: - sRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/msaccess")); - break; - default: - break; - } - return sRet; -} -// ----------------------------------------------------------------------------- -String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const String& _sMediaType,const String& _sExtension) -{ - ::rtl::OUString sURL(RTL_CONSTASCII_USTRINGPARAM("sdbc:")); - if ( _sMediaType.EqualsIgnoreCaseAscii( "text/csv" ) ) - { - sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("flat:")); - } - else if ( _sMediaType.EqualsIgnoreCaseAscii( "application/dbase" ) ) - { - sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dbase:")); - } - else if ( _sMediaType.EqualsIgnoreCaseAscii( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII ) ) - { - sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("calc:")); - } - else if ( _sMediaType.EqualsIgnoreCaseAscii( "application/msaccess" ) ) - { - if ( _sExtension.EqualsIgnoreCaseAscii( "mdb" ) ) - sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=")); - else - sURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ado:access:Provider=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=")); - } - return sURL; -} -// ----------------------------------------------------------------------------- -void ODsnTypeCollection::extractHostNamePort(const String& _rDsn,String& _sDatabaseName,String& _rsHostname,sal_Int32& _nPortNumber) const -{ - DATASOURCE_TYPE eType = getType(_rDsn); - String sUrl = cutPrefix(_rDsn); - switch( eType ) - { - case DST_ORACLE_JDBC: - lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber); - if ( !_rsHostname.Len() && sUrl.GetTokenCount(':') == 2 ) - { - _nPortNumber = -1; - _rsHostname = sUrl.GetToken(0,':'); - } - if ( _rsHostname.Len() ) - _rsHostname = _rsHostname.GetToken(_rsHostname.GetTokenCount('@') - 1,'@'); - _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') - 1,':'); - break; - case DST_LDAP: - lcl_extractHostAndPort(sUrl,_sDatabaseName,_nPortNumber); - break; - case DST_ADABAS: - if ( sUrl.GetTokenCount(':') == 2 ) - _rsHostname = sUrl.GetToken(0,':'); - _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') - 1,':'); - break; - case DST_MYSQL_NATIVE: - case DST_MYSQL_JDBC: - { - lcl_extractHostAndPort(sUrl,_rsHostname,_nPortNumber); - - if ( _nPortNumber == -1 && !_rsHostname.Len() && sUrl.GetTokenCount('/') == 2 ) - _rsHostname = sUrl.GetToken(0,'/'); - _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount('/') - 1,'/'); - } - break; - case DST_MSACCESS: - case DST_MSACCESS_2007: - { - ::rtl::OUString sNewFileName; - if ( ::osl::FileBase::getFileURLFromSystemPath( sUrl, sNewFileName ) == ::osl::FileBase::E_None ) - { - _sDatabaseName = sNewFileName; - } - } - break; - default: - break; - } -} - -//------------------------------------------------------------------------- -sal_Bool ODsnTypeCollection::isFileSystemBased(DATASOURCE_TYPE _eType) const -{ - switch (_eType) - { - case DST_DBASE: - case DST_FLAT: - case DST_CALC: - case DST_MSACCESS: - case DST_MSACCESS_2007: - return sal_True; - - case DST_USERDEFINE1: - case DST_USERDEFINE2: - case DST_USERDEFINE3: - case DST_USERDEFINE4: - case DST_USERDEFINE5: - case DST_USERDEFINE6: - case DST_USERDEFINE7: - case DST_USERDEFINE8: - case DST_USERDEFINE9: - case DST_USERDEFINE10: - { - StringVector::size_type nPos = static_cast(_eType-DST_USERDEFINE1); - return nPos < m_aUserExtensions.size() && m_aUserExtensions[nPos].Len() != 0; - } - default: - return sal_False; - } -} - - -sal_Bool ODsnTypeCollection::supportsTableCreation(DATASOURCE_TYPE _eType) -{ - BOOL bSupportsTableCreation; - switch( _eType ) - { - case DST_MOZILLA: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_FLAT: - case DST_EVOLUTION: - case DST_EVOLUTION_GROUPWISE: - case DST_EVOLUTION_LDAP: - case DST_KAB: - case DST_THUNDERBIRD: - case DST_CALC: - bSupportsTableCreation = FALSE; - break; - case DST_DBASE: - case DST_ADABAS: - case DST_ADO: - case DST_MSACCESS: - case DST_MSACCESS_2007: - case DST_MYSQL_ODBC: - case DST_ODBC: - case DST_MYSQL_JDBC: - case DST_MYSQL_NATIVE: - case DST_ORACLE_JDBC: - case DST_LDAP: - case DST_JDBC: - default: - bSupportsTableCreation = TRUE; - break; - } - return bSupportsTableCreation; -} -// ----------------------------------------------------------------------------- -sal_Bool ODsnTypeCollection::supportsBrowsing(DATASOURCE_TYPE _eType) -{ - sal_Bool bEnableBrowseButton = sal_False; - switch( _eType ) - { - case DST_DBASE: - case DST_FLAT: - case DST_CALC: - case DST_ADABAS: - case DST_ADO: - case DST_MSACCESS: - case DST_MSACCESS_2007: - case DST_MYSQL_ODBC: - case DST_ODBC: - case DST_MOZILLA: - case DST_THUNDERBIRD: - bEnableBrowseButton = TRUE; - break; - case DST_MYSQL_NATIVE: - case DST_MYSQL_JDBC: - case DST_ORACLE_JDBC: - case DST_LDAP: - case DST_OUTLOOK: - case DST_OUTLOOKEXP: - case DST_JDBC: - case DST_EVOLUTION: - case DST_EVOLUTION_GROUPWISE: - case DST_EVOLUTION_LDAP: - case DST_KAB: - bEnableBrowseButton = FALSE; - break; - default: - bEnableBrowseButton = getTypeExtension(_eType).Len() != 0; - break; - } - return bEnableBrowseButton; -} - - -//------------------------------------------------------------------------- -DATASOURCE_TYPE ODsnTypeCollection::implDetermineType(const String& _rDsn) const -{ - sal_uInt16 nSeparator = _rDsn.Search((sal_Unicode)':'); - if (STRING_NOTFOUND == nSeparator) - { - // there should be at least one such separator - DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the colon !"); - return DST_UNKNOWN; - } - // find first : - sal_uInt16 nOracleSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1); - if ( nOracleSeparator != STRING_NOTFOUND ) - { - nOracleSeparator = _rDsn.Search((sal_Unicode)':', nOracleSeparator + 1); - if (nOracleSeparator != STRING_NOTFOUND && _rDsn.EqualsIgnoreCaseAscii("jdbc:oracle:thin", 0, nOracleSeparator)) - return DST_ORACLE_JDBC; - } - - if (_rDsn.EqualsIgnoreCaseAscii("jdbc", 0, nSeparator)) - return DST_JDBC; - - // find second : - nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1); - if (STRING_NOTFOUND == nSeparator) - { - // at the moment only jdbc is allowed to have just one separator - DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the second colon !"); - return DST_UNKNOWN; - } - - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:adabas", 0, nSeparator)) - return DST_ADABAS; - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:odbc", 0, nSeparator)) - return DST_ODBC; - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:dbase", 0, nSeparator)) - return DST_DBASE; - - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:ado:", 0, nSeparator)) - { - nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1); - if (STRING_NOTFOUND != nSeparator && _rDsn.EqualsIgnoreCaseAscii("sdbc:ado:access",0, nSeparator) ) - { - nSeparator = _rDsn.Search((sal_Unicode)';', nSeparator + 1); - if (STRING_NOTFOUND != nSeparator && _rDsn.EqualsIgnoreCaseAscii("sdbc:ado:access:Provider=Microsoft.ACE.OLEDB.12.0",0, nSeparator) ) - return DST_MSACCESS_2007; - - return DST_MSACCESS; - } - return DST_ADO; - } - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:flat:", 0, nSeparator)) - return DST_FLAT; - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:calc:", 0, nSeparator)) - return DST_CALC; - if ( ( 11 <= nSeparator) && _rDsn.EqualsIgnoreCaseAscii("sdbc:mysqlc:", 0, nSeparator)) - return DST_MYSQL_NATIVE; - - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:embedded:hsqldb", 0, _rDsn.Len())) - return DST_EMBEDDED_HSQLDB; - - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:address:", 0, nSeparator)) - { - ++nSeparator; - if (_rDsn.EqualsIgnoreCaseAscii("mozilla:", nSeparator,_rDsn.Len() - nSeparator)) - return DST_MOZILLA; - if (_rDsn.EqualsIgnoreCaseAscii("thunderbird:", nSeparator,_rDsn.Len() - nSeparator)) - return DST_THUNDERBIRD; - if (_rDsn.EqualsIgnoreCaseAscii("ldap:", nSeparator,_rDsn.Len() - nSeparator)) - return DST_LDAP; - if (_rDsn.EqualsIgnoreCaseAscii("outlook", nSeparator,_rDsn.Len() - nSeparator)) - return DST_OUTLOOK; - if (_rDsn.EqualsIgnoreCaseAscii("outlookexp", nSeparator,_rDsn.Len() - nSeparator)) - return DST_OUTLOOKEXP; - if (_rDsn.EqualsIgnoreCaseAscii("evolution:ldap", nSeparator,_rDsn.Len() - nSeparator)) - return DST_EVOLUTION_LDAP; - if (_rDsn.EqualsIgnoreCaseAscii("evolution:groupwise", nSeparator,_rDsn.Len() - nSeparator)) - return DST_EVOLUTION_GROUPWISE; - if (_rDsn.EqualsIgnoreCaseAscii("evolution:local", nSeparator,_rDsn.Len() - nSeparator)) - return DST_EVOLUTION; - if (_rDsn.EqualsIgnoreCaseAscii("kab", nSeparator,_rDsn.Len() - nSeparator)) - return DST_KAB; - if (_rDsn.EqualsIgnoreCaseAscii("macab", nSeparator,_rDsn.Len() - nSeparator)) - return DST_MACAB; - } - - // find third : - nSeparator = _rDsn.Search((sal_Unicode)':', nSeparator + 1); - if (STRING_NOTFOUND == nSeparator) - { - DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the third colon !"); - return DST_UNKNOWN; - } - - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:odbc", 0, nSeparator)) - return DST_MYSQL_ODBC; - if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:jdbc", 0, nSeparator)) - return DST_MYSQL_JDBC; - - DBG_ERROR("ODsnTypeCollection::implDetermineType : unrecognized data source type !"); - return DST_UNKNOWN; -} -// ----------------------------------------------------------------------------- -sal_Int32 ODsnTypeCollection::implDetermineTypeIndex(DATASOURCE_TYPE _eType) const -{ - DBG_ASSERT( - (m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size()) - && (m_aDsnTypesDisplayNames.size() == m_aDsnTypes.size()), - "ODsnTypeCollection::implDetermineTypeIndex : inconsistent structures !"); - - // the type of the datasource described by the DSN string - if (DST_UNKNOWN == _eType) - { - return -1; - } - - // search this type in our arrays - sal_Int32 nIndex = 0; - ConstTypeVectorIterator aSearch = m_aDsnTypes.begin(); - - for (; aSearch != m_aDsnTypes.end(); ++nIndex, ++aSearch) - if (*aSearch == _eType) - return nIndex; - - DBG_ERROR("ODsnTypeCollection::implDetermineTypeIndex : recognized the DSN schema, but did not find the type!"); - return -1; -} -// ----------------------------------------------------------------------------- -Sequence ODsnTypeCollection::getDefaultDBSettings( DATASOURCE_TYPE _eType ) const -{ - Sequence< PropertyValue > aSettings; - - switch ( _eType ) - { - case DST_EMBEDDED_HSQLDB: - aSettings.realloc( 3 ); - - aSettings[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoIncrementCreation" ) ); - aSettings[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IDENTITY" ) ); - - aSettings[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoRetrievingStatement" ) ); - aSettings[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CALL IDENTITY()" ) ); - - aSettings[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutoRetrievingEnabled" ) ); - aSettings[2].Value <<= (sal_Bool)sal_True; - break; - - default: - DBG_ERROR( "ODsnTypeCollection::getDefaultDBSettings: type is unsupported by this method!" ); - break; - } - - return aSettings; -} - -// ----------------------------------------------------------------------------- -String ODsnTypeCollection::getTypeExtension(DATASOURCE_TYPE _eType) const -{ - StringVector::size_type nPos = static_cast(_eType-DST_USERDEFINE1); - return nPos < m_aUserExtensions.size() ? m_aUserExtensions[nPos] : String(); -} -//------------------------------------------------------------------------- -ODsnTypeCollection::TypeIterator ODsnTypeCollection::begin() const -{ - return TypeIterator(this, 0); -} - -//------------------------------------------------------------------------- -ODsnTypeCollection::TypeIterator ODsnTypeCollection::end() const -{ - return TypeIterator(this, m_aDsnTypes.size()); -} - -//========================================================================= -//= ODsnTypeCollection::TypeIterator -//========================================================================= -//------------------------------------------------------------------------- -ODsnTypeCollection::TypeIterator::TypeIterator(const ODsnTypeCollection* _pContainer, sal_Int32 _nInitialPos) - :m_pContainer(_pContainer) - ,m_nPosition(_nInitialPos) -{ - DBG_ASSERT(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid container!"); -#ifdef DBG_UTIL - ++const_cast(m_pContainer)->m_nLivingIterators; -#endif -} - -//------------------------------------------------------------------------- -ODsnTypeCollection::TypeIterator::TypeIterator(const TypeIterator& _rSource) - :m_pContainer(_rSource.m_pContainer) - ,m_nPosition(_rSource.m_nPosition) -{ -#ifdef DBG_UTIL - ++const_cast(m_pContainer)->m_nLivingIterators; -#endif -} - -//------------------------------------------------------------------------- -ODsnTypeCollection::TypeIterator::~TypeIterator() -{ -#ifdef DBG_UTIL - --const_cast(m_pContainer)->m_nLivingIterators; -#endif -} - -//------------------------------------------------------------------------- -DATASOURCE_TYPE ODsnTypeCollection::TypeIterator::getType() const -{ - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size(), "ODsnTypeCollection::TypeIterator::getType : invalid position!"); - return m_pContainer->m_aDsnTypes[m_nPosition]; -} - -//------------------------------------------------------------------------- -String ODsnTypeCollection::TypeIterator::getDisplayName() const -{ - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!"); - return m_pContainer->m_aDsnTypesDisplayNames[m_nPosition]; -} - -//------------------------------------------------------------------------- -const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator++() -{ - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size(), "ODsnTypeCollection::TypeIterator::operator++ : invalid position!"); - if (m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypes.size()) - ++m_nPosition; - return *this; -} - -//------------------------------------------------------------------------- -const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator--() -{ - DBG_ASSERT(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid position!"); - if (m_nPosition >= 0) - --m_nPosition; - return *this; -} - -//------------------------------------------------------------------------- -bool operator==(const ODsnTypeCollection::TypeIterator& lhs, const ODsnTypeCollection::TypeIterator& rhs) -{ - return (lhs.m_pContainer == rhs.m_pContainer) && (lhs.m_nPosition == rhs.m_nPosition); -} - -//========================================================================= -//= DbuTypeCollectionItem -//========================================================================= -TYPEINIT1(DbuTypeCollectionItem, SfxPoolItem); -//------------------------------------------------------------------------- -DbuTypeCollectionItem::DbuTypeCollectionItem(sal_Int16 _nWhich, ODsnTypeCollection* _pCollection) - :SfxPoolItem(_nWhich) - ,m_pCollection(_pCollection) -{ -} - -//------------------------------------------------------------------------- -DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource) - :SfxPoolItem(_rSource) - ,m_pCollection(_rSource.getCollection()) -{ -} - -//------------------------------------------------------------------------- -int DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const -{ - DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem); - return pCompare && (pCompare->getCollection() == getCollection()); -} - -//------------------------------------------------------------------------- -SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* /*_pPool*/) const -{ - return new DbuTypeCollectionItem(*this); -} -//......................................................................... -} // namespace dbaui -//......................................................................... - diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index c91ffb0df93a..e84927a15690 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: linkeddocuments.cxx,v $ - * $Revision: 1.32 $ + * $Revision: 1.31.24.2 $ * * This file is part of OpenOffice.org. * @@ -123,10 +123,6 @@ #ifndef _EHDL_HXX #include #endif -// ----------------- -#ifndef _DBU_MISCRES_HRC_ -#include "dbumiscres.hrc" -#endif #ifndef _SVX_DATACCESSDESCRIPTOR_HXX_ #include #endif diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 5cb04804274b..e5db6954ea4d 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.35 $ +# $Revision: 1.35.68.1 $ # # This file is part of OpenOffice.org. # @@ -80,7 +80,6 @@ SLOFILES= \ $(SLO)$/ToolBoxHelper.obj \ $(SLO)$/stringlistitem.obj \ $(SLO)$/charsets.obj \ - $(SLO)$/dsntypes.obj \ $(SLO)$/defaultobjectnamecheck.obj \ $(SLO)$/dsmeta.obj \ $(SLO)$/controllerframe.obj \ diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 4275339c159a..2ef890cd8713 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: singledoccontroller.cxx,v $ - * $Revision: 1.30 $ + * $Revision: 1.30.24.2 $ * * This file is part of OpenOffice.org. * @@ -155,13 +155,15 @@ namespace dbaui sal_Bool m_bSuspended; // is true when the controller was already suspended sal_Bool m_bEditable; // is the control readonly or not sal_Bool m_bModified; // is the data modified + bool m_bNotAttached; OSingleDocumentControllerImpl() :m_aDocScriptSupport() - ,m_nDocStartNumber(1) + ,m_nDocStartNumber(0) ,m_bSuspended( sal_False ) ,m_bEditable(sal_True) ,m_bModified(sal_False) + ,m_bNotAttached(true) { } @@ -288,6 +290,14 @@ namespace dbaui } OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: unable to obtain the data source object!" ); + if ( m_pImpl->m_bNotAttached ) + { + Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + } + // determine the availability of script support in our document. Our own XScriptInvocationContext // interface depends on this m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); @@ -471,9 +481,15 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) { + if ( !_rxModel.is() ) + return sal_False; if ( !OSingleDocumentController_Base::attachModel( _rxModel ) ) return sal_False; + m_pImpl->m_bNotAttached = false; + if ( m_pImpl->m_nDocStartNumber == 1 ) + releaseNumberForComponent(); + Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); m_pImpl->m_nDocStartNumber = 1; if ( xUntitledProvider.is() ) diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index e4563f193b93..e38b3c5e19af 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ConnectionLine.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.68.2 $ * * This file is part of OpenOffice.org. * @@ -54,6 +54,7 @@ #ifndef _TOOLS_DEBUG_HXX #include #endif +#include using namespace dbaui; @@ -219,15 +220,17 @@ Rectangle OConnectionLine::GetBoundingRect() aBottomRight.X() = m_aSourceDescrLinePos.X(); } + const OTableWindow* pSourceWin = m_pTabConn->GetSourceWin(); + const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); ////////////////////////////////////////////////////////////////////// // Linie verlaeuft in z-Form - if( Abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > Abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) + if( pSourceWin == pDestWin || Abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > Abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) { aTopLeft.X() -= DESCRIPT_LINE_WIDTH; aBottomRight.X() += DESCRIPT_LINE_WIDTH; } - aBoundingRect = Rectangle( aTopLeft-Point(0,17), aBottomRight+Point(0,2) ); + aBoundingRect = Rectangle( aTopLeft-Point(2,17), aBottomRight+Point(2,2) ); return aBoundingRect; } @@ -283,7 +286,10 @@ BOOL OConnectionLine::RecalcLine() pSecondDescrPos = &m_aDestDescrLinePos; } - calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos); + if ( pFirstWin == pSecondWin && pSourceEntry != pDestEntry ) + calcPointX2(pFirstWin,*pFirstConPos,*pFirstDescrPos); + else + calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos); calcPointX2(pSecondWin,*pSecondConPos,*pSecondDescrPos); ////////////////////////////////////////////////////////////////////// @@ -315,31 +321,15 @@ void OConnectionLine::Draw( OutputDevice* pOutDev ) else pOutDev->SetLineColor(Application::GetSettings().GetStyleSettings().GetWindowTextColor()); - pOutDev->DrawLine( m_aSourceDescrLinePos, m_aSourceConnPos ); - pOutDev->DrawLine( m_aDestDescrLinePos, m_aDestConnPos ); - pOutDev->DrawLine( m_aSourceConnPos, m_aDestConnPos ); - // wenn die Linie selektiert ist, sollte sie dicker erscheinen - // da OutputDevice nach meinem Wissen (das ich nur aus dem Headerfile habe) kein - // SetLineWidth (o.ä.) hat, ein Fake - if (m_pTabConn->IsSelected()) - { - UINT16 xOffset, yOffset; - if (abs(m_aSourceConnPos.Y() - m_aDestConnPos.Y()) > abs(m_aSourceConnPos.X()-m_aDestConnPos.X())) - { - xOffset = 1; - yOffset = 0; - } else - { - xOffset = 0; - yOffset = 1; - } - - Point aPos1(-xOffset, -yOffset); - Point aPos2(xOffset, yOffset); - pOutDev->DrawLine(m_aSourceConnPos + aPos1, m_aDestConnPos + aPos1); - pOutDev->DrawLine(m_aSourceConnPos + aPos2, m_aDestConnPos + aPos2); - } - + LineInfo aLineInfo; + if ( m_pTabConn->IsSelected() ) + aLineInfo.SetWidth(3); + Polygon aPoly; + aPoly.Insert(0,m_aSourceDescrLinePos); + aPoly.Insert(1,m_aSourceConnPos); + aPoly.Insert(2,m_aDestConnPos); + aPoly.Insert(3,m_aDestDescrLinePos); + pOutDev->DrawPolyLine(aPoly,aLineInfo); ////////////////////////////////////////////////////////////////////// // draw the connection rectangles diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 4179e76f0096..d6fcba7dbe67 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: QueryDesignView.cxx,v $ - * $Revision: 1.96 $ + * $Revision: 1.96.8.1 $ * * This file is part of OpenOffice.org. * @@ -2182,12 +2182,11 @@ namespace SqlParseError eErrorCode = eOk; sal_Bool bFirstField = sal_True; ::rtl::OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*")); - OTableFieldDescRef aInfo = new OTableFieldDesc(); OJoinTableView::OTableWindowMap::iterator aIter = _pTabList->begin(); for(;aIter != _pTabList->end() && eOk == eErrorCode ;++aIter) { OQueryTableWindow* pTabWin = static_cast(aIter->second); - + OTableFieldDescRef aInfo = new OTableFieldDesc(); if (pTabWin->ExistsField( sAsterix, aInfo )) { eErrorCode = _pView->InsertField(aInfo, sal_True, bFirstField); diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 3cc4c9819d98..46580954d02f 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableWindow.cxx,v $ - * $Revision: 1.41 $ + * $Revision: 1.41.26.2 $ * * This file is part of OpenOffice.org. * @@ -61,54 +61,26 @@ #include #endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_ #include -#endif -#ifndef DBAUI_QUERYCONTROLLER_HXX #include "querycontroller.hxx" -#endif -#ifndef _DBU_QRY_HRC_ #include "dbu_qry.hrc" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef DBAUI_QUERY_HRC #include "Query.hrc" -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ #include -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef DBACCESS_TABLEWINDOWACCESS_HXX #include "TableWindowAccess.hxx" -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif + using namespace dbaui; using namespace ::utl; +using namespace ::com::sun::star; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -131,7 +103,8 @@ using namespace ::com::sun::star::accessibility; DBG_NAME(OTableWindow) //------------------------------------------------------------------------------ OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData ) - :Window( pParent, WB_3DLOOK|WB_MOVEABLE ) + : ::comphelper::OContainerListener(m_aMutex) + ,Window( pParent, WB_3DLOOK|WB_MOVEABLE ) ,m_aTypeImage( this ) ,m_aTitle( this ) ,m_pListBox(NULL) @@ -171,7 +144,10 @@ OTableWindow::~OTableWindow() OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!"); ::std::auto_ptr aTemp(m_pListBox); m_pListBox = NULL; - } + } // if (m_pListBox) + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); + m_pAccessible = NULL; } // ----------------------------------------------------------------------------- @@ -227,6 +203,13 @@ OTableWindowListBox* OTableWindow::CreateListBox() //------------------------------------------------------------------------------ BOOL OTableWindow::FillListBox() { + m_pListBox->Clear(); + if ( !m_pContainerListener.is() ) + { + Reference< XContainer> xContainer(m_pData->getColumns(),UNO_QUERY); + if ( xContainer.is() ) + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } // mark all primary keys with special image ModuleRes TmpRes(isHiContrast(m_pListBox) ? IMG_JOINS_H : IMG_JOINS); ImageList aImageList(TmpRes); @@ -848,3 +831,19 @@ String OTableWindow::getTitle() const return m_aTitle.GetText(); } // ----------------------------------------------------------------------------- +void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + FillListBox(); +} +// ----------------------------------------------------------------------------- +void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + FillListBox(); +} +// ----------------------------------------------------------------------------- +void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + FillListBox(); +} +// ----------------------------------------------------------------------------- + diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx index f6c60feb5a64..82112d333333 100644 --- a/dbaccess/source/ui/querydesign/TableWindowData.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableWindowData.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.15.42.1 $ * * This file is part of OpenOffice.org. * @@ -85,10 +85,6 @@ OTableWindowData::~OTableWindowData() Reference xComponent( m_xTable, UNO_QUERY ); if ( xComponent.is() ) stopComponentListening( xComponent ); - // obtain the columns - xComponent.set( m_xColumns, UNO_QUERY ); - if ( xComponent.is() ) - stopComponentListening( xComponent ); } //------------------------------------------------------------------------------ @@ -107,8 +103,9 @@ void OTableWindowData::_disposing( const ::com::sun::star::lang::EventObject& /* { ::osl::MutexGuard aGuard( m_aMutex ); // it doesn't matter which one was disposed + m_xColumns.clear(); + m_xKeys.clear(); m_xTable.clear(); - m_xColumns.clear();; } // ----------------------------------------------------------------------------- bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _bAllowQueries) @@ -126,9 +123,9 @@ bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _ bool bIsKnownTable = xTables->hasByName( m_sComposedName ); if ( bIsKnownQuery ) - m_xTable.set( xQueries->getByName( m_sComposedName ), UNO_QUERY_THROW ); + m_xTable.set( xQueries->getByName( m_sComposedName ), UNO_QUERY ); else if ( bIsKnownTable ) - m_xTable.set( xTables->getByName( m_sComposedName ), UNO_QUERY_THROW ); + m_xTable.set( xTables->getByName( m_sComposedName ), UNO_QUERY ); else m_bIsValid = false; @@ -137,7 +134,6 @@ bool OTableWindowData::init(const Reference< XConnection >& _xConnection,bool _ listen(); - Reference< XIndexAccess > xColumnsAsIndex( m_xColumns,UNO_QUERY ); return xColumnsAsIndex.is() && ( xColumnsAsIndex->getCount() > 0 ); } @@ -152,11 +148,9 @@ void OTableWindowData::listen() startComponentListening( xComponent ); // obtain the columns - Reference< XColumnsSupplier > xColumnsSups( m_xTable, UNO_QUERY_THROW ); - m_xColumns = xColumnsSups->getColumns(); - xComponent.set( m_xColumns, UNO_QUERY ); - if ( xComponent.is() ) - startComponentListening( xComponent ); + Reference< XColumnsSupplier > xColumnsSups( m_xTable, UNO_QUERY); + if ( xColumnsSups.is() ) + m_xColumns = xColumnsSups->getColumns(); Reference xKeySup(m_xTable,UNO_QUERY); if ( xKeySup.is() ) diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 6b1fcabd3b6f..ac830a5a0f4c 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableWindowListBox.cxx,v $ - * $Revision: 1.35 $ + * $Revision: 1.35.26.2 $ * * This file is part of OpenOffice.org. * @@ -85,7 +85,6 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) ,m_nDropEvent(0) ,m_nUiEvent(0) ,m_bReallyScrolled( sal_False ) - ,m_bDragSource( sal_False ) { DBG_CTOR(OTableWindowListBox,NULL); m_aScrollTimer.SetTimeout( SCROLLING_TIMESPAN ); @@ -99,7 +98,6 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) //------------------------------------------------------------------------------ void OTableWindowListBox::dragFinished( ) { - m_bDragSource = sal_False; // first show the error msg when existing m_pTabWin->getDesignView()->getController().showError(m_pTabWin->getDesignView()->getController().clearOccuredError()); // second look for ui activities which should happen after d&d @@ -255,7 +253,6 @@ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPi EndSelection(); // create a description of the source OJoinExchangeData jxdSource(this); - m_bDragSource = sal_True; // put it into a exchange object OJoinExchObj* pJoin = new OJoinExchObj(jxdSource,bFirstNotAllowed); Reference< XTransferable > xEnsureDelete(pJoin); @@ -268,8 +265,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) { sal_Int8 nDND_Action = DND_ACTION_NONE; // check the format - if ( !m_bDragSource - && !OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_TABID) // this means that the first entry is to be draged + if ( !OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_TABID) // this means that the first entry is to be draged && OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_JOIN) ) { // don't drop into the window if it's the drag source itself @@ -360,7 +356,7 @@ IMPL_LINK( OTableWindowListBox, DropHdl, void *, /*EMPTY_ARG*/) sal_Int8 OTableWindowListBox::ExecuteDrop( const ExecuteDropEvent& _rEvt ) { TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable); - if (!m_bDragSource && OJoinExchObj::isFormatAvailable(aDropped.GetDataFlavorExVector())) + if ( OJoinExchObj::isFormatAvailable(aDropped.GetDataFlavorExVector())) { // don't drop into the window if it's the drag source itself m_aDropInfo.aSource = OJoinExchangeData(this); m_aDropInfo.aDest = OJoinExchObj::GetSourceDescription(_rEvt.maDropEvent.Transferable); @@ -428,4 +424,3 @@ void OTableWindowListBox::Command(const CommandEvent& rEvt) } } // ----------------------------------------------------------------------------- - diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 0562219778da..e4709f2ea3a3 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: querycontroller.cxx,v $ - * $Revision: 1.119 $ + * $Revision: 1.119.24.1 $ * * This file is part of OpenOffice.org. * @@ -76,6 +76,7 @@ #include #include #include +#include /** === end UNO includes === **/ #include @@ -1248,7 +1249,12 @@ sal_Bool OQueryController::askForNewName(const Reference& _xElement if ( ( _bSaveAs && !bNew ) || ( bNew && m_sName.getLength() ) ) aDefaultName = String( m_sName ); else - aDefaultName = getPrivateTitle( ); + { + String sName = String( ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) ); + aDefaultName = sName.GetToken(0,' '); + //aDefaultName = getPrivateTitle( ); + aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName); + } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY ); OSaveAsDlg aDlg( @@ -1419,11 +1425,19 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) // now check if our datasource has set a tablefilter and if so, append the new table name to it ::dbaui::appendToFilter( getConnection(), m_sName, getORB(), getView() ); + } // if ( editingView() ) + Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); + if ( xEventListener.is() ) + { + TitleChangedEvent aEvent; + xEventListener->titleChanged(aEvent); } + releaseNumberForComponent(); } setModified( sal_False ); bSuccess = true; + } catch( const SQLException& ) { diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index 55d56b0bc86d..fb6ad305c1ab 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: querydlg.cxx,v $ - * $Revision: 1.19 $ + * $Revision: 1.19.24.1 $ * * This file is part of OpenOffice.org. * @@ -216,8 +216,8 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) m_pTableControl->enableRelation(true); - const String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName(); - const String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName(); + String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName(); + String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName(); const EJoinType eOldJoinType = eJoinType; USHORT nResId = 0; const USHORT nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos(); @@ -236,8 +236,13 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) eJoinType = LEFT_JOIN; break; case ID_RIGHT_JOIN: - nResId = STR_QUERY_LEFTRIGHT_JOIN; - eJoinType = RIGHT_JOIN; + { + nResId = STR_QUERY_LEFTRIGHT_JOIN; + eJoinType = RIGHT_JOIN; + String sTemp = sFirstWinName; + sFirstWinName = sSecondWinName; + sSecondWinName = sTemp; + } break; case ID_FULL_JOIN: nResId = STR_QUERY_FULL_JOIN; diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx index 22e6aea2dd6a..7d83a2fc8cc4 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RTableConnection.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.68.1 $ * * This file is part of OpenOffice.org. * @@ -91,8 +91,7 @@ void ORelationTableConnection::Draw( const Rectangle& rRect ) { DBG_CHKTHIS(ORelationTableConnection,NULL); OTableConnection::Draw( rRect ); - ORelationTableConnectionData* pData = - static_cast< ORelationTableConnectionData* >(GetData().get()); + ORelationTableConnectionData* pData = static_cast< ORelationTableConnectionData* >(GetData().get()); if ( pData && (pData->GetCardinality() == CARDINAL_UNDEFINED) ) return; diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index ff5ae073fb28..8572ff867f41 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationController.cxx,v $ - * $Revision: 1.56 $ + * $Revision: 1.56.24.1 $ * * This file is part of OpenOffice.org. * @@ -232,7 +232,7 @@ FeatureState ORelationController::GetState(sal_uInt16 _nId) const switch (_nId) { case SID_RELATION_ADD_RELATION: - aReturn.bEnabled = m_vTableData.size() > 1 && isConnected() && isEditable(); + aReturn.bEnabled = !m_vTableData.empty() && isConnected() && isEditable(); aReturn.bChecked = false; break; case ID_BROWSER_SAVEDOC: diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index caa0f0f5caa3..633a7ed45b52 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: RelationTableView.cxx,v $ - * $Revision: 1.30 $ + * $Revision: 1.30.26.2 $ * * This file is part of OpenOffice.org. * @@ -30,105 +30,60 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBAUI_RELATION_TABLEVIEW_HXX + #include "RelationTableView.hxx" -#endif -#ifndef DBAUI_JOINEXCHANGE_HXX + + #include "JoinExchange.hxx" -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ + + #include -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX + + #include "browserids.hxx" -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ + + #include -#endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ + + #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_ + + #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ + + #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_ + + #include -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ + #include -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ #include -#endif -#ifndef _TOOLS_DEBUG_HXX #include -#endif -#ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" -#endif -#ifndef DBAUI_RELATIONDESIGNVIEW_HXX #include "RelationDesignView.hxx" -#endif -#ifndef DBAUI_JOINCONTROLLER_HXX #include "JoinController.hxx" -#endif -#ifndef DBAUI_TABLEWINDOW_HXX #include "TableWindow.hxx" -#endif -#ifndef DBAUI_TABLEWINDOWDATA_HXX #include "TableWindowData.hxx" -#endif -#ifndef DBAUI_RTABLECONNECTION_HXX #include "RTableConnection.hxx" -#endif -#ifndef DBAUI_RTABLECONNECTIONDATA_HXX #include "RTableConnectionData.hxx" -#endif -#ifndef DBAUI_RELATIONDIALOG_HXX #include "RelationDlg.hxx" -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" -#endif -#ifndef _DBU_REL_HRC_ #include "dbu_rel.hrc" -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ #include -#endif -#ifndef DBAUI_RELTABLEWINDOW_HXX #include "RTableWindow.hxx" -#endif -#ifndef DBACCESS_JACCESS_HXX #include "JAccess.hxx" -#endif -#ifndef _UNDO_HXX #include -#endif -#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ #include -#endif using namespace dbaui; using namespace ::dbtools; +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -142,8 +97,11 @@ using namespace ::com::sun::star::accessibility; DBG_NAME(ORelationTableView) //------------------------------------------------------------------------ ORelationTableView::ORelationTableView( Window* pParent, ORelationDesignView* pView ) - : OJoinTableView( pParent, pView ) + :OJoinTableView( pParent, pView ) + , ::comphelper::OContainerListener(m_aMutex) ,m_pExistingConnection(NULL) + ,m_bInRemove(false) + { DBG_CTOR(ORelationTableView,NULL); SetHelpId(HID_CTL_RELATIONTAB); @@ -153,12 +111,23 @@ ORelationTableView::ORelationTableView( Window* pParent, ORelationDesignView* pV ORelationTableView::~ORelationTableView() { DBG_DTOR(ORelationTableView,NULL); + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); } //------------------------------------------------------------------------ void ORelationTableView::ReSync() { DBG_CHKTHIS(ORelationTableView,NULL); + if ( !m_pContainerListener.is() ) + { + Reference< XConnection> xConnection = m_pView->getController().getConnection(); + Reference< XTablesSupplier > xTableSupp( xConnection, UNO_QUERY_THROW ); + Reference< XNameAccess > xTables = xTableSupp->getTables(); + Reference< XContainer> xContainer(xTables,uno::UNO_QUERY); + if ( xContainer.is() ) + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } // Es kann sein, dass in der DB Tabellen ausgeblendet wurden, die eigentlich Bestandteil einer Relation sind. Oder eine Tabelle // befand sich im Layout (durchaus ohne Relation), existiert aber nicht mehr. In beiden Faellen wird das Anlegen des TabWins schief // gehen, und alle solchen TabWinDatas oder darauf bezogenen ConnDatas muss ich dann loeschen. @@ -343,7 +312,7 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_ ORelationTableConnectionData* pTabConnData = (ORelationTableConnectionData*)pConn->GetData().get(); try { - if (pTabConnData->DropRelation()) + if ( m_bInRemove || pTabConnData->DropRelation()) return OJoinTableView::RemoveConnection( pConn ,sal_True); } catch(SQLException& e) @@ -407,7 +376,7 @@ void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_DELETE_WINDOW),String(),WB_YES_NO|WB_DEF_YES,OSQLMessageBox::Warning); - if(aDlg.Execute() == RET_YES) + if ( m_bInRemove || aDlg.Execute() == RET_YES ) { m_pView->getController().getUndoMgr()->Clear(); OJoinTableView::RemoveTabWin( pTabWin ); @@ -488,4 +457,33 @@ bool ORelationTableView::allowQueries() const { return false; } +// ----------------------------------------------------------------------------- +void ORelationTableView::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + +} +// ----------------------------------------------------------------------------- +void ORelationTableView::_elementRemoved( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) +{ + m_bInRemove = true; + ::rtl::OUString sName; + if ( _rEvent.Accessor >>= sName ) + { + OTableWindow* pTableWindow = GetTabWindow(sName); + if ( pTableWindow ) + { + m_pView->getController().getUndoMgr()->Clear(); + OJoinTableView::RemoveTabWin( pTableWindow ); + + m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION); + m_pView->getController().InvalidateFeature(ID_BROWSER_UNDO); + m_pView->getController().InvalidateFeature(ID_BROWSER_REDO); + } + } // if ( _rEvent.Accessor >>= sName ) + m_bInRemove = false; +} +// ----------------------------------------------------------------------------- +void ORelationTableView::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ +} diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 90439ad78585..a7ddd801fc51 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FieldDescriptions.cxx,v $ - * $Revision: 1.29 $ + * $Revision: 1.29.50.1 $ * * This file is part of OpenOffice.org. * @@ -519,10 +519,26 @@ sal_Int32 OFieldDescription::GetType() const // ----------------------------------------------------------------------------- sal_Int32 OFieldDescription::GetPrecision() const { + sal_Int32 nPrec = m_nPrecision; if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_PRECISION) ) - return ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION)); - else - return m_nPrecision; + nPrec = ::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION)); + + TOTypeInfoSP pTypeInfo = getTypeInfo(); + if ( pTypeInfo ) + { + switch ( pTypeInfo->nType ) + { + case DataType::TINYINT: + case DataType::SMALLINT: + case DataType::INTEGER: + case DataType::BIGINT: + if ( !nPrec ) + nPrec = pTypeInfo->nPrecision; + break; + } // switch ( pTypeInfo->nType ) + } + + return nPrec; } // ----------------------------------------------------------------------------- sal_Int32 OFieldDescription::GetScale() const diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 1b8573081020..29a8ca4951b3 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TEditControl.cxx,v $ - * $Revision: 1.60 $ + * $Revision: 1.60.26.1 $ * * This file is part of OpenOffice.org. * @@ -688,6 +688,17 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) case FIELD_PROPERTY_SCALE: case FIELD_PROPERTY_BOOL_DEFAULT: pDescrWin->SaveData(pActFieldDescr); + + if ( FIELD_PROPERTY_AUTOINC == nColId && pActFieldDescr->IsAutoIncrement() ) + { + OTableController& rController = GetView()->getController(); + if ( rController.isAutoIncrementPrimaryKey() ) + { + pActFieldDescr->SetPrimaryKey( true ); + InvalidateHandleColumn(); + Invalidate(); + } + } break; } return sal_True; @@ -1553,8 +1564,8 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ ) // oder wenn Spalten nicht gedroped werden können und das Required Flag ist nicht gesetzt // oder wenn eine ::com::sun::star::sdbcx::View vorhanden ist und das Required Flag nicht gesetzt ist TOTypeInfoSP pTypeInfo = pFieldDescr->getTypeInfo(); - if( pTypeInfo->nSearchType == ColumnSearch::NONE || - (pFieldDescr->IsNullable() && pRow->IsReadOnly()) + if( pTypeInfo->nSearchType == ColumnSearch::NONE + || (pFieldDescr->IsNullable() && pRow->IsReadOnly()) ) return sal_False; } @@ -1758,6 +1769,14 @@ void OTableEditorCtrl::AdjustFieldDescription(OFieldDescription* _pFieldDesc, { _pFieldDesc->SetIsNullable(ColumnValue::NO_NULLS); _pFieldDesc->SetControlDefault(Any()); + } // if(!_bSet && _pFieldDesc->getTypeInfo()->bNullable) + if ( _pFieldDesc->IsAutoIncrement() && !_bPrimaryKey ) + { + OTableController& rController = GetView()->getController(); + if ( rController.isAutoIncrementPrimaryKey() ) + { + _pFieldDesc->SetAutoIncrement(false); + } } ////////////////////////////////////////////////////////////////////// // update field description @@ -1777,13 +1796,12 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet ) long nIndex = 0; ::std::vector< ::boost::shared_ptr >::const_iterator aIter = m_pRowList->begin(); - for(;aIter != m_pRowList->end();++aIter) + for(sal_Int32 nRow = 0;aIter != m_pRowList->end();++aIter,++nRow) { OFieldDescription* pFieldDescr = (*aIter)->GetActFieldDescr(); - if( pFieldDescr && (*aIter)->IsPrimaryKey() ) + if( pFieldDescr && (*aIter)->IsPrimaryKey() && (!bSet || !IsRowSelected(nRow)) ) { - nIndex = aIter - m_pRowList->begin(); - AdjustFieldDescription(pFieldDescr,aDeletedPrimKeys,nIndex,bSet,sal_False); + AdjustFieldDescription(pFieldDescr,aDeletedPrimKeys,nRow,bSet,sal_False); } } diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 9829af18b2a0..632dc665ff57 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TableController.cxx,v $ - * $Revision: 1.122 $ + * $Revision: 1.122.24.3 $ * * This file is part of OpenOffice.org. * @@ -110,12 +110,14 @@ #ifndef _COM_SUN_STAR_SDBCX_XINDEXESSUPPLIER_HPP_ #include #endif +#include #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include #endif #ifndef _COM_SUN_STAR_UI_XEXECUTABLEDIALOG_HPP_ #include #endif +#include #ifndef _COMPHELPER_STREAMSECTION_HXX_ #include #endif @@ -163,13 +165,14 @@ #ifndef _CPPUHELPER_EXC_HLP_HXX_ #include #endif +#include "dsmeta.hxx" extern "C" void SAL_CALL createRegistryInfo_OTableControl() { static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OTableController > aAutoRegistration; } - +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; using namespace ::com::sun::star::beans; @@ -252,6 +255,7 @@ OTableController::OTableController(const Reference< XMultiServiceFactory >& _rM) InvalidateAll(); m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER); + m_aTypeCollection.initUserDriverTypes(_rM); } // ----------------------------------------------------------------------------- OTableController::~OTableController() @@ -422,7 +426,12 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) if (_bSaveAs && !bNew) aDefaultName = String(m_sName); else - aDefaultName = getPrivateTitle(); + { + String aName = String(ModuleRes(STR_TBL_TITLE)); + aDefaultName = aName.GetToken(0,' '); + //aDefaultName = getPrivateTitle(); + aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName); + } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ); @@ -492,6 +501,13 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) } // now check if our datasource has set a tablefilter and if append the new table name to it ::dbaui::appendToFilter(getConnection(),m_sName,getORB(),getView()); // we are not interessted in the return value + Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); + if ( xEventListener.is() ) + { + frame::TitleChangedEvent aEvent; + xEventListener->titleChanged(aEvent); + } + releaseNumberForComponent(); } else if(m_xTable.is()) { @@ -1075,7 +1091,8 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: ::comphelper::UStringMixEqual bCase(xMetaData.is() ? xMetaData->supportsMixedCaseQuotedIdentifiers() : sal_True); ::std::vector< ::boost::shared_ptr >::const_iterator aIter = m_vRowList.begin(); - for(;aIter != m_vRowList.end();++aIter) + ::std::vector< ::boost::shared_ptr >::const_iterator aEnd = m_vRowList.end(); + for(;aIter != aEnd;++aIter) { OFieldDescription* pFieldDesc = (*aIter)->GetActFieldDescr(); if (pFieldDesc && pFieldDesc->GetName().getLength()) @@ -1083,7 +1100,7 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: bFoundPKey |= (*aIter)->IsPrimaryKey(); // first check for duplicate names ::std::vector< ::boost::shared_ptr >::const_iterator aIter2 = aIter+1; - for(;aIter2 != m_vRowList.end();++aIter2) + for(;aIter2 != aEnd;++aIter2) { OFieldDescription* pCompareDesc = (*aIter2)->GetActFieldDescr(); if (pCompareDesc && bCase(pCompareDesc->GetName(),pFieldDesc->GetName())) @@ -1121,15 +1138,13 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: pActFieldDescr->SetAutoIncrement(sal_False); // #95927# pTypeInfo->bAutoIncrement pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); - pActFieldDescr->SetName( createUniqueName(::rtl::OUString::createFromAscii("ID") )); pActFieldDescr->SetPrimaryKey( sal_True ); m_vRowList.insert(m_vRowList.begin(),pNewRow); static_cast(getView())->GetEditorCtrl()->Invalidate(); - // static_cast(getView())->GetEditorCtrl()->DisplayData(0); static_cast(getView())->GetEditorCtrl()->RowInserted(0); - } + } // if ( pTypeInfo.get() ) } else if (nReturn == RET_CANCEL) bOk = sal_False; @@ -1676,5 +1691,10 @@ sal_Int32 OTableController::getFirstEmptyRowPosition() const return nRet; } // ----------------------------------------------------------------------------- - - +bool OTableController::isAutoIncrementPrimaryKey() const +{ + ::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_URL))); + DataSourceMetaData aMeta(eType); + return aMeta.getAdvancedSettingsSupport().bAutoIncrementIsPrimaryKey; +} +// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index aa6b532a4f7a..547bad4cee07 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: unoadmin.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.20.34.1 $ * * This file is part of OpenOffice.org. * @@ -94,7 +94,7 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XM { DBG_CTOR(ODatabaseAdministrationDialog,NULL); - m_pCollection = new ODsnTypeCollection(); + m_pCollection = new ::dbaccess::ODsnTypeCollection(); m_pCollection->initUserDriverTypes(m_aContext.getLegacyServiceFactory()); ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection); } diff --git a/dbaccess/util/makefile.mk b/dbaccess/util/makefile.mk index 6efdaf10a143..d9ccc3a5ffda 100644 --- a/dbaccess/util/makefile.mk +++ b/dbaccess/util/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.38 $ +# $Revision: 1.38.68.2 $ # # This file is part of OpenOffice.org. # @@ -46,7 +46,7 @@ LDUMP=ldump2.exe # --- database core (dba) ----------------------------------- -LIB1TARGET=$(SLB)$/dbaccess.lib +LIB1TARGET=$(SLB)$/$(TARGET).lib LIB1FILES=\ $(SLB)$/api.lib \ $(SLB)$/dataaccess.lib \ @@ -75,10 +75,16 @@ SHL1STDLIBS= \ $(FWELIB) \ $(SALHELPERLIB) +SHL1DEPN= +SHL1IMPLIB=i$(TARGET) SHL1LIBS=$(LIB1TARGET) SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP=$(TARGET).map +DEFLIB1NAME=$(TARGET) +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \ + $(SLB)$/$(TARGET).lib +# SHL1VERSIONMAP=$(TARGET).map +SHL1USE_EXPORTS=name # --- .res file ---------------------------------------------------------- @@ -127,6 +133,15 @@ SHL2STDLIBS= \ $(SO2LIB) \ $(VOSLIB) \ $(SALLIB) + +.IF "$(GUI)"!="WNT" || "$(COM)"=="GCC" +SHL2STDLIBS+= \ + -l$(TARGET)$(DLLPOSTFIX) +.ELSE +SHL2STDLIBS+= \ + i$(TARGET).lib +.ENDIF + SHL2DEPN= SHL2IMPLIB=i$(TARGET2) @@ -140,6 +155,7 @@ DEF2DEPN= $(MISC)$/$(SHL2TARGET).flt \ SHL2USE_EXPORTS=name ALL: \ + $(LIB1TARGET) \ $(LIB2TARGET) \ ALLTAR @@ -211,6 +227,11 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk @echo CLEAR_THE_FILE > $@ @echo _TI >>$@ @echo _real >>$@ -.ENDIF +$(MISC)$/$(SHL1TARGET).flt: makefile.mk + @echo ------------------------------ + @echo CLEAR_THE_FILE > $@ + @echo _TI >>$@ + @echo _real >>$@ +.ENDIF -- cgit