Tag: cws_src680_qiq User: fs Date: 06/05/30 01:24:14 Modified: /dba/dbaccess/source/sdbtools/connection/ objectnames.cxx, objectnames.hxx
Log: createObjectNames -> getObjectNames (the thing is stateless, so no need to re-create it every time) File Changes: Directory: /dba/dbaccess/source/sdbtools/connection/ ==================================================== File [changed]: objectnames.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/sdbtools/connection/objectnames.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +13 -6 -------------------- --- objectnames.cxx 24 May 2006 06:54:23 -0000 1.1.2.1 +++ objectnames.cxx 30 May 2006 08:24:11 -0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: objectnames.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: fs $ $Date: 2006/05/24 06:54:23 $ + * last change: $Author: fs $ $Date: 2006/05/30 08:24:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -258,18 +258,25 @@ } //-------------------------------------------------------------------- - ::rtl::OUString SAL_CALL ObjectNames::createUniqueName( ::sal_Int32 _CommandType, const ::rtl::OUString& _BaseName ) throw (IllegalArgumentException, RuntimeException) + ::rtl::OUString SAL_CALL ObjectNames::suggestName( ::sal_Int32 _CommandType, const ::rtl::OUString& _BaseName ) throw (IllegalArgumentException, RuntimeException) { EntryGuard aGuard( *this ); PNameCheck pNameCheck( NameCheckFactory::createNameCheck( _CommandType, getConnection()) ); - ::rtl::OUString sName( _BaseName ); + String sBaseName( _BaseName ); + if ( sBaseName.Len() == 0 ) + if ( _CommandType == CommandType::TABLE ) + sBaseName = String( SdbtRes( STR_BASENAME_TABLE ) ); + else + sBaseName = String( SdbtRes( STR_BASENAME_QUERY ) ); + + ::rtl::OUString sName( sBaseName ); sal_Int32 i = 1; while ( pNameCheck->isNameUsed( sName ) ) { ::rtl::OUStringBuffer aNameBuffer; - aNameBuffer.append( _BaseName ); + aNameBuffer.append( sBaseName ); aNameBuffer.appendAscii( " " ); aNameBuffer.append( (sal_Int32)++i ); sName = aNameBuffer.makeStringAndClear(); File [changed]: objectnames.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/sdbtools/connection/objectnames.hxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +4 -4 ------------------- --- objectnames.hxx 24 May 2006 06:54:23 -0000 1.1.2.1 +++ objectnames.hxx 30 May 2006 08:24:11 -0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: objectnames.hxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: fs $ $Date: 2006/05/24 06:54:23 $ + * last change: $Author: fs $ $Date: 2006/05/30 08:24:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -81,7 +81,7 @@ ObjectNames( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection ); // XObjectNames - virtual ::rtl::OUString SAL_CALL createUniqueName( ::sal_Int32 CommandType, const ::rtl::OUString& BaseName ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL suggestName( ::sal_Int32 CommandType, const ::rtl::OUString& BaseName ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL convertToSQLName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isNameUsed( ::sal_Int32 CommandType, const ::rtl::OUString& Name ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL checkNameIsUsed( ::sal_Int32 CommandType, const ::rtl::OUString& Name ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
