diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-03-30 13:01:50 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-03-30 13:01:50 +0000 |
commit | 2c7d09b02814986e858d37e34eef123bf913b208 (patch) | |
tree | 7ca478b935ba6318c07d344867771b2e9fe6c522 /connectivity/source/sdbcx | |
parent | 6388eec544b14749fcce25123f1d4d315431cc4b (diff) |
#85298##85297# correct index impl
Diffstat (limited to 'connectivity/source/sdbcx')
-rw-r--r-- | connectivity/source/sdbcx/VCollection.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/sdbcx/VIndex.cxx | 7 |
2 files changed, 15 insertions, 8 deletions
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx index d1e46d5278a6..ca101c2d33fe 100644 --- a/connectivity/source/sdbcx/VCollection.cxx +++ b/connectivity/source/sdbcx/VCollection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VCollection.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-03-12 13:51:27 $ + * last change: $Author: oj $ $Date: 2001-03-30 14:01:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,10 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#define CONNECTIVITY_PROPERTY_NAME_SPACE dbtools +#ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ +#include "propertyids.hxx" +#endif using namespace connectivity::sdbcx; using namespace connectivity; @@ -266,8 +270,8 @@ void SAL_CALL OCollection::dropByName( const ::rtl::OUString& elementName ) thro void SAL_CALL OCollection::dropByIndex( sal_Int32 index ) throw(SQLException, IndexOutOfBoundsException, RuntimeException) { ::osl::MutexGuard aGuard(m_rMutex); - if(index <0 || index > getCount()) - throw IndexOutOfBoundsException(::rtl::OUString(),*this); + if(index <0 || index >= getCount()) + throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this); ::comphelper::disposeComponent(m_aElements[index]->second); ::rtl::OUString elementName = m_aElements[index]->first; @@ -281,11 +285,11 @@ void SAL_CALL OCollection::dropByIndex( sal_Int32 index ) throw(SQLException, In static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent); } // ------------------------------------------------------------------------- -sal_Int32 SAL_CALL OCollection::findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) +sal_Int32 SAL_CALL OCollection::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, ::com::sun::star::uno::RuntimeException) { ObjectIter aIter = m_aNameMap.find(columnName); if(aIter == m_aNameMap.end()) - throw ::com::sun::star::sdbc::SQLException(); + throw SQLException(::rtl::OUString::createFromAscii("Unknown column name!"),*this,connectivity::dbtools::SQLSTATE_GENERAL,1000,makeAny(NoSuchElementException(columnName,*this)) ); return m_aElements.size() - (m_aElements.end() - ::std::find(m_aElements.begin(),m_aElements.end(),aIter)) +1; // because cloumns start at one } diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx index a8015e1ca434..e9136a6943a2 100644 --- a/connectivity/source/sdbcx/VIndex.cxx +++ b/connectivity/source/sdbcx/VIndex.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VIndex.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-03-02 13:09:17 $ + * last change: $Author: oj $ $Date: 2001-03-30 14:01:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,6 +123,9 @@ sal_Bool SAL_CALL OIndex::supportsService( const ::rtl::OUString& _rServiceName OIndex::OIndex(sal_Bool _bCase) : ODescriptor_BASE(m_aMutex) , ODescriptor(ODescriptor_BASE::rBHelper,_bCase,sal_True) , m_pColumns(NULL) + ,m_IsUnique(sal_False) + ,m_IsClustered(sal_False) + ,m_IsPrimaryKeyIndex(sal_False) { } // ------------------------------------------------------------------------- |