Tag: cws_src680_dba24b User: fs Date: 2007-08-27 10:45:08+0000 Modified: dba/dbaccess/source/ui/dlg/DbAdminImpl.cxx dba/dbaccess/source/ui/dlg/DbAdminImpl.hxx
Log: re-factoring for #i80930#: made getDataSourceType static File Changes: Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: DbAdminImpl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/DbAdminImpl.cxx?r1=1.18&r2=1.18.28.1 Delta lines: +15 -9 -------------------- --- DbAdminImpl.cxx 2007-07-06 08:11:06+0000 1.18 +++ DbAdminImpl.cxx 2007-08-27 10:45:06+0000 1.18.28.1 @@ -4,9 +4,9 @@ * * $RCSfile: DbAdminImpl.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.18.28.1 $ * - * last change: $Author: rt $ $Date: 2007/07/06 08:11:06 $ + * last change: $Author: fs $ $Date: 2007/08/27 10:45:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -470,15 +470,21 @@ return m_xDatasource; } //------------------------------------------------------------------------- -DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType(const SfxItemSet& _rSet) const +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!"); + 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; + String sConnectURL = pConnectURL->GetValue(); ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); - DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); - return pCollection->getType(sConnectURL); + DBG_ASSERT( pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!" ); + if ( !pCollection ) + return DST_UNKNOWN; + + return pCollection->getType( sConnectURL ); } //------------------------------------------------------------------------- File [changed]: DbAdminImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/DbAdminImpl.hxx?r1=1.8&r2=1.8.46.1 Delta lines: +4 -4 ------------------- --- DbAdminImpl.hxx 2007-05-10 10:22:58+0000 1.8 +++ DbAdminImpl.hxx 2007-08-27 10:45:06+0000 1.8.46.1 @@ -4,9 +4,9 @@ * * $RCSfile: DbAdminImpl.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.8.46.1 $ * - * last change: $Author: kz $ $Date: 2007/05/10 10:22:58 $ + * last change: $Author: fs $ $Date: 2007/08/27 10:45:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -146,7 +146,7 @@ /** extracts the connection type from the given set<p/> The connection type is determined by the value of the DSN item, analyzed by the TypeCollection item. */ - DATASOURCE_TYPE getDatasourceType(const SfxItemSet& _rSet) const; + static DATASOURCE_TYPE getDatasourceType( const SfxItemSet& _rSet ); /** returns the connection URL @return --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
