diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-11-14 06:48:51 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-11-14 06:48:51 +0000 |
commit | 81a08a78eca2230930bb91def5adbd8850d0e3cc (patch) | |
tree | b1f5ee71ed88b3997b19092978d04b93dbc8746f /connectivity | |
parent | 7a40dae27490594746989ff5e46f402e1af5574c (diff) |
#105110# extend createUniqueName with bool param
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/inc/connectivity/dbtools.hxx | 17 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 12 |
2 files changed, 20 insertions, 9 deletions
diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx index 6be21f27c1ae..18670d781970 100644 --- a/connectivity/inc/connectivity/dbtools.hxx +++ b/connectivity/inc/connectivity/dbtools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtools.hxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: oj $ $Date: 2002-11-07 08:41:59 $ + * last change: $Author: oj $ $Date: 2002-11-14 07:48:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -314,11 +314,18 @@ namespace dbtools const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); /** search for a name that is NOT in the NameAcces - @param _rxContainer the NameAcces container to search in - @param _rBaseName the base name that should be created + @param _rxContainer + the NameAccess container to search in + @param _rBaseName + the base name that should be used to create the new name + @param _bStartWithNumber + When <TRUE/> the name ends with number even when the name itself doesn't occur in the collection. + @return + A name which doesn't exist in the collection. */ ::rtl::OUString createUniqueName(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxContainer, - const ::rtl::OUString& _rBaseName); + const ::rtl::OUString& _rBaseName, + sal_Bool _bStartWithNumber = sal_True); /** create a name which is a valid SQL 92 identifier name @param _rName the string which should be converted diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 6bb215c47b8f..669adef70fd8 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbtools.cxx,v $ * - * $Revision: 1.46 $ + * $Revision: 1.47 $ * - * last change: $Author: oj $ $Date: 2002-10-07 12:48:11 $ + * last change: $Author: oj $ $Date: 2002-11-14 07:48:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1259,11 +1259,12 @@ sal_Int32 getSearchColumnFlag( const Reference< XConnection>& _rxConn,sal_Int32 return nSearchFlag; } // ----------------------------------------------------------------------------- -::rtl::OUString createUniqueName(const Reference<XNameAccess>& _rxContainer,const ::rtl::OUString& _rBaseName) +::rtl::OUString createUniqueName(const Reference<XNameAccess>& _rxContainer,const ::rtl::OUString& _rBaseName,sal_Bool _bStartWithNumber) { ::rtl::OUString sName(_rBaseName); sal_Int32 nPos = 1; - sName += ::rtl::OUString::valueOf(nPos); + if ( _bStartWithNumber ) + sName += ::rtl::OUString::valueOf(nPos); while(_rxContainer->hasByName(sName)) { @@ -1787,6 +1788,9 @@ void checkDisposed(sal_Bool _bThrow) throw ( DisposedException ) /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.46 2002/10/07 12:48:11 oj + * #i3289# correct table name quoting so that in every situation the correct schema, catalog is used + * * Revision 1.45 2002/09/13 08:28:02 fs * #103242# implSetObject: handle TypeClass_HYPER * |