From 604a2304a7c1fb5e17ddfa07b011724622faffb2 Mon Sep 17 00:00:00 2001 From: Gil Forcada Date: Tue, 12 Oct 2010 22:40:56 +0200 Subject: [PATCH] Removed comments, trailing spaces and death code --- dbaccess/source/core/api/BookmarkSet.cxx | 33 +- dbaccess/source/core/api/BookmarkSet.hxx | 2 +- dbaccess/source/core/api/CIndexColumn.hxx | 2 +- dbaccess/source/core/api/CIndexes.cxx | 15 +- dbaccess/source/core/api/CIndexes.hxx | 2 +- dbaccess/source/core/api/CRowSetColumn.cxx | 12 +- dbaccess/source/core/api/CRowSetColumn.hxx | 4 +- dbaccess/source/core/api/CRowSetDataColumn.cxx | 34 +-- dbaccess/source/core/api/CRowSetDataColumn.hxx | 8 +- dbaccess/source/core/api/CacheSet.cxx | 151 +++++------ dbaccess/source/core/api/CacheSet.hxx | 6 +- dbaccess/source/core/api/FilteredContainer.cxx | 30 +-- dbaccess/source/core/api/HelperCollections.cxx | 11 +- dbaccess/source/core/api/HelperCollections.hxx | 4 +- dbaccess/source/core/api/KeySet.cxx | 156 +++++----- dbaccess/source/core/api/KeySet.hxx | 27 +- dbaccess/source/core/api/OptimisticSet.cxx | 72 ++--- dbaccess/source/core/api/OptimisticSet.hxx | 17 +- dbaccess/source/core/api/PrivateRow.cxx | 2 +- dbaccess/source/core/api/PrivateRow.hxx | 2 +- dbaccess/source/core/api/RowSet.cxx | 314 ++++++++------------ dbaccess/source/core/api/RowSet.hxx | 2 +- dbaccess/source/core/api/RowSetBase.cxx | 194 ++++++------- dbaccess/source/core/api/RowSetBase.hxx | 11 +- dbaccess/source/core/api/RowSetCache.cxx | 114 ++++---- dbaccess/source/core/api/RowSetCache.hxx | 2 +- dbaccess/source/core/api/RowSetCacheIterator.cxx | 32 +- dbaccess/source/core/api/RowSetCacheIterator.hxx | 10 +- dbaccess/source/core/api/RowSetRow.hxx | 9 +- .../source/core/api/SingleSelectQueryComposer.cxx | 135 ++++----- dbaccess/source/core/api/StaticSet.cxx | 75 +++--- dbaccess/source/core/api/StaticSet.hxx | 3 +- dbaccess/source/core/api/TableDeco.cxx | 185 ++++++------- dbaccess/source/core/api/View.cxx | 19 +- dbaccess/source/core/api/WrappedResultSet.cxx | 33 +- dbaccess/source/core/api/WrappedResultSet.hxx | 2 +- dbaccess/source/core/api/callablestatement.cxx | 32 +-- dbaccess/source/core/api/column.cxx | 47 +--- dbaccess/source/core/api/columnsettings.cxx | 9 +- dbaccess/source/core/api/datacolumn.cxx | 57 +--- dbaccess/source/core/api/datacolumn.hxx | 2 +- dbaccess/source/core/api/datasettings.cxx | 15 +- dbaccess/source/core/api/definitioncolumn.cxx | 54 +--- dbaccess/source/core/api/makefile.mk | 2 +- dbaccess/source/core/api/preparedstatement.cxx | 43 +--- dbaccess/source/core/api/query.cxx | 31 +-- dbaccess/source/core/api/query.hxx | 4 +- dbaccess/source/core/api/querycomposer.cxx | 59 ++-- dbaccess/source/core/api/querycontainer.cxx | 44 +-- dbaccess/source/core/api/querydescriptor.cxx | 55 +--- dbaccess/source/core/api/querydescriptor.hxx | 2 +- dbaccess/source/core/api/resultcolumn.cxx | 20 +- dbaccess/source/core/api/resultcolumn.hxx | 2 +- dbaccess/source/core/api/resultset.cxx | 133 +++------ dbaccess/source/core/api/resultset.hxx | 2 +- dbaccess/source/core/api/statement.cxx | 49 +--- dbaccess/source/core/api/table.cxx | 71 ++--- dbaccess/source/core/api/tablecontainer.cxx | 50 ++-- dbaccess/source/core/api/viewcontainer.cxx | 30 +- 59 files changed, 966 insertions(+), 1577 deletions(-) diff --git a/dbaccess/source/core/api/BookmarkSet.cxx b/dbaccess/source/core/api/BookmarkSet.cxx index e896469..50e705a 100644 --- a/dbaccess/source/core/api/BookmarkSet.cxx +++ b/dbaccess/source/core/api/BookmarkSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,43 +55,43 @@ void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet,const ::r OCacheSet::construct(_xDriverSet,i_sRowSetFilter); m_xRowLocate.set(_xDriverSet,UNO_QUERY); } -// ----------------------------------------------------------------------------- + Any SAL_CALL OBookmarkSet::getBookmark() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::getBookmark" ); return m_xRowLocate->getBookmark(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OBookmarkSet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::moveToBookmark" ); return m_xRowLocate->moveToBookmark(bookmark); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OBookmarkSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::moveRelativeToBookmark" ); return m_xRowLocate->moveRelativeToBookmark(bookmark,rows); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OBookmarkSet::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::compareBookmarks" ); return m_xRowLocate->compareBookmarks(_first,_second); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OBookmarkSet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::hasOrderedBookmarks" ); return m_xRowLocate->hasOrderedBookmarks(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OBookmarkSet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::hashBookmark" ); return m_xRowLocate->hashBookmark(bookmark); } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL OBookmarkSet::deleteRows( const Sequence< Any >& rows ,const connectivity::OSQLTable& /*_xTable*/) throw(SQLException, RuntimeException) { @@ -103,7 +103,7 @@ Sequence< sal_Int32 > SAL_CALL OBookmarkSet::deleteRows( const Sequence< Any >& } return Sequence< sal_Int32 >(); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::insertRow" ); @@ -128,7 +128,7 @@ void SAL_CALL OBookmarkSet::insertRow( const ORowSetRow& _rInsertRow,const conne else ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_XRESULTSETUPDATE ), SQL_GENERAL_ERROR, *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::updateRow" ); @@ -153,7 +153,7 @@ void SAL_CALL OBookmarkSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowS else ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_XRESULTSETUPDATE ), SQL_GENERAL_ERROR, *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::deleteRow(const ORowSetRow& /*_rDeleteRow*/ ,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::deleteRow" ); @@ -161,12 +161,12 @@ void SAL_CALL OBookmarkSet::deleteRow(const ORowSetRow& /*_rDeleteRow*/ ,const c xUpd->deleteRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::cancelRowUpdates" ); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::moveToInsertRow" ); @@ -174,18 +174,18 @@ void SAL_CALL OBookmarkSet::moveToInsertRow( ) throw(SQLException, RuntimeExcep if(xUpd.is()) xUpd->moveToInsertRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL OBookmarkSet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::moveToCurrentRow" ); } -// ------------------------------------------------------------------------- + void OBookmarkSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::fillValueRow" ); OCacheSet::fillValueRow(_rRow,_nPosition); } -// ------------------------------------------------------------------------- + void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParameter,const ORowSetValue& _rValue) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::updateColumn" ); @@ -265,4 +265,3 @@ void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParamet } } } - diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx index faa8062..b3e21a4 100644 --- a/dbaccess/source/core/api/BookmarkSet.hxx +++ b/dbaccess/source/core/api/BookmarkSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/CIndexColumn.hxx b/dbaccess/source/core/api/CIndexColumn.hxx index 80bc09d..3d71ee1 100644 --- a/dbaccess/source/core/api/CIndexColumn.hxx +++ b/dbaccess/source/core/api/CIndexColumn.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/CIndexes.cxx b/dbaccess/source/core/api/CIndexes.cxx index 27fd74a..40ae0e3 100644 --- a/dbaccess/source/core/api/CIndexes.cxx +++ b/dbaccess/source/core/api/CIndexes.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,7 +59,7 @@ ObjectType OIndexes::createObject(const ::rtl::OUString& _rName) return xRet; } -// ------------------------------------------------------------------------- + Reference< XPropertySet > OIndexes::createDescriptor() { Reference xData( m_xIndexes,UNO_QUERY); @@ -68,7 +68,7 @@ Reference< XPropertySet > OIndexes::createDescriptor() else return OIndexesHelper::createDescriptor(); } -// ------------------------------------------------------------------------- + // XAppend ObjectType OIndexes::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { @@ -79,7 +79,7 @@ ObjectType OIndexes::appendObject( const ::rtl::OUString& _rForName, const Refer xData->appendByDescriptor(descriptor); return createObject( _rForName ); } -// ------------------------------------------------------------------------- + // XDrop void OIndexes::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) { @@ -92,7 +92,7 @@ void OIndexes::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) else OIndexesHelper::dropObject(_nPos,_sElementName); } -// ------------------------------------------------------------------------- + void SAL_CALL OIndexes::disposing(void) { if ( m_xIndexes.is() ) @@ -100,8 +100,3 @@ void SAL_CALL OIndexes::disposing(void) else OIndexesHelper::disposing(); } -// ----------------------------------------------------------------------------- - - - - diff --git a/dbaccess/source/core/api/CIndexes.hxx b/dbaccess/source/core/api/CIndexes.hxx index eee1d48..33e87a0 100644 --- a/dbaccess/source/core/api/CIndexes.hxx +++ b/dbaccess/source/core/api/CIndexes.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/CRowSetColumn.cxx b/dbaccess/source/core/api/CRowSetColumn.cxx index 60c4fe1..1220a93 100644 --- a/dbaccess/source/core/api/CRowSetColumn.cxx +++ b/dbaccess/source/core/api/CRowSetColumn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,19 +43,15 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::beans; -//.............................................................................. namespace dbaccess { -//.............................................................................. -//------------------------------------------------------------------------------ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData, const Reference < XRow >& _xRow, sal_Int32 _nPos, const Reference< XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rDescription, const ::rtl::OUString& i_sLabel,ORowSetCacheIterator& _rColumnValue ) :ORowSetDataColumn( _xMetaData, _xRow, NULL, _nPos, _rxDBMeta, _rDescription, i_sLabel,_rColumnValue ) { } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const { const sal_Int32 nDerivedProperties = 21; @@ -68,7 +64,7 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData DECL_PROP1_BOOL( ISAUTOINCREMENT, READONLY ); DECL_PROP1_BOOL( ISCASESENSITIVE, READONLY ); DECL_PROP1_BOOL( ISCURRENCY, READONLY ); - DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY ); + DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY ); DECL_PROP1( ISNULLABLE, sal_Int32, READONLY ); DECL_PROP1_BOOL( ISREADONLY, BOUND ); DECL_PROP1_BOOL( ISROWVERSION, READONLY ); @@ -92,13 +88,11 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDerivedProperties, aRegisteredProperties ), sal_False ); } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& ORowSetColumn::getInfoHelper() { return *static_cast< ::comphelper::OPropertyArrayUsageHelper< ORowSetColumn >* >(this)->getArrayHelper(); } -//------------------------------------------------------------------------------ void SAL_CALL ORowSetColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )throw (Exception) { OSL_ENSURE( nHandle != PROPERTY_ID_VALUE, "ORowSetColumn::setFastPropertyValue_NoBroadcast: hmm? This property is marked as READONLY!" ); @@ -106,6 +100,4 @@ void SAL_CALL ORowSetColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, ORowSetDataColumn::setFastPropertyValue_NoBroadcast( nHandle, rValue ); } -//.............................................................................. } // namespace dbaccess -//.............................................................................. diff --git a/dbaccess/source/core/api/CRowSetColumn.hxx b/dbaccess/source/core/api/CRowSetColumn.hxx index f82d806..16eb830 100644 --- a/dbaccess/source/core/api/CRowSetColumn.hxx +++ b/dbaccess/source/core/api/CRowSetColumn.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ namespace dbaccess class ORowSetColumn; class ORowSetColumn :public ORowSetDataColumn ,public ::comphelper::OPropertyArrayUsageHelper< ORowSetColumn > - + { public: ORowSetColumn( const ::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XResultSetMetaData >& _xMetaData, diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx index ab1ef90..0d88257 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.cxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ using namespace cppu; using namespace osl; DBG_NAME(ORowSetDataColumn) -// ------------------------------------------------------------------------- + ORowSetDataColumn::ORowSetDataColumn( const Reference < XResultSetMetaData >& _xMetaData, const Reference < XRow >& _xRow, const Reference < XRowUpdate >& _xRowUpdate, @@ -68,14 +68,13 @@ ORowSetDataColumn::ORowSetDataColumn( const Reference < XResultSetMetaData >& _x OColumnSettings::registerProperties( *this ); registerProperty( PROPERTY_DESCRIPTION, PROPERTY_ID_DESCRIPTION, PropertyAttribute::READONLY, &m_aDescription, ::getCppuType( &m_aDescription ) ); } -// ------------------------------------------------------------------------- + ORowSetDataColumn::~ORowSetDataColumn() { DBG_DTOR(ORowSetDataColumn,NULL); } -// ------------------------------------------------------------------------- + // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* ORowSetDataColumn::createArrayHelper( ) const { const sal_Int32 nDerivedProperties = 21; @@ -113,12 +112,11 @@ ORowSetDataColumn::~ORowSetDataColumn() } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& ORowSetDataColumn::getInfoHelper() { return *static_cast< ::comphelper::OPropertyArrayUsageHelper< ORowSetDataColumn >* >(this)->getArrayHelper(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { if ( PROPERTY_ID_VALUE == nHandle ) @@ -140,7 +138,6 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH ODataColumn::getFastPropertyValue( rValue, nHandle ); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSetDataColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )throw (Exception) { switch( nHandle ) @@ -160,7 +157,7 @@ void SAL_CALL ORowSetDataColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHan break; } } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetDataColumn::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, @@ -190,7 +187,7 @@ sal_Bool SAL_CALL ORowSetDataColumn::convertFastPropertyValue( Any & rConvertedV return bModified; } -//-------------------------------------------------------------------------- + Sequence< sal_Int8 > ORowSetDataColumn::getImplementationId() throw (RuntimeException) { static OImplementationId * pId = 0; @@ -205,7 +202,7 @@ Sequence< sal_Int8 > ORowSetDataColumn::getImplementationId() throw (RuntimeExce } return pId->getImplementationId(); } -// ------------------------------------------------------------------------- + void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue) { if ( !m_aColumnValue.isNull() && m_aColumnValue->isValid() && (!(((*m_aColumnValue)->get())[m_nPos] == _rOldValue)) ) @@ -225,7 +222,7 @@ void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue) fire(&nHandle, &aNew, &m_aOldValue, 1, sal_False ); } } -// ----------------------------------------------------------------------------- + DBG_NAME(ORowSetDataColumns ) ORowSetDataColumns::ORowSetDataColumns( sal_Bool _bCase, @@ -238,12 +235,12 @@ ORowSetDataColumns::ORowSetDataColumns( { DBG_CTOR(ORowSetDataColumns ,NULL); } -// ----------------------------------------------------------------------------- + ORowSetDataColumns::~ORowSetDataColumns() { DBG_DTOR(ORowSetDataColumns ,NULL); } -// ----------------------------------------------------------------------------- + sdbcx::ObjectType ORowSetDataColumns::createObject(const ::rtl::OUString& _rName) { connectivity::sdbcx::ObjectType xNamed; @@ -255,7 +252,7 @@ sdbcx::ObjectType ORowSetDataColumns::createObject(const ::rtl::OUString& _rName return xNamed; } -// ----------------------------------------------------------------------------- + void SAL_CALL ORowSetDataColumns::disposing(void) { // clear_NoDispose(); @@ -263,16 +260,13 @@ void SAL_CALL ORowSetDataColumns::disposing(void) m_aColumns = NULL; // m_aColumns.clear(); } -// ----------------------------------------------------------------------------- + void ORowSetDataColumns::assign(const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector) { m_aColumns = _rColumns; reFill(_rVector); } -// ----------------------------------------------------------------------------- + void ORowSetDataColumns::impl_refresh() throw(::com::sun::star::uno::RuntimeException) { } -// ----------------------------------------------------------------------------- - - diff --git a/dbaccess/source/core/api/CRowSetDataColumn.hxx b/dbaccess/source/core/api/CRowSetDataColumn.hxx index 90677d1..1d7ebb5 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.hxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,7 +63,7 @@ namespace dbaccess const ::rtl::OUString& i_sLabel, const ORowSetCacheIterator& _rColumnValue); - + // com::sun::star::lang::XTypeProvider virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException); // comphelper::OPropertyArrayUsageHelper @@ -83,9 +83,6 @@ namespace dbaccess protected: using ODataColumn::getFastPropertyValue; }; - // ------------------------------------------------------------------------- -// typedef connectivity::ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> > -// ORowSetDataColumns_COLLECTION; typedef connectivity::sdbcx::OCollection ORowSetDataColumns_BASE; class ORowSetDataColumns : public ORowSetDataColumns_BASE @@ -110,4 +107,3 @@ namespace dbaccess } #endif - diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 8208025..7af8f38 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,8 +69,8 @@ using namespace ::com::sun::star::io; using namespace ::osl; DBG_NAME(OCacheSet) -// ------------------------------------------------------------------------- -OCacheSet::OCacheSet() + +OCacheSet::OCacheSet() :m_bInserted(sal_False) ,m_bUpdated(sal_False) ,m_bDeleted(sal_False) @@ -79,7 +79,7 @@ OCacheSet::OCacheSet() DBG_CTOR(OCacheSet,NULL); } -// ------------------------------------------------------------------------- + ::rtl::OUString OCacheSet::getIdentifierQuoteString() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getIdentifierQuoteString" ); @@ -89,8 +89,8 @@ OCacheSet::OCacheSet() sQuote = xMeta->getIdentifierQuoteString(); return sQuote; } -// ------------------------------------------------------------------------- -void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& /*i_sRowSetFilter*/) + +void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& /*i_sRowSetFilter*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::construct" ); OSL_ENSURE(_xDriverSet.is(),"Invalid resultSet"); @@ -126,15 +126,15 @@ void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const ::rtl } } } -// ------------------------------------------------------------------------- + OCacheSet::~OCacheSet() { try { - m_xDriverSet = NULL; - m_xDriverRow = NULL; + m_xDriverSet = NULL; + m_xDriverRow = NULL; m_xSetMetaData = NULL; - m_xConnection = NULL; + m_xConnection = NULL; } catch(Exception&) { @@ -147,7 +147,7 @@ OCacheSet::~OCacheSet() DBG_DTOR(OCacheSet,NULL); } -// ----------------------------------------------------------------------------- + void OCacheSet::fillTableName(const Reference& _xTable) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::fillTableName" ); @@ -163,7 +163,7 @@ void OCacheSet::fillTableName(const Reference& _xTable) throw(SQL ,::dbtools::eInDataManipulation); } } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::insertRow" ); @@ -207,27 +207,12 @@ void SAL_CALL OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connecti m_bInserted = xPrep->executeUpdate() > 0; } - -// ::rtl::OUString aCountSql = ::rtl::OUString::createFromAscii("SELECT COUNT(*) FROM "); -// aCountSql += m_aComposedTableName; -// try -// { -// Reference< XStatement > xStmt(m_xConnection->createStatement()); -// Reference xRes(xStmt->executeQuery(aCountSql)); -// if(xRes.is() && xRes->next()) -// { -// Reference xRow(xRes,UNO_QUERY); -// } -// } -// catch(SQLException&) -// { -// } - + // TODO set the bookmark in the insert row } -// ------------------------------------------------------------------------- + void OCacheSet::fillParameters( const ORowSetRow& _rRow - ,const connectivity::OSQLTable& _xTable + ,const connectivity::OSQLTable& _xTable ,::rtl::OUStringBuffer& _sCondition ,::rtl::OUStringBuffer& _sParameter ,::std::list< sal_Int32>& _rOrgValues) @@ -261,7 +246,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow } ::rtl::OUString aColumnName; - + static ::rtl::OUString aPara = ::rtl::OUString::createFromAscii("?,"); static ::rtl::OUString aAnd = ::rtl::OUString::createFromAscii(" AND "); @@ -269,7 +254,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow sal_Int32 nCheckCount = 1; // index for the orginal values sal_Int32 i = 1; - + ::rtl::OUString sIsNull(RTL_CONSTASCII_USTRINGPARAM(" IS NULL")); ::rtl::OUString sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); ORowVector< ORowSetValue >::Vector::const_iterator aIter = _rRow->get().begin()+1; @@ -311,7 +296,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow } } } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::updateRow" ); @@ -322,7 +307,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR aSql.append(m_aComposedTableName); aSql.append(::rtl::OUString::createFromAscii(" SET ")); // list all cloumns that should be set - + ::rtl::OUStringBuffer aCondition; ::std::list< sal_Int32> aOrgValues; fillParameters(_rInsertRow,_xTable,aCondition,aSql,aOrgValues); @@ -359,7 +344,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR m_bUpdated = xPrep->executeUpdate() > 0; } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::deleteRow" ); @@ -403,7 +388,7 @@ void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connecti ::rtl::OUStringBuffer aColumnName; ::std::list< sal_Int32> aOrgValues; fillParameters(_rDeleteRow,_xTable,aSql,aColumnName,aOrgValues); - + aSql.setLength(aSql.getLength()-5); // now create end execute the prepared statement @@ -418,7 +403,7 @@ void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connecti m_bDeleted = xPrep->executeUpdate() > 0; } -// ------------------------------------------------------------------------- + void OCacheSet::setParameter(sal_Int32 nPos ,const Reference< XParameters >& _xParameter ,const ORowSetValue& _rValue @@ -429,7 +414,7 @@ void OCacheSet::setParameter(sal_Int32 nPos sal_Int32 nType = ( _nType != DataType::OTHER ) ? _nType : _rValue.getTypeKind(); ::dbtools::setObjectWithInfo(_xParameter,nPos,_rValue,nType,_nScale); } -// ------------------------------------------------------------------------- + void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::fillValueRow" ); @@ -447,127 +432,127 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) aIter->fill(i,m_aColumnTypes[i-1],m_aNullable[i-1],this); } } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::wasNull( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::wasNull" ); return m_xDriverRow->wasNull(); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OCacheSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getString" ); return m_xDriverRow->getString(columnIndex); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getBoolean" ); return m_xDriverRow->getBoolean(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int8 SAL_CALL OCacheSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getByte" ); return m_xDriverRow->getByte(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int16 SAL_CALL OCacheSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getShort" ); return m_xDriverRow->getShort(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OCacheSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getInt" ); return m_xDriverRow->getInt(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int64 SAL_CALL OCacheSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getLong" ); return m_xDriverRow->getLong(columnIndex); } -// ------------------------------------------------------------------------- + float SAL_CALL OCacheSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getFloat" ); return m_xDriverRow->getFloat(columnIndex); } -// ------------------------------------------------------------------------- + double SAL_CALL OCacheSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getDouble" ); return m_xDriverRow->getDouble(columnIndex); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL OCacheSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getBytes" ); return m_xDriverRow->getBytes(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Date SAL_CALL OCacheSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getDate" ); return m_xDriverRow->getDate(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Time SAL_CALL OCacheSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getTime" ); return m_xDriverRow->getTime(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::DateTime SAL_CALL OCacheSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getTimestamp" ); return m_xDriverRow->getTimestamp(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCacheSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getBinaryStream" ); return m_xDriverRow->getBinaryStream(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCacheSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getCharacterStream" ); return m_xDriverRow->getCharacterStream(columnIndex); } -// ------------------------------------------------------------------------- + Any SAL_CALL OCacheSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getObject" ); return m_xDriverRow->getObject(columnIndex,typeMap); } -// ------------------------------------------------------------------------- + Reference< XRef > SAL_CALL OCacheSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getRef" ); return m_xDriverRow->getRef(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XBlob > SAL_CALL OCacheSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getBlob" ); return m_xDriverRow->getBlob(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XClob > SAL_CALL OCacheSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getClob" ); return m_xDriverRow->getClob(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XArray > SAL_CALL OCacheSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getArray" ); return m_xDriverRow->getArray(columnIndex); } -// ------------------------------------------------------------------------- + // XResultSet sal_Bool SAL_CALL OCacheSet::next( ) throw(SQLException, RuntimeException) { @@ -575,143 +560,141 @@ sal_Bool SAL_CALL OCacheSet::next( ) throw(SQLException, RuntimeException) m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->next(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::isBeforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::isBeforeFirst" ); return m_xDriverSet->isBeforeFirst(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::isAfterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::isAfterLast" ); return m_xDriverSet->isAfterLast(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::isFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::isFirst" ); return m_xDriverSet->isFirst(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::isLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::isLast" ); return m_xDriverSet->isLast(); } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::beforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::beforeFirst" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; m_xDriverSet->beforeFirst(); } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::afterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::afterLast" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; m_xDriverSet->afterLast(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::first( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::first" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->first(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::last( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::last" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->last(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OCacheSet::getRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getRow" ); return m_xDriverSet->getRow(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::absolute" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->absolute(row); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::relative( sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::relative" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->relative(rows); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::previous( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::previous" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return m_xDriverSet->previous(); } -// ------------------------------------------------------------------------- + void SAL_CALL OCacheSet::refreshRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::refreshRow" ); m_xDriverSet->refreshRow(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::rowUpdated( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::rowUpdated" ); return m_xDriverSet->rowUpdated(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::rowInserted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::rowInserted" ); return m_xDriverSet->rowInserted(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OCacheSet::rowDeleted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::rowDeleted" ); return m_xDriverSet->rowDeleted(); } -// ------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL OCacheSet::getStatement( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::getStatement" ); return m_xDriverSet->getStatement(); } -// ----------------------------------------------------------------------------- + bool OCacheSet::isResultSetChanged() const { return false; } -// ----------------------------------------------------------------------------- + void OCacheSet::reset(const Reference< XResultSet>& /*_xDriverSet*/) { OSL_ENSURE(0,"Illegal call!"); } -// ----------------------------------------------------------------------------- + void OCacheSet::mergeColumnValues(sal_Int32 i_nColumnIndex,ORowSetValueVector::Vector& /*io_aInsertRow*/,ORowSetValueVector::Vector& /*io_aRow*/,::std::vector& o_aChangedColumns) { o_aChangedColumns.push_back(i_nColumnIndex); } -// ----------------------------------------------------------------------------- + bool OCacheSet::columnValuesUpdated(ORowSetValueVector::Vector& /*io_aCachedRow*/,const ORowSetValueVector::Vector& /*io_aRow*/) { return false; } -// ----------------------------------------------------------------------------- + bool OCacheSet::updateColumnValues(const ORowSetValueVector::Vector& /*io_aCachedRow*/,ORowSetValueVector::Vector& /*io_aRow*/,const ::std::vector& /*i_aChangedColumns*/) { return true; } -// ----------------------------------------------------------------------------- + void OCacheSet::fillMissingValues(ORowSetValueVector::Vector& /*io_aRow*/) const { } -// ----------------------------------------------------------------------------- - diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index f34602f..b1835d1 100644 --- a/dbaccess/source/core/api/CacheSet.hxx +++ b/dbaccess/source/core/api/CacheSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,7 +75,7 @@ namespace dbaccess ,sal_Int32 _nScale ) const; void fillParameters( const ORowSetRow& _rRow - ,const connectivity::OSQLTable& _xTable + ,const connectivity::OSQLTable& _xTable ,::rtl::OUStringBuffer& _sCondition ,::rtl::OUStringBuffer& _sParameter ,::std::list< sal_Int32>& _rOrgValues); @@ -83,7 +83,7 @@ namespace dbaccess ::rtl::OUString getIdentifierQuoteString() const; public: - + // late constructor virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); virtual void fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition); diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index e71ddf7..56064c7 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,12 +56,11 @@ namespace dbaccess using namespace ::cppu; using namespace ::connectivity::sdbcx; -//------------------------------------------------------------------------------ /** creates a vector of WildCards and reduce the _rTableFilter of the length of WildsCards */ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std::vector< WildCard >& _rOut) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OFilteredContainer::createWildCardVector" ); + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OFilteredContainer::createWildCardVector" ); // for wildcard search : remove all table filters which are a wildcard expression and build a WilCard // for them ::rtl::OUString* pTableFilters = _rTableFilter.getArray(); @@ -87,7 +86,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std return nShiftPos; } - // ------------------------------------------------------------------------- bool lcl_isElementAllowed( const ::rtl::OUString& _rName, const Sequence< ::rtl::OUString >& _rTableFilter, const ::std::vector< WildCard >& _rWCSearch ) @@ -110,7 +108,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std return bFilterMatch; } - //-------------------------------------------------------------------------- typedef ::boost::optional< ::rtl::OUString > OptionalString; struct TableInfo { @@ -137,7 +134,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std }; typedef ::std::vector< TableInfo > TableInfos; - //-------------------------------------------------------------------------- void lcl_ensureComposedName( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData ) { if ( !_metaData.is() ) @@ -154,7 +150,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std } } - //-------------------------------------------------------------------------- void lcl_ensureType( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer ) { if ( !!_io_tableInfo.sType ) @@ -178,7 +173,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std _io_tableInfo.sType = OptionalString( sTypeName ); } - //-------------------------------------------------------------------------- connectivity::TStringVector lcl_filter( const TableInfos& _unfilteredTables, const Sequence< ::rtl::OUString >& _tableFilter, const Sequence< ::rtl::OUString >& _tableTypeFilter, const Reference< XDatabaseMetaData >& _metaData, const Reference< XNameAccess >& _masterContainer ) @@ -256,7 +250,7 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std //========================================================================== //= OViewContainer //========================================================================== - OFilteredContainer::OFilteredContainer(::cppu::OWeakObject& _rParent, + OFilteredContainer::OFilteredContainer(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const Reference< XConnection >& _xCon, sal_Bool _bCase, @@ -269,9 +263,9 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std ,m_pRefreshListener(_pRefreshListener) ,m_nInAppend(_nInAppend) ,m_xConnection(_xCon) - { + { } - // ------------------------------------------------------------------------- + void OFilteredContainer::construct(const Reference< XNameAccess >& _rxMasterContainer, const Sequence< ::rtl::OUString >& _rTableFilter, const Sequence< ::rtl::OUString >& _rTableTypeFilter) @@ -288,7 +282,7 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std } m_xMasterContainer = _rxMasterContainer; - + if ( m_xMasterContainer.is() ) { addMasterContainerListener(); @@ -311,7 +305,7 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std construct( _rTableFilter, _rTableTypeFilter ); } } - //------------------------------------------------------------------------------ + void OFilteredContainer::construct(const Sequence< ::rtl::OUString >& _rTableFilter, const Sequence< ::rtl::OUString >& _rTableTypeFilter) { // build sorted versions of the filter sequences, so the visibility decision is faster @@ -399,7 +393,6 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std m_bConstructed = sal_True; } - //------------------------------------------------------------------------------ void OFilteredContainer::disposing() { OCollection::disposing(); @@ -410,11 +403,10 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std m_xMasterContainer = NULL; m_xMetaData = NULL; m_pWarningsContainer = NULL; - m_pRefreshListener = NULL; + m_pRefreshListener = NULL; m_bConstructed = sal_False; } - // ------------------------------------------------------------------------- void OFilteredContainer::impl_refresh() throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OFilteredContainer::impl_refresh" ); @@ -428,14 +420,12 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std } } - // ----------------------------------------------------------------------------- ::rtl::OUString OFilteredContainer::getNameForObject(const ObjectType& _xObject) { OSL_ENSURE( _xObject.is(), "OFilteredContainer::getNameForObject: Object is NULL!" ); return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::eInDataManipulation, false, false, false ); } - // ----------------------------------------------------------------------------- // multiple to obtain all tables from XDatabaseMetaData::getTables, via passing a particular // table type filter: // adhere to the standard, which requests to pass a NULL table type filter, if @@ -491,8 +481,4 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std } } -// .............................................................................. } // namespace -// .............................................................................. - - diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx index 3e71e4a..5f032ee 100644 --- a/dbaccess/source/core/api/HelperCollections.cxx +++ b/dbaccess/source/core/api/HelperCollections.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ namespace dbaccess using namespace ::com::sun::star::script; using namespace ::cppu; using namespace ::osl; - // ----------------------------------------------------------------------------- + OPrivateColumns::OPrivateColumns(const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns, sal_Bool _bCase, ::cppu::OWeakObject& _rParent, @@ -58,7 +58,6 @@ namespace dbaccess { } - // ------------------------------------------------------------------------- OPrivateColumns* OPrivateColumns::createWithIntrinsicNames( const ::vos::ORef< ::connectivity::OSQLColumns >& _rColumns, sal_Bool _bCase, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex ) { @@ -77,7 +76,6 @@ namespace dbaccess return new OPrivateColumns( _rColumns, _bCase, _rParent, _rMutex, aNames, sal_False ); } - // ------------------------------------------------------------------------- void SAL_CALL OPrivateColumns::disposing(void) { m_aColumns = NULL; @@ -86,7 +84,7 @@ namespace dbaccess // So we're not allowed to dispose our elements. OPrivateColumns_Base::disposing(); } - // ------------------------------------------------------------------------- + connectivity::sdbcx::ObjectType OPrivateColumns::createObject(const ::rtl::OUString& _rName) { if ( m_aColumns.isValid() ) @@ -102,7 +100,7 @@ namespace dbaccess } return NULL; } - // ------------------------------------------------------------------------- + connectivity::sdbcx::ObjectType OPrivateTables::createObject(const ::rtl::OUString& _rName) { if ( !m_aTables.empty() ) @@ -114,5 +112,4 @@ namespace dbaccess } return NULL; } - // ----------------------------------------------------------------------------- } diff --git a/dbaccess/source/core/api/HelperCollections.hxx b/dbaccess/source/core/api/HelperCollections.hxx index fa91dfd..6beb434 100644 --- a/dbaccess/source/core/api/HelperCollections.hxx +++ b/dbaccess/source/core/api/HelperCollections.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ namespace dbaccess using namespace ::com::sun::star::script; using namespace ::cppu; using namespace ::osl; - // ----------------------------------------------------------------------------- + typedef connectivity::sdbcx::OCollection OPrivateColumns_Base; class OPrivateColumns : public OPrivateColumns_Base { diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 3d127a7..d129ba5 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle andor its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,7 +98,7 @@ namespace } } DBG_NAME(OKeySet) -// ------------------------------------------------------------------------- + OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, const Reference< XIndexAccess>& _xTableKeys, const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name @@ -119,7 +119,7 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, DBG_CTOR(OKeySet,NULL); } -// ----------------------------------------------------------------------------- + OKeySet::~OKeySet() { try @@ -225,13 +225,13 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable } return aFilter; } -// ----------------------------------------------------------------------------- + void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::construct" ); OCacheSet::construct(_xDriverSet,i_sRowSetFilter); initColumns(); - + Reference xKeyColumns = getKeyColumns(); Reference xMeta = m_xConnection->getMetaData(); Reference xQueryColSup(m_xComposer,UNO_QUERY); @@ -267,14 +267,14 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O connectivity::OSQLTable xSelColSup(xSelectTables->getByName(*pIter),uno::UNO_QUERY); Reference xProp(xSelColSup,uno::UNO_QUERY); ::rtl::OUString sSelectTableName = ::dbtools::composeTableName( xMeta, xProp, ::dbtools::eInDataManipulation, false, false, false ); - - ::dbaccess::getColumnPositions(xQueryColumns,xSelColSup->getColumns()->getElementNames(),sSelectTableName,(*m_pForeignColumnNames)); - + + ::dbaccess::getColumnPositions(xQueryColumns,xSelColSup->getColumns()->getElementNames(),sSelectTableName,(*m_pForeignColumnNames)); + SelectColumnsMetaData::iterator aPosEnd = (*m_pForeignColumnNames).end(); for(SelectColumnsMetaData::iterator aPosIter = (*m_pForeignColumnNames).begin();aPosIter != aPosEnd;++aPosIter) { // look for columns not in the source columns to use them as filter as well - // if ( !xSourceColumns->hasByName(aPosIter->first) ) + // if ( !xSourceColumns->hasByName(aPosIter->first) ) { if ( aFilter.getLength() ) aFilter.append(aAnd); @@ -287,7 +287,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O break; } } - } // if ( aSeq.getLength() > 1 ) // special handling for join + } executeStatement(aFilter,i_sRowSetFilter,xAnalyzer); } void OKeySet::executeStatement(::rtl::OUStringBuffer& io_aFilter,const ::rtl::OUString& i_sRowSetFilter,Reference& io_xAnalyzer) @@ -323,7 +323,7 @@ void OKeySet::executeStatement(::rtl::OUStringBuffer& io_aFilter,const ::rtl::OU m_xStatement = m_xConnection->prepareStatement(io_xAnalyzer->getQueryWithSubstitution()); ::comphelper::disposeComponent(io_xAnalyzer); } -// ------------------------------------------------------------------------- + Any SAL_CALL OKeySet::getBookmark() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getBookmark" ); @@ -332,7 +332,6 @@ Any SAL_CALL OKeySet::getBookmark() throw(SQLException, RuntimeException) return makeAny(m_aKeyIter->first); } -// ------------------------------------------------------------------------- sal_Bool SAL_CALL OKeySet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::moveToBookmark" ); @@ -340,7 +339,7 @@ sal_Bool SAL_CALL OKeySet::moveToBookmark( const Any& bookmark ) throw(SQLExcept m_aKeyIter = m_aKeyMap.find(::comphelper::getINT32(bookmark)); return m_aKeyIter != m_aKeyMap.end(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::moveRelativeToBookmark" ); @@ -353,7 +352,7 @@ sal_Bool SAL_CALL OKeySet::moveRelativeToBookmark( const Any& bookmark, sal_Int3 return !isBeforeFirst() && !isAfterLast(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OKeySet::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::compareBookmarks" ); @@ -363,19 +362,19 @@ sal_Int32 SAL_CALL OKeySet::compareBookmarks( const Any& _first, const Any& _sec return (nFirst != nSecond) ? CompareBookmark::NOT_EQUAL : CompareBookmark::EQUAL; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::hasOrderedBookmarks" ); return sal_True; } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OKeySet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::hashBookmark" ); return ::comphelper::getINT32(bookmark); } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows ,const connectivity::OSQLTable& _xTable) throw(SQLException, RuntimeException) { @@ -464,7 +463,7 @@ Sequence< sal_Int32 > SAL_CALL OKeySet::deleteRows( const Sequence< Any >& rows } return aRet; } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::updateRow" ); @@ -573,11 +572,10 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_CONDITION_FOR_PK ), SQL_GENERAL_ERROR, m_xConnection ); // now create end execute the prepared statement - ::rtl::OUString sEmpty; executeUpdate(_rInsertRow ,_rOrginalRow,aSql.makeStringAndClear(),sEmpty,aIndexColumnPositions); } -// ----------------------------------------------------------------------------- + void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName,const ::std::vector& _aIndexColumnPositions) { // now create end execute the prepared statement @@ -643,7 +641,7 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO tryRefetch(_rInsertRow,bRefetch); } } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::insertRow" ); @@ -688,7 +686,7 @@ void SAL_CALL OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivi ::rtl::OUString sEmpty; executeInsert(_rInsertRow,aSql.makeStringAndClear(),sEmpty,bRefetch); } -// ------------------------------------------------------------------------- + void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName,bool bRefetch ) { // now create,fill and execute the prepared statement @@ -825,7 +823,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString --aKeyIter; ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >(m_pKeyColumnNames->size()); copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1); - + m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair >(1,NULL)))).first; // now we set the bookmark for this row (_rInsertRow->get())[0] = makeAny((sal_Int32)m_aKeyIter->first); @@ -848,7 +846,7 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch) connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaEnd; OUpdatedParameter::iterator aUpdateFind = m_aUpdatedParameter.find(m_aKeyIter->first); if ( aUpdateFind == m_aUpdatedParameter.end() ) - { + { aParaIter = m_aParameterValueForCache.get().begin(); aParaEnd = m_aParameterValueForCache.get().end(); } @@ -857,7 +855,7 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch) aParaIter = aUpdateFind->second.get().begin(); aParaEnd = aUpdateFind->second.get().end(); } - + for(++aParaIter;aParaIter != aParaEnd;++aParaIter,++nPos) { ::dbtools::setObjectWithInfo( xParameter, nPos, aParaIter->makeAny(), aParaIter->getTypeKind() ); @@ -886,7 +884,7 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch) m_aKeyIter->second.second.second = new OPrivateRow(_rInsertRow->get()); } } -// ----------------------------------------------------------------------------- + void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sal_Int32 i_nBookmark) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::copyRowValue" ); @@ -926,7 +924,7 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sa aIter->setTypeKind(aPosIter->second.nType); } } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::deleteRow" ); @@ -1032,29 +1030,29 @@ void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivit m_bDeleted = sal_True; } } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::cancelRowUpdates" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::moveToInsertRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::moveToInsertRow" ); } -// ------------------------------------------------------------------------- + void SAL_CALL OKeySet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::moveToCurrentRow" ); } -// ------------------------------------------------------------------------- + Reference OKeySet::getKeyColumns() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getKeyColumns" ); // use keys and indexes for excat postioning // first the keys - + Reference xKeys = m_xTableKeys; if ( !xKeys.is() ) { @@ -1089,7 +1087,7 @@ Reference OKeySet::getKeyColumns() const return xKeyColumns; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::next( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::next" ); @@ -1109,19 +1107,19 @@ sal_Bool SAL_CALL OKeySet::next( ) throw(SQLException, RuntimeException) refreshRow(); return !isAfterLast(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::isBeforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::isBeforeFirst" ); return m_aKeyIter == m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::isAfterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::isAfterLast" ); return m_bRowCountFinal && m_aKeyIter == m_aKeyMap.end(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::isFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::isFirst" ); @@ -1129,7 +1127,7 @@ sal_Bool SAL_CALL OKeySet::isFirst( ) throw(SQLException, RuntimeException) ++aTemp; return m_aKeyIter == aTemp && m_aKeyIter != m_aKeyMap.end(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::isLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::isLast" ); @@ -1140,7 +1138,7 @@ sal_Bool SAL_CALL OKeySet::isLast( ) throw(SQLException, RuntimeException) --aTemp; return m_aKeyIter == aTemp; } -// ----------------------------------------------------------------------------- + void SAL_CALL OKeySet::beforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::beforeFirst" ); @@ -1149,7 +1147,7 @@ void SAL_CALL OKeySet::beforeFirst( ) throw(SQLException, RuntimeException) m_xRow = NULL; ::comphelper::disposeComponent(m_xSet); } -// ----------------------------------------------------------------------------- + void SAL_CALL OKeySet::afterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::afterLast" ); @@ -1159,7 +1157,7 @@ void SAL_CALL OKeySet::afterLast( ) throw(SQLException, RuntimeException) m_xRow = NULL; ::comphelper::disposeComponent(m_xSet); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::first( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::first" ); @@ -1172,7 +1170,7 @@ sal_Bool SAL_CALL OKeySet::first( ) throw(SQLException, RuntimeException) refreshRow(); return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::last( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::last" ); @@ -1184,7 +1182,7 @@ sal_Bool SAL_CALL OKeySet::last( ) throw(SQLException, RuntimeException) refreshRow(); return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + sal_Int32 SAL_CALL OKeySet::getRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getRow" ); @@ -1193,7 +1191,7 @@ sal_Int32 SAL_CALL OKeySet::getRow( ) throw(SQLException, RuntimeException) return ::std::distance(m_aKeyMap.begin(),m_aKeyIter); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::absolute" ); @@ -1231,7 +1229,7 @@ sal_Bool SAL_CALL OKeySet::absolute( sal_Int32 row ) throw(SQLException, Runtime return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::relative( sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::relative" ); @@ -1242,7 +1240,7 @@ sal_Bool SAL_CALL OKeySet::relative( sal_Int32 rows ) throw(SQLException, Runtim } return absolute(getRow()+rows); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::previous( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::previous" ); @@ -1254,7 +1252,7 @@ sal_Bool SAL_CALL OKeySet::previous( ) throw(SQLException, RuntimeException) } return m_aKeyIter != m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::refreshRow" ); @@ -1279,7 +1277,7 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaEnd; OUpdatedParameter::iterator aUpdateFind = m_aUpdatedParameter.find(m_aKeyIter->first); if ( aUpdateFind == m_aUpdatedParameter.end() ) - { + { aParaIter = m_aParameterValueForCache.get().begin(); aParaEnd = m_aParameterValueForCache.get().end(); } @@ -1288,7 +1286,7 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) aParaIter = aUpdateFind->second.get().begin(); aParaEnd = aUpdateFind->second.get().end(); } - + for(++aParaIter;aParaIter != aParaEnd;++aParaIter,++nPos) { ::dbtools::setObjectWithInfo( xParameter, nPos, aParaIter->makeAny(), aParaIter->getTypeKind() ); @@ -1313,7 +1311,7 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) m_xRow.set(m_xSet,UNO_QUERY); OSL_ENSURE(m_xRow.is(),"No row form statement!"); } -// ----------------------------------------------------------------------------- + sal_Bool OKeySet::fetchRow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::fetchRow" ); @@ -1347,7 +1345,7 @@ sal_Bool OKeySet::fetchRow() m_bRowCountFinal = sal_True; return bRet; } -// ------------------------------------------------------------------------- + void OKeySet::fillAllRows() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::fillAllRows" ); @@ -1363,152 +1361,152 @@ sal_Bool SAL_CALL OKeySet::wasNull( ) throw(SQLException, RuntimeException) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::wasNull" ); return m_xRow->wasNull(); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OKeySet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getString" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getString(columnIndex); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getBoolean" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getBoolean(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int8 SAL_CALL OKeySet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getByte" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getByte(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int16 SAL_CALL OKeySet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getShort" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getShort(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OKeySet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getInt" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getInt(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int64 SAL_CALL OKeySet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getLong" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getLong(columnIndex); } -// ------------------------------------------------------------------------- + float SAL_CALL OKeySet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getFloat" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getFloat(columnIndex); } -// ------------------------------------------------------------------------- + double SAL_CALL OKeySet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getDouble" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getDouble(columnIndex); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL OKeySet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getBytes" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getBytes(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Date SAL_CALL OKeySet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getDate" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getDate(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Time SAL_CALL OKeySet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getTime" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getTime(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::DateTime SAL_CALL OKeySet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getTimestamp" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getTimestamp(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OKeySet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getBinaryStream" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getBinaryStream(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OKeySet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getCharacterStream" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getCharacterStream(columnIndex); } -// ------------------------------------------------------------------------- + Any SAL_CALL OKeySet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getObject" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getObject(columnIndex,typeMap); } -// ------------------------------------------------------------------------- + Reference< XRef > SAL_CALL OKeySet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getRef" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getRef(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XBlob > SAL_CALL OKeySet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getBlob" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getBlob(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XClob > SAL_CALL OKeySet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getClob" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getClob(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XArray > SAL_CALL OKeySet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::getArray" ); OSL_ENSURE(m_xRow.is(),"m_xRow is null!"); return m_xRow->getArray(columnIndex); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::rowUpdated( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::rowUpdated" ); return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second.first == 2; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::rowInserted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::rowInserted" ); return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second.first == 1; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OKeySet::rowDeleted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::rowDeleted" ); @@ -1516,7 +1514,7 @@ sal_Bool SAL_CALL OKeySet::rowDeleted( ) throw(SQLException, RuntimeException) m_bDeleted = sal_False; return bDeleted; } -// ----------------------------------------------------------------------------- + ::rtl::OUString OKeySet::getComposedTableName(const ::rtl::OUString& _sCatalog, const ::rtl::OUString& _sSchema, const ::rtl::OUString& _sTable) @@ -1549,7 +1547,7 @@ sal_Bool SAL_CALL OKeySet::rowDeleted( ) throw(SQLException, RuntimeException) return aComposedName; } -// ----------------------------------------------------------------------------- + namespace dbaccess { @@ -1594,7 +1592,7 @@ void getColumnPositions(const Reference& _rxQueryColumns, sal_Int32 nNullable = ColumnValue::NULLABLE_UNKNOWN; OSL_VERIFY( xQueryColumnProp->getPropertyValue( PROPERTY_ISNULLABLE ) >>= nNullable ); - + if ( i_bAppendTableName ) { ::rtl::OUStringBuffer sName; @@ -1604,11 +1602,11 @@ void getColumnPositions(const Reference& _rxQueryColumns, SelectColumnDescription aColDesc( nPos, nType,nScale,nNullable != sdbc::ColumnValue::NO_NULLS, sColumnDefault ); aColDesc.sRealName = sRealName; aColDesc.sTableName = sTableName; - o_rColumnNames[sName.makeStringAndClear()] = aColDesc; + o_rColumnNames[sName.makeStringAndClear()] = aColDesc; } else o_rColumnNames[sRealName] = SelectColumnDescription( nPos, nType,nScale,nNullable != sdbc::ColumnValue::NO_NULLS, sColumnDefault ); - + break; } } @@ -1616,7 +1614,7 @@ void getColumnPositions(const Reference& _rxQueryColumns, } } } -// ----------------------------------------------------------------------------- + void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const SelectColumnDescription& i_aMetaData) { ORowSetValue& aValue((_rInsertRow->get())[i_aMetaData.nPosition]); @@ -1637,5 +1635,3 @@ void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const Select break; } } -// ----------------------------------------------------------------------------- - diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 5d2ef8b..96cd253 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,8 +51,6 @@ namespace dbaccess sal_Int32 nScale; sal_Bool bNullable; - - SelectColumnDescription() :nPosition( 0 ) ,nType( 0 ) @@ -88,7 +86,7 @@ namespace dbaccess protected: OKeySetMatrix m_aKeyMap; OKeySetMatrix::iterator m_aKeyIter; - + ::std::vector< ::rtl::OUString > m_aAutoColumns; // contains all columns which are autoincrement ones OUpdatedParameter m_aUpdatedParameter; // contains all parameter which have been updated and are needed for refetching @@ -105,7 +103,7 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; ::std::vector< ::rtl::OUString > m_aFilterColumns; - + sal_Bool m_bRowCountFinal; /** @@ -127,7 +125,7 @@ namespace dbaccess + \param i_nBookmark The bookmark is used to update the parameter */ void copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sal_Int32 i_nBookmark); - + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getKeyColumns() const; void fillAllRows(); sal_Bool fetchRow(); @@ -142,7 +140,7 @@ namespace dbaccess void executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName,const ::std::vector& _aIndexColumnPositions = ::std::vector()); void executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName = ::rtl::OUString(),bool bRefetch = false); void executeStatement(::rtl::OUStringBuffer& io_aFilter,const ::rtl::OUString& i_sRowSetFilter,::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& io_xAnalyzer); - + virtual ~OKeySet(); public: OKeySet(const connectivity::OSQLTable& _xTable, @@ -150,7 +148,7 @@ namespace dbaccess const ::rtl::OUString& _rUpdateTableName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache); - + // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); @@ -197,17 +195,17 @@ namespace dbaccess virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // ::com::sun::star::sdbcx::XRowLocate virtual ::com::sun::star::uno::Any SAL_CALL getBookmark() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - // ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XDeleteRows virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ,const connectivity::OSQLTable& _xTable) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // ::com::sun::star::sdbc::XResultSetUpdate @@ -220,4 +218,3 @@ namespace dbaccess }; } #endif // DBACCESS_CORE_API_KEYSET_HXX - diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index b68910d..4caada3 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -98,7 +98,7 @@ namespace } DBG_NAME(OptimisticSet) -// ------------------------------------------------------------------------- + OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext, const Reference< XConnection>& i_xConnection, const Reference< XSingleSelectQueryAnalyzer >& _xComposer, @@ -111,12 +111,12 @@ OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext, RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::OptimisticSet" ); DBG_CTOR(OptimisticSet,NULL); } -// ----------------------------------------------------------------------------- + OptimisticSet::~OptimisticSet() { DBG_DTOR(OptimisticSet,NULL); } -// ----------------------------------------------------------------------------- + void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::construct" ); @@ -169,14 +169,14 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const :: m_xStatement = m_xConnection->prepareStatement(xAnalyzer->getQueryWithSubstitution()); ::comphelper::disposeComponent(xAnalyzer); } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL OptimisticSet::deleteRows( const Sequence< Any >& /*rows*/ ,const connectivity::OSQLTable& /*_xTable*/) throw(SQLException, RuntimeException) { Sequence< sal_Int32 > aRet; return aRet; } -// ------------------------------------------------------------------------- + void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::updateRow" ); @@ -264,7 +264,7 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow } } } -// ------------------------------------------------------------------------- + void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::insertRow" ); @@ -276,7 +276,7 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn static ::rtl::OUString aAnd = ::rtl::OUString::createFromAscii(" AND "); ::rtl::OUString sIsNull(RTL_CONSTASCII_USTRINGPARAM(" IS NULL")); ::rtl::OUString sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); - + // here we build the condition part for the update statement SelectColumnsMetaData::const_iterator aIter = m_pColumnNames->begin(); SelectColumnsMetaData::const_iterator aEnd = m_pColumnNames->end(); @@ -284,7 +284,7 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn { if ( aResultSetChanged.find( aIter->second.sTableName ) == aResultSetChanged.end() ) aResultSetChanged[aIter->second.sTableName] = false; - + const ::rtl::OUString sQuotedColumnName = ::dbtools::quoteName( aQuote,aIter->second.sRealName); if ( (_rInsertRow->get())[aIter->second.nPosition].isModified() ) { @@ -363,19 +363,19 @@ void SAL_CALL OptimisticSet::insertRow( const ORowSetRow& _rInsertRow,const conn if ( xRow.is() && xRes->next() ) { m_bResultSetChanged = true; - continue; + continue; } } catch(const SQLException&) { } } - + executeInsert(_rInsertRow,sSql.makeStringAndClear(),aSqlIter->first); } } } -// ------------------------------------------------------------------------- + void SAL_CALL OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { ::rtl::OUString sParam(RTL_CONSTASCII_USTRINGPARAM(" = ?")); @@ -421,7 +421,7 @@ void SAL_CALL OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const conne } } } -// ------------------------------------------------------------------------- + void OptimisticSet::executeDelete(const ORowSetRow& _rDeleteRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::executeDelete" ); @@ -449,41 +449,17 @@ void OptimisticSet::executeDelete(const ORowSetRow& _rDeleteRow,const ::rtl::OUS m_bDeleted = sal_True; } } -// ----------------------------------------------------------------------------- + ::rtl::OUString OptimisticSet::getComposedTableName(const ::rtl::OUString& /*_sCatalog*/, const ::rtl::OUString& /*_sSchema*/, const ::rtl::OUString& /*_sTable*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::getComposedTableName" ); ::rtl::OUString aComposedName; -/* - Reference xMetaData = m_xConnection->getMetaData(); - if( xMetaData.is() && xMetaData->supportsTableCorrelationNames() ) - { - aComposedName = ::dbtools::composeTableName( xMetaData, _sCatalog, _sSchema, _sTable, sal_False, ::dbtools::eInDataManipulation ); - // first we have to check if the composed tablename is in the select clause or if an alias is used - Reference xTabSup(m_xComposer,UNO_QUERY); - Reference xSelectTables = xTabSup->getTables(); - OSL_ENSURE(xSelectTables.is(),"No Select tables!"); - if(xSelectTables.is()) - { - if(!xSelectTables->hasByName(aComposedName)) - { // the composed name isn't used in the select clause so we have to find out which name is used instead - ::rtl::OUString sCatalog,sSchema,sTable; - ::dbtools::qualifiedNameComponents(xMetaData,m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); - aComposedName = ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); - } - else - aComposedName = ::dbtools::composeTableNameForSelect( m_xConnection, _sCatalog, _sSchema, _sTable ); - } - } - else - aComposedName = ::dbtools::composeTableNameForSelect( m_xConnection, _sCatalog, _sSchema, _sTable ); -*/ return aComposedName; } -// ----------------------------------------------------------------------------- + void OptimisticSet::fillJoinedColumns_throw(const ::std::vector< TNodePair >& i_aJoinColumns) { ::std::vector< TNodePair >::const_iterator aIter = i_aJoinColumns.begin(); @@ -502,9 +478,9 @@ void OptimisticSet::fillJoinedColumns_throw(const ::std::vector< TNodePair >& i_ fillJoinedColumns_throw(sLeft.makeStringAndClear(),sRight.makeStringAndClear()); } } -// ----------------------------------------------------------------------------- + void OptimisticSet::fillJoinedColumns_throw(const ::rtl::OUString& i_sLeftColumn,const ::rtl::OUString& i_sRightColumn) -{ +{ sal_Int32 nLeft = 0,nRight = 0; SelectColumnsMetaData::const_iterator aLeftIter = m_pKeyColumnNames->find(i_sLeftColumn); SelectColumnsMetaData::const_iterator aRightIter = m_pKeyColumnNames->find(i_sRightColumn); @@ -542,14 +518,14 @@ void OptimisticSet::fillJoinedColumns_throw(const ::rtl::OUString& i_sLeftColumn else m_aJoinedColumns[nRight] = nLeft; } -// ----------------------------------------------------------------------------- + bool OptimisticSet::isResultSetChanged() const { bool bOld = m_bResultSetChanged; m_bResultSetChanged = false; return bOld; } -// ----------------------------------------------------------------------------- + void OptimisticSet::reset(const Reference< XResultSet>& _xDriverSet) { OCacheSet::construct(_xDriverSet,::rtl::OUString()); @@ -558,7 +534,7 @@ void OptimisticSet::reset(const Reference< XResultSet>& _xDriverSet) m_aKeyMap.insert(OKeySetMatrix::value_type(0,OKeySetValue(NULL,::std::pair >(0,NULL)))); m_aKeyIter = m_aKeyMap.begin(); } -// ----------------------------------------------------------------------------- + void OptimisticSet::mergeColumnValues(sal_Int32 i_nColumnIndex,ORowSetValueVector::Vector& io_aInsertRow,ORowSetValueVector::Vector& io_aRow,::std::vector& o_aChangedColumns) { o_aChangedColumns.push_back(i_nColumnIndex); @@ -600,7 +576,7 @@ namespace } }; } -// ----------------------------------------------------------------------------- + bool OptimisticSet::updateColumnValues(const ORowSetValueVector::Vector& io_aCachedRow,ORowSetValueVector::Vector& io_aRow,const ::std::vector& i_aChangedColumns) { bool bRet = false; @@ -637,7 +613,7 @@ bool OptimisticSet::updateColumnValues(const ORowSetValueVector::Vector& io_aCac } return bRet; } -// ----------------------------------------------------------------------------- + bool OptimisticSet::columnValuesUpdated(ORowSetValueVector::Vector& o_aCachedRow,const ORowSetValueVector::Vector& i_aRow) { bool bRet = false; @@ -676,7 +652,7 @@ bool OptimisticSet::columnValuesUpdated(ORowSetValueVector::Vector& o_aCachedRow } return bRet; } -// ----------------------------------------------------------------------------- + void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const { TSQLStatements aSql; @@ -760,5 +736,3 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const } } } -// ----------------------------------------------------------------------------- - diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx index fd1b304..b86f956 100644 --- a/dbaccess/source/core/api/OptimisticSet.hxx +++ b/dbaccess/source/core/api/OptimisticSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -49,11 +49,10 @@ namespace dbaccess { ::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParseTreeIterator m_aSqlIterator; - + ::std::map m_aJoinedColumns; - ::std::map m_aJoinedKeyColumns; - - + ::std::map m_aJoinedKeyColumns; + mutable bool m_bResultSetChanged; /** @@ -67,9 +66,9 @@ namespace dbaccess ::rtl::OUString getComposedTableName( const ::rtl::OUString& _sCatalog, const ::rtl::OUString& _sSchema, const ::rtl::OUString& _sTable); - + void impl_convertValue_throw(const ORowSetRow& _rInsertRow,const SelectColumnDescription& i_aMetaData); - + void executeDelete(const ORowSetRow& _rDeleteRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName); void fillJoinedColumns_throw(const ::std::vector< ::connectivity::TNodePair>& i_aJoinColumns); void fillJoinedColumns_throw(const ::rtl::OUString& i_sLeftColumn,const ::rtl::OUString& i_sRightColumn); @@ -80,11 +79,10 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& i_xConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache); - + // late ctor which can throw exceptions virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); - // ------------------------------------------------------------------------- // ::com::sun::star::sdbcx::XDeleteRows virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ,const connectivity::OSQLTable& _xTable) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // ::com::sun::star::sdbc::XResultSetUpdate @@ -106,4 +104,3 @@ namespace dbaccess }; } #endif // DBACCESS_CORE_API_OPTIMISTICSET_HXX - diff --git a/dbaccess/source/core/api/PrivateRow.cxx b/dbaccess/source/core/api/PrivateRow.cxx index 2d3baed..939e335 100644 --- a/dbaccess/source/core/api/PrivateRow.cxx +++ b/dbaccess/source/core/api/PrivateRow.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle andor its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/PrivateRow.hxx b/dbaccess/source/core/api/PrivateRow.hxx index aabcb0d..82dd972 100644 --- a/dbaccess/source/core/api/PrivateRow.hxx +++ b/dbaccess/source/core/api/PrivateRow.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index b194a2a..8f43937 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -103,12 +103,10 @@ using namespace ::com::sun::star::util; using namespace ::cppu; using namespace ::osl; -//-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_ORowSet() { static ::dba::OAutoRegistration< ORowSet > aAutoRegistration; } -// ----------------------------------------------------------------------------- #define NOTIFY_LISTERNERS_CHECK(_rListeners,T,method) \ Sequence< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \ @@ -135,16 +133,14 @@ extern "C" void SAL_CALL createRegistryInfo_ORowSet() _rGuard.reset(); -//.................................................................. namespace dbaccess { -//.................................................................. -//-------------------------------------------------------------------------- + Reference< XInterface > ORowSet_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory) { return *(new ORowSet(_rxFactory)); } -//-------------------------------------------------------------------------- + ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ) :ORowSet_BASE1(m_aMutex) ,ORowSetBase( _rxORB, ORowSet_BASE1::rBHelper, &m_aMutex ) @@ -239,7 +235,6 @@ ORowSet::~ORowSet() } } -// ----------------------------------------------------------------------------- void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) const { switch( _nHandle ) @@ -291,9 +286,8 @@ void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) c break; } } -// ------------------------------------------------------------------------- -// typedef ::comphelper::OPropertyArrayUsageHelper ORowSet_Prop; +// typedef ::comphelper::OPropertyArrayUsageHelper ORowSet_Prop; void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception) { switch(nHandle) @@ -385,7 +379,7 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const break; }; } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const { if(m_pCache) @@ -429,7 +423,7 @@ void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const } } } -// ------------------------------------------------------------------------- + // com::sun::star::XTypeProvider Sequence< Type > SAL_CALL ORowSet::getTypes() throw (RuntimeException) { @@ -439,7 +433,7 @@ Sequence< Type > SAL_CALL ORowSet::getTypes() throw (RuntimeException) ::comphelper::concatSequences(ORowSet_BASE1::getTypes(),ORowSetBase::getTypes())); return aTypes.getTypes(); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL ORowSet::getImplementationId() throw (RuntimeException) { static OImplementationId * pId = 0; @@ -454,24 +448,22 @@ Sequence< sal_Int8 > SAL_CALL ORowSet::getImplementationId() throw (RuntimeExcep } return pId->getImplementationId(); } -// ------------------------------------------------------------------------- // com::sun::star::XInterface Any SAL_CALL ORowSet::queryInterface( const Type & rType ) throw (RuntimeException) { return ORowSet_BASE1::queryInterface( rType); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::acquire() throw() { ORowSet_BASE1::acquire(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::release() throw() { ORowSet_BASE1::release(); } -// ------------------------------------------------------------------------- // com::sun::star::XUnoTunnel sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) @@ -481,7 +473,7 @@ sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) thro return 0; } -// ------------------------------------------------------------------------- + // com::sun::star::XAggregation Any SAL_CALL ORowSet::queryAggregation( const Type& rType ) throw(RuntimeException) { @@ -490,23 +482,23 @@ Any SAL_CALL ORowSet::queryAggregation( const Type& rType ) throw(RuntimeExcepti aRet = ORowSet_BASE1::queryAggregation(rType); return aRet; } -//------------------------------------------------------------------------------ + rtl::OUString ORowSet::getImplementationName_static( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ORowSet"); } -// ------------------------------------------------------------------------- + // ::com::sun::star::XServiceInfo ::rtl::OUString SAL_CALL ORowSet::getImplementationName( ) throw(RuntimeException) { return getImplementationName_static(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSet::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > ORowSet::getSupportedServiceNames_static( ) throw (RuntimeException) { Sequence< rtl::OUString > aSNS( 5 ); @@ -517,18 +509,18 @@ Sequence< ::rtl::OUString > ORowSet::getSupportedServiceNames_static( ) throw ( aSNS[4] = SERVICE_SDB_ROWSET; return aSNS; } -// ------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL ORowSet::getSupportedServiceNames( ) throw(RuntimeException) { return getSupportedServiceNames_static(); } -//------------------------------------------------------------------------------ + Reference< XInterface > ORowSet::Create(const Reference< XComponentContext >& _rxContext) { ::comphelper::ComponentContext aContext( _rxContext ); return ORowSet_CreateInstance( aContext.getLegacyServiceFactory() ); } -// ------------------------------------------------------------------------- + // OComponentHelper void SAL_CALL ORowSet::disposing() { @@ -560,7 +552,7 @@ void SAL_CALL ORowSet::disposing() ORowSetBase::disposing(); } -// ------------------------------------------------------------------------- + void ORowSet::freeResources( bool _bComplete ) { MutexGuard aGuard(m_aMutex); @@ -617,7 +609,6 @@ void ORowSet::freeResources( bool _bComplete ) } } -// ------------------------------------------------------------------------- void ORowSet::setActiveConnection( Reference< XConnection >& _rxNewConn, sal_Bool _bFireEvent ) { if (_rxNewConn.get() == m_xActiveConnection.get()) @@ -663,7 +654,6 @@ void ORowSet::setActiveConnection( Reference< XConnection >& _rxNewConn, sal_Boo } } -// ------------------------------------------------------------------------- // ::com::sun::star::XEventListener void SAL_CALL ORowSet::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { @@ -679,7 +669,6 @@ void SAL_CALL ORowSet::disposing( const ::com::sun::star::lang::EventObject& Sou } } } -// ------------------------------------------------------------------------- // XCloseable void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) @@ -691,7 +680,7 @@ void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) // additionals things to set freeResources( true ); } -// ------------------------------------------------------------------------- + // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSet::createArrayHelper( ) const { @@ -699,14 +688,14 @@ void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } -// ------------------------------------------------------------------------- + // cppu::OPropertySetHelper ::cppu::IPropertyArrayHelper& SAL_CALL ORowSet::getInfoHelper() { typedef ::comphelper::OPropertyArrayUsageHelper ORowSet_PROP; return *ORowSet_PROP::getArrayHelper(); } -// ----------------------------------------------------------------------------- + void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -720,7 +709,7 @@ void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) m_pCache->updateValue(columnIndex,x,rRow,aNotify.getChangedColumns()); aNotify.firePropertyChange(); } -// ------------------------------------------------------------------------- + // XRowUpdate void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { @@ -735,74 +724,74 @@ void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, R m_pCache->updateNull(columnIndex,rRow,aNotify.getChangedColumns()); aNotify.firePropertyChange(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { updateValue(columnIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); checkUpdateConditions(columnIndex); checkUpdateIterator(); - + { Sequence aSeq; if(x.is()) @@ -810,7 +799,7 @@ void SAL_CALL ORowSet::updateBinaryStream( sal_Int32 columnIndex, const Referenc updateValue(columnIndex,aSeq); } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -822,7 +811,7 @@ void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Refer m_pCache->updateCharacterStream(columnIndex,x,length,rRow,aNotify.getChangedColumns()); aNotify.firePropertyChange(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -866,7 +855,7 @@ void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw aNotify.firePropertyChange(); } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -878,7 +867,6 @@ void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, m_pCache->updateNumericObject(columnIndex,x,scale,rRow,aNotify.getChangedColumns()); aNotify.firePropertyChange(); } -// ------------------------------------------------------------------------- // XResultSetUpdate void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) @@ -889,7 +877,7 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) // when the row isn't modified // or the concurency is read only ::osl::ResettableMutexGuard aGuard( *m_pMutex ); - + if(!m_pCache || !m_bNew || !m_bModified || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) throwFunctionSequenceException(*this); @@ -920,7 +908,7 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) // - rowChanged notifyAllListenersRowChanged(aGuard,aEvt); - + if ( !aBookmarks.empty() ) { RowsChangeEvent aUpEvt(*this,RowChangeAction::UPDATE,aBookmarks.size(),Sequence(&(*aBookmarks.begin()),aBookmarks.size())); @@ -940,16 +928,16 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) fireRowcount(); } } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSet::getRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); + checkCache(); // check if we are inserting a row return (m_pCache && ( m_pCache->m_bNew || m_bModified )) ? 0 : ORowSetBase::getRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -957,7 +945,7 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) ::osl::ResettableMutexGuard aGuard( *m_pMutex ); if ( !m_pCache || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY || m_bNew || ((m_pCache->m_nPrivileges & Privilege::UPDATE ) != Privilege::UPDATE) ) throwFunctionSequenceException(*this); - + if(m_bModified) { @@ -972,7 +960,7 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) ::std::vector< Any > aBookmarks; m_pCache->updateRow(m_aCurrentRow.operator ->(),aBookmarks); if ( !aBookmarks.empty() ) - aEvt.Bookmarks = Sequence(&(*aBookmarks.begin()),aBookmarks.size()); + aEvt.Bookmarks = Sequence(&(*aBookmarks.begin()),aBookmarks.size()); aEvt.Rows += aBookmarks.size(); m_aBookmark = m_pCache->getBookmark(); m_aCurrentRow = m_pCache->m_aMatrixIter; @@ -1007,7 +995,7 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) } } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1059,7 +1047,6 @@ void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) fireRowcount(); } -// ------------------------------------------------------------------------- void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQLException, RuntimeException ) ) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1096,13 +1083,11 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { implCancelRowUpdates( sal_True ); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSet::addRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1111,7 +1096,7 @@ void SAL_CALL ORowSet::addRowSetListener( const Reference< XRowSetListener >& li if(listener.is()) m_aRowsetListeners.addInterface(listener); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::removeRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1120,7 +1105,7 @@ void SAL_CALL ORowSet::removeRowSetListener( const Reference< XRowSetListener >& if(listener.is()) m_aRowsetListeners.removeInterface(listener); } -// ----------------------------------------------------------------------------- + void ORowSet::notifyAllListeners(::osl::ResettableMutexGuard& _rGuard) { EventObject aEvt(*m_pMySelf); @@ -1128,7 +1113,7 @@ void ORowSet::notifyAllListeners(::osl::ResettableMutexGuard& _rGuard) m_aRowsetListeners.notifyEach( &XRowSetListener::rowSetChanged, aEvt ); _rGuard.reset(); } -// ------------------------------------------------------------------------- + void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard) { EventObject aEvt(*m_pMySelf); @@ -1136,7 +1121,7 @@ void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard m_aRowsetListeners.notifyEach( &XRowSetListener::cursorMoved, aEvt ); _rGuard.reset(); } -// ------------------------------------------------------------------------- + void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, const RowsChangeEvent& aEvt) { _rGuard.clear(); @@ -1144,21 +1129,21 @@ void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, m_aRowsChangeListener.notifyEach( &XRowsChangeListener::rowsChanged, aEvt ); _rGuard.reset(); } -// ------------------------------------------------------------------------- + sal_Bool ORowSet::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard) { EventObject aEvt(*m_pMySelf); NOTIFY_LISTERNERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveCursorMove); return bCheck; } -// ------------------------------------------------------------------------- + void ORowSet::notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rGuard,const RowChangeEvent &aEvt) { NOTIFY_LISTERNERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveRowChange); if ( !bCheck ) m_aErrors.raiseTypedException( sdb::ErrorCondition::ROW_SET_OPERATION_VETOED, *this, ::cppu::UnoType< RowSetVetoException >::get() ); } -// ------------------------------------------------------------------------- + void ORowSet::fireRowcount() { sal_Int32 nCurrentRowCount( impl_getRowCount() ); @@ -1182,7 +1167,7 @@ void ORowSet::fireRowcount() m_bLastKnownRowCountFinal = bCurrentRowCountFinal; } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1241,7 +1226,7 @@ void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) fireRowcount(); } } -// ------------------------------------------------------------------------- + void ORowSet::impl_setDataColumnsWriteable_throw() { impl_restoreDataColumnsWriteable_throw(); @@ -1253,11 +1238,11 @@ void ORowSet::impl_setDataColumnsWriteable_throw() sal_Bool bReadOnly = sal_False; (*aIter)->getPropertyValue(PROPERTY_ISREADONLY) >>= bReadOnly; *aReadIter = bReadOnly; - + (*aIter)->setPropertyValue(PROPERTY_ISREADONLY,makeAny(sal_False)); } } -// ------------------------------------------------------------------------- + void ORowSet::impl_restoreDataColumnsWriteable_throw() { TDataColumns::iterator aIter = m_aDataColumns.begin(); @@ -1268,7 +1253,7 @@ void ORowSet::impl_restoreDataColumnsWriteable_throw() } m_aReadOnlyDataColumns.clear(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1303,7 +1288,7 @@ void SAL_CALL ORowSet::moveToCurrentRow( ) throw(SQLException, RuntimeException aNotifier.fire(); } } -// ------------------------------------------------------------------------- + // XRow sal_Bool SAL_CALL ORowSet::wasNull( ) throw(SQLException, RuntimeException) { @@ -1312,7 +1297,7 @@ sal_Bool SAL_CALL ORowSet::wasNull( ) throw(SQLException, RuntimeException) return ( m_pCache && isInsertRow() ) ? ((*m_pCache->m_aInsertRow)->get())[m_nLastColumnIndex].isNull() : ORowSetBase::wasNull(); } -// ----------------------------------------------------------------------------- + const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex) { checkCache(); @@ -1322,79 +1307,79 @@ const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex) return getValue(columnIndex); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL ORowSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int8 SAL_CALL ORowSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int16 SAL_CALL ORowSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int64 SAL_CALL ORowSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + float SAL_CALL ORowSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + double SAL_CALL ORowSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL ORowSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Date SAL_CALL ORowSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Time SAL_CALL ORowSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::DateTime SAL_CALL ORowSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); @@ -1406,7 +1391,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getBinaryStrea return ORowSetBase::getBinaryStream(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); @@ -1418,18 +1403,18 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getCharacterSt return ORowSetBase::getCharacterStream(columnIndex); } -// ------------------------------------------------------------------------- + Any SAL_CALL ORowSet::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex).makeAny(); } -// ------------------------------------------------------------------------- + Reference< XRef > SAL_CALL ORowSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XRef >(); } -// ------------------------------------------------------------------------- + Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { if ( m_pCache && isInsertRow() ) @@ -1439,17 +1424,17 @@ Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 columnIndex ) throw(SQLE } return ORowSetBase::getBlob(columnIndex); } -// ------------------------------------------------------------------------- + Reference< XClob > SAL_CALL ORowSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { return Reference< XClob >(getInsertValue(columnIndex).makeAny(),UNO_QUERY); } -// ------------------------------------------------------------------------- + Reference< XArray > SAL_CALL ORowSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { return Reference< XArray >(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException) { if (!_rxHandler.is()) @@ -1483,7 +1468,7 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl const sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0; if ( m_aParametersSet.size() < (size_t)nParamCount ) m_aParametersSet.resize( nParamCount ,false); - + ::dbtools::askForParameters( xComposer, this, m_xActiveConnection, _rxHandler,m_aParametersSet ); } // ensure that only the allowed exceptions leave this block @@ -1506,7 +1491,6 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl execute_NoApprove_NoNewConn(aGuard); } -// ------------------------------------------------------------------------- Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( ) throw (RuntimeException) { ::osl::MutexGuard aGuard( *m_pMutex ); @@ -1533,7 +1517,6 @@ Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( ) throw (RuntimeExce return m_pParameters.get(); } -// ------------------------------------------------------------------------- void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -1561,9 +1544,8 @@ void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException) } } } -// ------------------------------------------------------------------------- + // XRowSet -// ------------------------------------------------------------------------- void SAL_CALL ORowSet::execute( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1588,7 +1570,6 @@ void SAL_CALL ORowSet::execute( ) throw(SQLException, RuntimeException) execute_NoApprove_NoNewConn(aGuard); } -//------------------------------------------------------------------------------ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxStatement, sal_Int32 _nDesiredResultSetType, sal_Int32 _nDesiredResultSetConcurrency ) { OSL_ENSURE( _rxStatement.is(), "ORowSet::setStatementResultSetType: invalid statement - this will crash!" ); @@ -1642,7 +1623,6 @@ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxSta _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, makeAny( nResultSetConcurrency ) ); } -// ----------------------------------------------------------------------------- Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() { ::rtl::OUString sCommandToExecute; @@ -1702,7 +1682,6 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() return xResultSet; } -// ----------------------------------------------------------------------------- void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertySet >& _rxTemplateColumn, const Reference< XPropertySet >& _rxRowSetColumn ) { OSL_ENSURE( _rxTemplateColumn.is() && _rxRowSetColumn.is(), @@ -1788,7 +1767,6 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS } } -// ----------------------------------------------------------------------------- void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotification) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "ORowSet::execute_NoApprove_NoNewConn" ); @@ -1938,7 +1916,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi m_xColumns->getByName(sColumnLabel) >>= xColumn; if (!xColumn.is() && m_xColumns->hasByName(sName)) m_xColumns->getByName(sName) >>= xColumn; - + // check if column already in the list we need another if ( aAllColumns.find( xColumn ) != aAllColumns.end() ) { @@ -1990,9 +1968,9 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi sParseLabel, m_aCurrentRow); aColumns->get().push_back(pColumn); - + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i) != rKeyColumns.end())); - + if(!sColumnLabel.getLength()) { if(xColumn.is()) @@ -2023,7 +2001,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi // notify the rowset listeners notifyAllListeners(_rClearForNotification); } -// ------------------------------------------------------------------------- + // XRowSetApproveBroadcaster void SAL_CALL ORowSet::addRowSetApproveListener( const Reference< XRowSetApproveListener >& listener ) throw(RuntimeException) { @@ -2033,7 +2011,7 @@ void SAL_CALL ORowSet::addRowSetApproveListener( const Reference< XRowSetApprove m_aApproveListeners.addInterface(listener); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& listener ) throw(RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -2051,7 +2029,7 @@ void SAL_CALL ORowSet::addRowsChangeListener( const Reference< XRowsChangeListen m_aRowsChangeListener.addInterface(listener); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::removeRowsChangeListener( const Reference< XRowsChangeListener >& listener ) throw(RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -2060,7 +2038,6 @@ void SAL_CALL ORowSet::removeRowsChangeListener( const Reference< XRowsChangeLis m_aRowsChangeListener.removeInterface(listener); } -// ------------------------------------------------------------------------- // XResultSetAccess Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) throw(SQLException, RuntimeException) @@ -2076,14 +2053,12 @@ Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) throw(SQLException } return Reference< XResultSet >(); } -// ------------------------------------------------------------------------- // ::com::sun::star::util::XCancellable void SAL_CALL ORowSet::cancel( ) throw(RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); } -// ------------------------------------------------------------------------- // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL ORowSet::deleteRows( const Sequence< Any >& rows ) throw(SQLException, RuntimeException) @@ -2139,7 +2114,7 @@ Sequence< sal_Int32 > SAL_CALL ORowSet::deleteRows( const Sequence< Any >& rows return aResults; } -// ----------------------------------------------------------------------------- + void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) { // notify ourself @@ -2157,7 +2132,7 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) } } } -//------------------------------------------------------------------------------ + void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 _nPos ) { // notify ourself @@ -2175,7 +2150,7 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 } } } -//------------------------------------------------------------------------------ + Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionHandler >& _rxHandler) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -2219,7 +2194,7 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH } return m_xActiveConnection; } -//------------------------------------------------------------------------------ + Reference< XNameAccess > ORowSet::impl_getTables_throw() { Reference< XNameAccess > xTables; @@ -2259,7 +2234,6 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw() return xTables; } -//------------------------------------------------------------------------------ void ORowSet::impl_resetTables_nothrow() { if ( !m_pTables ) @@ -2277,7 +2251,6 @@ void ORowSet::impl_resetTables_nothrow() DELETEZ( m_pTables ); } -//------------------------------------------------------------------------------ sal_Bool ORowSet::impl_initComposer_throw( ::rtl::OUString& _out_rCommandToExecute ) { sal_Bool bUseEscapeProcessing = impl_buildActiveCommand_throw( ); @@ -2325,11 +2298,10 @@ sal_Bool ORowSet::impl_initComposer_throw( ::rtl::OUString& _out_rCommandToExecu impl_initParametersContainer_nothrow(); _out_rCommandToExecute = m_xComposer->getQueryWithSubstitution(); - + return bUseEscapeProcessing; } -//------------------------------------------------------------------------------ sal_Bool ORowSet::impl_buildActiveCommand_throw() { // create the sql command @@ -2425,7 +2397,6 @@ sal_Bool ORowSet::impl_buildActiveCommand_throw() return bDoEscapeProcessing; } -//------------------------------------------------------------------------------ void ORowSet::impl_initParametersContainer_nothrow() { OSL_PRECOND( !m_pParameters.is(), "ORowSet::impl_initParametersContainer_nothrow: already initialized the parameters!" ); @@ -2439,7 +2410,6 @@ void ORowSet::impl_initParametersContainer_nothrow() } } -//------------------------------------------------------------------------------ void ORowSet::impl_disposeParametersContainer_nothrow() { if ( !m_pParameters.is() ) @@ -2457,7 +2427,6 @@ void ORowSet::impl_disposeParametersContainer_nothrow() m_pParameters = NULL; } -// ----------------------------------------------------------------------------- ORowSetValue& ORowSet::getParameterStorage(sal_Int32 parameterIndex) { ::connectivity::checkDisposed( ORowSet_BASE1::rBHelper.bDisposed ); @@ -2490,7 +2459,7 @@ ORowSetValue& ORowSet::getParameterStorage(sal_Int32 parameterIndex) m_aPrematureParamValues.get().resize( parameterIndex ); return m_aPrematureParamValues.get()[ parameterIndex - 1 ]; } -// ------------------------------------------------------------------------- + // XParameters void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException) { @@ -2498,12 +2467,12 @@ void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ getParameterStorage( parameterIndex ).setNull(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException) { setNull( parameterIndex, sqlType ); } -// ----------------------------------------------------------------------------- + void ORowSet::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2511,67 +2480,66 @@ void ORowSet::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x) getParameterStorage( parameterIndex ) = x; } -// ------------------------------------------------------------------------- void SAL_CALL ORowSet::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { setParameter(parameterIndex,x); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2589,7 +2557,7 @@ void SAL_CALL ORowSet::setBinaryStream( sal_Int32 parameterIndex, const Referenc throw SQLException(); } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2611,7 +2579,7 @@ void SAL_CALL ORowSet::setCharacterStream( sal_Int32 parameterIndex, const Refer throw SQLException(); } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException) { if ( !::dbtools::implSetObject( this, parameterIndex, x ) ) @@ -2619,7 +2587,7 @@ void SAL_CALL ORowSet::setObject( sal_Int32 parameterIndex, const Any& x ) throw throw SQLException(); } } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2627,27 +2595,27 @@ void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x setObject( parameterIndex, x ); rParamValue.setTypeKind( targetSqlType ); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException) { ::dbtools::throwFeatureNotImplementedException( "XParameters::setRef", *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException) { ::dbtools::throwFeatureNotImplementedException( "XParameters::setBlob", *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException) { ::dbtools::throwFeatureNotImplementedException( "XParameters::setClob", *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException) { ::dbtools::throwFeatureNotImplementedException( "XParameters::setArray", *this ); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSet::clearParameters( ) throw(SQLException, RuntimeException) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -2660,18 +2628,16 @@ void SAL_CALL ORowSet::clearParameters( ) throw(SQLException, RuntimeException) m_aParametersSet.clear(); } -// ------------------------------------------------------------------------- Any SAL_CALL ORowSet::getWarnings( ) throw (SQLException, RuntimeException) { return m_aWarnings.getWarnings(); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSet::clearWarnings( ) throw (SQLException, RuntimeException) { m_aWarnings.clearWarnings(); } -// ----------------------------------------------------------------------------- + void ORowSet::doCancelModification( ) { //OSL_ENSURE( isModification(), "ORowSet::doCancelModification: invalid call (no cache!)!" ); @@ -2684,31 +2650,26 @@ void ORowSet::doCancelModification( ) m_bModified = sal_False; } -// ----------------------------------------------------------------------------- sal_Bool ORowSet::isModification( ) { return isNew(); } -// ----------------------------------------------------------------------------- sal_Bool ORowSet::isModified( ) { return m_bModified; } -// ----------------------------------------------------------------------------- sal_Bool ORowSet::isNew( ) { return m_bNew; } -// ----------------------------------------------------------------------------- sal_Bool ORowSet::isPropertyChangeNotificationEnabled() const { return m_bPropChangeNotifyEnabled; } -// ----------------------------------------------------------------------------- void ORowSet::checkUpdateIterator() { if(!m_bModified && !m_bNew) @@ -2720,7 +2681,7 @@ void ORowSet::checkUpdateIterator() else if ( m_bNew ) // here we are modifing a value m_bModified = sal_True; } -// ----------------------------------------------------------------------------- + void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) { checkCache(); @@ -2736,10 +2697,10 @@ void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->get().size()) <= columnIndex ) ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_INDEX ), SQL_INVALID_DESCRIPTOR_INDEX, *this ); } -// ----------------------------------------------------------------------------- + void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) { - + ORowSetNotifier aNotifier( this ); // this will call cancelRowModification on the cache if necessary @@ -2754,7 +2715,7 @@ void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) // - IsNew aNotifier.fire( ); } -// ----------------------------------------------------------------------------- + void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) { Reference< XResultSet > xResultSet( m_xStatement->executeQuery() ); @@ -2766,7 +2727,7 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) // ORowSetClone // *********************************************************** DBG_NAME(ORowSetClone); -//-------------------------------------------------------------------------- + ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ) :OSubComponent(m_aMutex, rParent) ,ORowSetBase( _rContext, OComponentHelper::rBHelper, _pMutex ) @@ -2857,19 +2818,18 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo registerProperty(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, nRT, &m_bIsBookmarable, ::getBooleanCppuType()); } -//-------------------------------------------------------------------------- ORowSetClone::~ORowSetClone() { DBG_DTOR(ORowSetClone, NULL); } + // com::sun::star::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > ORowSetClone::getTypes() throw (RuntimeException) { return ::comphelper::concatSequences(OSubComponent::getTypes(),ORowSetBase::getTypes()); } + // com::sun::star::XInterface -//-------------------------------------------------------------------------- Any ORowSetClone::queryInterface( const Type & rType ) throw (RuntimeException) { Any aRet = ORowSetBase::queryInterface(rType); @@ -2877,32 +2837,28 @@ Any ORowSetClone::queryInterface( const Type & rType ) throw (RuntimeException) aRet = OSubComponent::queryInterface(rType); return aRet; } -//------------------------------------------------------------------------------ + void ORowSetClone::acquire() throw() { OSubComponent::acquire(); } -//------------------------------------------------------------------------------ void ORowSetClone::release() throw() { OSubComponent::release(); } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString ORowSetClone::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.ORowSetClone"); } -//------------------------------------------------------------------------------ sal_Bool ORowSetClone::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ORowSetClone::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -2912,7 +2868,6 @@ Sequence< ::rtl::OUString > ORowSetClone::getSupportedServiceNames( ) throw (Ru } // OComponentHelper -//------------------------------------------------------------------------------ void ORowSetClone::disposing() { MutexGuard aGuard( m_aMutex ); @@ -2924,7 +2879,6 @@ void ORowSetClone::disposing() } // XCloseable -//------------------------------------------------------------------------------ void ORowSetClone::close(void) throw( SQLException, RuntimeException ) { { @@ -2934,7 +2888,6 @@ void ORowSetClone::close(void) throw( SQLException, RuntimeException ) } dispose(); } -// ------------------------------------------------------------------------- // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSetClone::createArrayHelper( ) const @@ -2943,7 +2896,6 @@ void ORowSetClone::close(void) throw( SQLException, RuntimeException ) describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } -// ------------------------------------------------------------------------- // cppu::OPropertySetHelper ::cppu::IPropertyArrayHelper& SAL_CALL ORowSetClone::getInfoHelper() @@ -2951,8 +2903,7 @@ void ORowSetClone::close(void) throw( SQLException, RuntimeException ) typedef ::comphelper::OPropertyArrayUsageHelper ORowSetClone_PROP; return *ORowSetClone_PROP::getArrayHelper(); } -// ------------------------------------------------------------------------- -//-------------------------------------------------------------------------- + Sequence< sal_Int8 > ORowSetClone::getUnoTunnelImplementationId() { static ::cppu::OImplementationId * pId = 0; @@ -2967,7 +2918,7 @@ Sequence< sal_Int8 > ORowSetClone::getUnoTunnelImplementationId() } return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- + // com::sun::star::XUnoTunnel sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { @@ -2976,7 +2927,7 @@ sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId ) return 0; } -// ----------------------------------------------------------------------------- + void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception) { if ( nHandle == PROPERTY_ID_FETCHSIZE ) @@ -2988,43 +2939,36 @@ void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,c OPropertyStateContainer::setFastPropertyValue_NoBroadcast(nHandle,rValue); } -// ----------------------------------------------------------------------------- void ORowSetClone::doCancelModification( ) { //OSL_ENSURE( sal_False, "ORowSetClone::doCancelModification: invalid call!" ); } -// ----------------------------------------------------------------------------- sal_Bool ORowSetClone::isModification( ) { return sal_False; } -// ----------------------------------------------------------------------------- sal_Bool ORowSetClone::isModified( ) { return sal_False; } -// ----------------------------------------------------------------------------- sal_Bool ORowSetClone::isNew( ) { return sal_False; } -// ------------------------------------------------------------------------- void SAL_CALL ORowSetClone::execute( ) throw(SQLException, RuntimeException) { throwFunctionNotSupportedException( "RowSetClone::XRowSet::execute", *this ); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSetClone::addRowSetListener( const Reference< XRowSetListener >& ) throw(RuntimeException) { throwFunctionNotSupportedException( "RowSetClone::XRowSet", *this ); } -// ------------------------------------------------------------------------- void SAL_CALL ORowSetClone::removeRowSetListener( const Reference< XRowSetListener >& ) throw(RuntimeException) { throwFunctionNotSupportedException( "RowSetClone::XRowSet", *this ); diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index cb2e2ba..465a281 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 57c844f..fde264c 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -70,7 +70,6 @@ namespace dbaccess // ========================================================================= // = OEmptyCollection // ========================================================================= -// ------------------------------------------------------------------------- class OEmptyCollection : public sdbcx::OCollection { protected: @@ -79,22 +78,21 @@ protected: public: OEmptyCollection(::cppu::OWeakObject& _rParent,::osl::Mutex& _rMutex) : OCollection(_rParent,sal_True,_rMutex,::std::vector< ::rtl::OUString>()){} }; -// ----------------------------------------------------------------------------- + void OEmptyCollection::impl_refresh() throw(RuntimeException) { } -// ----------------------------------------------------------------------------- + connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const ::rtl::OUString& /*_rName*/) { return connectivity::sdbcx::ObjectType(); } -// ----------------------------------------------------------------------------- // ========================================================================= // = ORowSetBase // ========================================================================= DBG_NAME(ORowSetBase) -// ------------------------------------------------------------------------- + ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex ) :OPropertyStateContainer(_rBHelper) ,m_pMutex(_pMutex) @@ -123,7 +121,7 @@ ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cpp registerPropertyNoMember( PROPERTY_ROWCOUNT, PROPERTY_ID_ROWCOUNT, nRBT, ::getCppuType( &nInitialRowCountValue ), &nInitialRowCountValue ); registerPropertyNoMember( PROPERTY_ISROWCOUNTFINAL, PROPERTY_ID_ISROWCOUNTFINAL, nRBT, ::getBooleanCppuType(), &bInitialRowCountFinalValue ); } -// ----------------------------------------------------------------------------- + ORowSetBase::~ORowSetBase() { if(m_pColumns) @@ -140,15 +138,15 @@ ORowSetBase::~ORowSetBase() DBG_DTOR(ORowSetBase,NULL); } + // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > ORowSetBase::getTypes() throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTypes" ); return ::comphelper::concatSequences(ORowSetBase_BASE::getTypes(),OPropertyStateContainer::getTypes()); } + // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any ORowSetBase::queryInterface( const Type & rType ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::queryInterface" ); @@ -157,7 +155,7 @@ Any ORowSetBase::queryInterface( const Type & rType ) throw (RuntimeException) aRet = OPropertyStateContainer::queryInterface(rType); return aRet; } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetBase::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getFastPropertyValue" ); @@ -178,7 +176,7 @@ void SAL_CALL ORowSetBase::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) c else OPropertyStateContainer::getFastPropertyValue(rValue,nHandle); } -// ------------------------------------------------------------------------- + // OComponentHelper void SAL_CALL ORowSetBase::disposing(void) { @@ -197,7 +195,7 @@ void SAL_CALL ORowSetBase::disposing(void) } m_pCache = NULL; } -// ------------------------------------------------------------------------- + // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSetBase::createArrayHelper( ) const { @@ -206,14 +204,14 @@ void SAL_CALL ORowSetBase::disposing(void) describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } -// ------------------------------------------------------------------------- + // cppu::OPropertySetHelper ::cppu::IPropertyArrayHelper& SAL_CALL ORowSetBase::getInfoHelper() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getInfoHelper" ); return *const_cast(this)->getArrayHelper(); } -// ------------------------------------------------------------------------- + // XRow sal_Bool SAL_CALL ORowSetBase::wasNull( ) throw(SQLException, RuntimeException) { @@ -222,23 +220,22 @@ sal_Bool SAL_CALL ORowSetBase::wasNull( ) throw(SQLException, RuntimeException) checkCache(); return impl_wasNull(); } -// ----------------------------------------------------------------------------- + sal_Bool ORowSetBase::impl_wasNull() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_wasNull" ); return ((m_nLastColumnIndex != -1) && !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->isValid()) ? ((*m_aCurrentRow)->get())[m_nLastColumnIndex].isNull() : sal_True; } -// ----------------------------------------------------------------------------- const ORowSetValue& ORowSetBase::getValue(sal_Int32 columnIndex) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getValue" ); checkCache(); return impl_getValue(columnIndex); } -// ----------------------------------------------------------------------------- + const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) -{ +{ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getValue" ); if ( m_bBeforeFirst || m_bAfterLast ) { @@ -291,97 +288,97 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) // we should normally never reach this return m_aEmptyValue; } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL ORowSetBase::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getString" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBoolean" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int8 SAL_CALL ORowSetBase::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getByte" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int16 SAL_CALL ORowSetBase::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getShort" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSetBase::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getInt" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + sal_Int64 SAL_CALL ORowSetBase::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getLong" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + float SAL_CALL ORowSetBase::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getFloat" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + double SAL_CALL ORowSetBase::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getDouble" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL ORowSetBase::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBytes" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Date SAL_CALL ORowSetBase::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getDate" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::Time SAL_CALL ORowSetBase::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTime" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + ::com::sun::star::util::DateTime SAL_CALL ORowSetBase::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTimestamp" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getValue(columnIndex); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBinaryStream" ); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - + if ( m_bBeforeFirst || m_bAfterLast ) { OSL_ENSURE(0,"ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); @@ -409,13 +406,13 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryS // we should normally never reach this return Reference< ::com::sun::star::io::XInputStream >(); } -// ------------------------------------------------------------------------- + Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getCharacterStream" ); return getBinaryStream(columnIndex); } -// ------------------------------------------------------------------------- + Any SAL_CALL ORowSetBase::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getObject" ); @@ -424,33 +421,33 @@ Any SAL_CALL ORowSetBase::getObject( sal_Int32 columnIndex, const Reference< XNa return getValue(columnIndex).makeAny(); } -// ------------------------------------------------------------------------- + Reference< XRef > SAL_CALL ORowSetBase::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getRef" ); ::dbtools::throwFeatureNotImplementedException( "XRow::getRef", *m_pMySelf ); return NULL; } -// ------------------------------------------------------------------------- + Reference< XBlob > SAL_CALL ORowSetBase::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBlob" ); return Reference< XBlob >(getValue(columnIndex).makeAny(),UNO_QUERY); } -// ------------------------------------------------------------------------- + Reference< XClob > SAL_CALL ORowSetBase::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getClob" ); return Reference< XClob >(getValue(columnIndex).makeAny(),UNO_QUERY); } -// ------------------------------------------------------------------------- + Reference< XArray > SAL_CALL ORowSetBase::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getArray" ); ::dbtools::throwFeatureNotImplementedException( "XRow::getArray", *m_pMySelf ); return NULL; } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XRowLocate Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) { @@ -459,7 +456,7 @@ Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - + if ( m_bBeforeFirst || m_bAfterLast ) ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); @@ -469,7 +466,7 @@ Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::getBookmark: bookmark has no value!" ); return m_aBookmark; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveToBookmark" ); @@ -521,7 +518,7 @@ sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLEx DBG_TRACE2("DBACCESS ORowSetBase::moveToBookmark(Any) = %i Clone = %i\n",bRet,m_bClone); return bRet; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveRelativeToBookmark" ); @@ -565,7 +562,7 @@ sal_Bool SAL_CALL ORowSetBase::moveRelativeToBookmark( const Any& bookmark, sal_ DBG_TRACE3("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) = %i Clone = %i\n",rows,bRet,m_bClone); return bRet; } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSetBase::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::compareBookmarks" ); @@ -573,7 +570,7 @@ sal_Int32 SAL_CALL ORowSetBase::compareBookmarks( const Any& _first, const Any& checkCache(); return m_pCache->compareBookmarks(_first,_second); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::hasOrderedBookmarks" ); @@ -581,7 +578,7 @@ sal_Bool SAL_CALL ORowSetBase::hasOrderedBookmarks( ) throw(SQLException, Runti checkCache(); return m_pCache->hasOrderedBookmarks(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSetBase::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::hashBookmark" ); @@ -589,8 +586,7 @@ sal_Int32 SAL_CALL ORowSetBase::hashBookmark( const Any& bookmark ) throw(SQLExc checkCache(); return m_pCache->hashBookmark(bookmark); } -// ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- + // XResultSetMetaDataSupplier Reference< XResultSetMetaData > SAL_CALL ORowSetBase::getMetaData( ) throw(SQLException, RuntimeException) { @@ -603,7 +599,6 @@ Reference< XResultSetMetaData > SAL_CALL ORowSetBase::getMetaData( ) throw(SQLE return xMeta; } -// ------------------------------------------------------------------------- // XColumnLocate sal_Int32 SAL_CALL ORowSetBase::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException) @@ -615,7 +610,6 @@ sal_Int32 SAL_CALL ORowSetBase::findColumn( const ::rtl::OUString& columnName ) // it is possible to save some time her when we remember the names - position relation in a map return m_pColumns ? m_pColumns->findColumn(columnName) : sal_Int32(0); } -// ------------------------------------------------------------------------- // ::com::sun::star::sdbcx::XColumnsSupplier Reference< XNameAccess > SAL_CALL ORowSetBase::getColumns( ) throw(RuntimeException) @@ -633,7 +627,7 @@ Reference< XNameAccess > SAL_CALL ORowSetBase::getColumns( ) throw(RuntimeExcep return m_pColumns; } -// ------------------------------------------------------------------------- + // XResultSet sal_Bool SAL_CALL ORowSetBase::next( ) throw(SQLException, RuntimeException) { @@ -657,7 +651,6 @@ sal_Bool SAL_CALL ORowSetBase::next( ) throw(SQLException, RuntimeException) sal_Bool bAfterLast = m_pCache->isAfterLast(); bRet = m_pCache->next(); doCancelModification( ); - if ( bRet || bAfterLast != m_pCache->isAfterLast() ) { @@ -684,7 +677,7 @@ sal_Bool SAL_CALL ORowSetBase::next( ) throw(SQLException, RuntimeException) DBG_TRACE3("DBACCESS ORowSetBase::next() = %i Clone = %i ID = %i\n",bRet,m_bClone,osl_getThreadIdentifier(NULL)); return bRet; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::isBeforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isBeforeFirst" ); @@ -696,7 +689,7 @@ sal_Bool SAL_CALL ORowSetBase::isBeforeFirst( ) throw(SQLException, RuntimeExce return m_bBeforeFirst; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::isAfterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isAfterLast" ); @@ -707,13 +700,13 @@ sal_Bool SAL_CALL ORowSetBase::isAfterLast( ) throw(SQLException, RuntimeExcept return m_bAfterLast; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetBase::isOnFirst() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isOnFirst" ); return isFirst(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::isFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isFirst" ); @@ -735,13 +728,13 @@ sal_Bool SAL_CALL ORowSetBase::isFirst( ) throw(SQLException, RuntimeException) DBG_TRACE2("DBACCESS ORowSetBase::isFirst() = %i Clone = %i\n",bIsFirst,m_bClone); return bIsFirst; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetBase::isOnLast() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isOnLast" ); return isLast(); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::isLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isLast" ); @@ -767,7 +760,7 @@ sal_Bool SAL_CALL ORowSetBase::isLast( ) throw(SQLException, RuntimeException) DBG_TRACE2("DBACCESS ORowSetBase::isLast() = %i Clone = %i\n",bIsLast,m_bClone); return bIsLast; } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetBase::beforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::beforeFirst" ); @@ -809,7 +802,7 @@ void SAL_CALL ORowSetBase::beforeFirst( ) throw(SQLException, RuntimeException) } DBG_TRACE2("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetBase::afterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::afterLast" ); @@ -849,7 +842,7 @@ void SAL_CALL ORowSetBase::afterLast( ) throw(SQLException, RuntimeException) } DBG_TRACE2("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::move( ::std::mem_fun_t& _aCheckFunctor, ::std::mem_fun_t& _aMovementFunctor) { @@ -897,7 +890,7 @@ sal_Bool SAL_CALL ORowSetBase::move( ::std::mem_fun_t& _aC DBG_TRACE2("DBACCESS ORowSetBase::move() = %i Clone = %i\n",bRet,m_bClone); return bRet; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::first( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::first" ); @@ -906,7 +899,7 @@ sal_Bool SAL_CALL ORowSetBase::first( ) throw(SQLException, RuntimeException) ::std::mem_fun_t F_tmp(&ORowSetCache::first); return move(ioF_tmp,F_tmp); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::last( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::last" ); @@ -915,19 +908,19 @@ sal_Bool SAL_CALL ORowSetBase::last( ) throw(SQLException, RuntimeException) ::std::mem_fun_t L_tmp(&ORowSetCache::last); return move(ioL_tmp,L_tmp); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL ORowSetBase::getRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getRow" ); DBG_TRACE2("DBACCESS ORowSetBase::getRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::osl::MutexGuard aGuard( *m_pMutex ); - + checkCache(); return impl_getRow(); } -// ------------------------------------------------------------------------- + sal_Int32 ORowSetBase::impl_getRow() -{ +{ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getRow" ); sal_Int32 nPos = 0; if ( m_bBeforeFirst ) @@ -952,7 +945,7 @@ sal_Int32 ORowSetBase::impl_getRow() DBG_TRACE3("DBACCESS ORowSetBase::impl_getRow() = %i Clone = %i ID = %i\n",nPos,m_bClone,osl_getThreadIdentifier(NULL)); return nPos; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::absolute" ); @@ -998,7 +991,7 @@ sal_Bool SAL_CALL ORowSetBase::absolute( sal_Int32 row ) throw(SQLException, Run DBG_TRACE3("DBACCESS ORowSetBase::absolute(%i) = %i Clone = %i\n",row,bRet,m_bClone); return bRet; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::relative" ); @@ -1054,7 +1047,7 @@ sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) throw(SQLException, Ru DBG_TRACE3("DBACCESS ORowSetBase::relative(%i) = %i Clone = %i\n",rows,bRet,m_bClone); return bRet; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::previous( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::previous" ); @@ -1107,7 +1100,7 @@ sal_Bool SAL_CALL ORowSetBase::previous( ) throw(SQLException, RuntimeException DBG_TRACE2("DBACCESS ORowSetBase::previous() = %i Clone = %i\n",bRet,m_bClone); return bRet; } -// ----------------------------------------------------------------------------- + void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const ORowSetRow& _rOldValues, ::osl::ResettableMutexGuard& _rGuard ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::setCurrentRow" ); @@ -1173,20 +1166,20 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR DBG_TRACE2("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ----------------------------------------------------------------------------- + void ORowSetBase::checkPositioningAllowed() throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::checkPositioningAllowed" ); if(!m_pCache || m_nResultSetType == ResultSetType::FORWARD_ONLY) throwFunctionSequenceException(*m_pMySelf); } -//------------------------------------------------------------------------------ + Reference< XInterface > ORowSetBase::getStatement(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getStatement" ); return NULL; } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetBase::refreshRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::refreshRow" ); @@ -1202,32 +1195,32 @@ void SAL_CALL ORowSetBase::refreshRow( ) throw(SQLException, RuntimeException) m_pCache->refreshRow(); } } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::rowUpdated( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowUpdated" ); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - + if ( impl_rowDeleted() ) return sal_False; return m_pCache->rowUpdated(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::rowInserted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowInserted" ); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - + if ( impl_rowDeleted() ) return sal_False; return m_pCache->rowInserted(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL ORowSetBase::rowDeleted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowDeleted" ); @@ -1235,12 +1228,12 @@ sal_Bool SAL_CALL ORowSetBase::rowDeleted( ) throw(SQLException, RuntimeExcepti checkCache(); return impl_rowDeleted(); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetBase::impl_rowDeleted( ) { return !m_aBookmark.hasValue() && !m_bBeforeFirst && !m_bAfterLast; } -// ------------------------------------------------------------------------- + // XWarningsSupplier Any SAL_CALL ORowSetBase::getWarnings( ) throw(SQLException, RuntimeException) { @@ -1256,7 +1249,7 @@ Any SAL_CALL ORowSetBase::getWarnings( ) throw(SQLException, RuntimeException) return Any(); } -// ------------------------------------------------------------------------- + void SAL_CALL ORowSetBase::clearWarnings( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::clearWarnings" ); @@ -1269,7 +1262,7 @@ void SAL_CALL ORowSetBase::clearWarnings( ) throw(SQLException, RuntimeExceptio xWarnings->clearWarnings(); } } -// ------------------------------------------------------------------------- + void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) { if (!isPropertyChangeNotificationEnabled()) @@ -1297,44 +1290,39 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) } DBG_TRACE2("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ------------------------------------------------------------------------- + void ORowSetBase::firePropertyChange(sal_Int32 _nPos,const ::connectivity::ORowSetValue& _rOldValue) { OSL_ENSURE(_nPos < (sal_Int32)m_aDataColumns.size(),"nPos is invalid!"); m_aDataColumns[_nPos]->fireValueChange(_rOldValue); } -// ----------------------------------------------------------------------------- + void ORowSetBase::fireRowcount() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::fireRowcount" ); } -// ----------------------------------------------------------------------------- sal_Bool ORowSetBase::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& /*_rGuard*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListenersCursorBeforeMove" ); return sal_True; } -// ----------------------------------------------------------------------------- void ORowSetBase::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& /*_rGuard*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListenersCursorMoved" ); } -// ----------------------------------------------------------------------------- void ORowSetBase::notifyAllListeners(::osl::ResettableMutexGuard& /*_rGuard*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListeners" ); } -// ----------------------------------------------------------------------------- sal_Bool ORowSetBase::isPropertyChangeNotificationEnabled() const { return sal_True; } -// ----------------------------------------------------------------------------- void ORowSetBase::fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::fireProperty" ); @@ -1343,7 +1331,6 @@ void ORowSetBase::fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _ fire( &_nProperty, &aNew, &aOld, 1, sal_False ); } -// ----------------------------------------------------------------------------- void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::positionCache" ); @@ -1399,7 +1386,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) DBG_TRACE2("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ----------------------------------------------------------------------------- + void ORowSetBase::checkCache() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::checkCache" ); @@ -1407,7 +1394,7 @@ void ORowSetBase::checkCache() if(!m_pCache) throwFunctionSequenceException(*m_pMySelf); } -// ----------------------------------------------------------------------------- + void ORowSetBase::movementFailed() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::movementFailed" ); @@ -1421,7 +1408,7 @@ void ORowSetBase::movementFailed() OSL_ENSURE(m_bBeforeFirst || m_bAfterLast,"BeforeFirst or AfterLast is wrong!"); DBG_TRACE2("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } -// ----------------------------------------------------------------------------- + ORowSetRow ORowSetBase::getOldRow(sal_Bool _bWasNew) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getOldRow" ); @@ -1431,13 +1418,13 @@ ORowSetRow ORowSetBase::getOldRow(sal_Bool _bWasNew) aOldValues = new ORowSetValueVector( m_aOldRow->getRow().getBody()); // remember the old values return aOldValues; } -// ----------------------------------------------------------------------------- + void ORowSetBase::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getPropertyDefaultByHandle" ); _rDefault.clear(); } -// ----------------------------------------------------------------------------- + void ORowSetBase::onDeleteRow( const Any& _rBookmark ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::onDeleteRow" ); @@ -1453,7 +1440,7 @@ void ORowSetBase::onDeleteRow( const Any& _rBookmark ) m_nDeletedPosition = m_pCache->getRow(); } } -// ----------------------------------------------------------------------------- + void ORowSetBase::onDeletedRow( const Any& _rBookmark, sal_Int32 _nPos ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::onDeletedRow" ); @@ -1476,7 +1463,7 @@ void ORowSetBase::onDeletedRow( const Any& _rBookmark, sal_Int32 _nPos ) m_aCurrentRow.setBookmark( m_aBookmark ); } } -// ----------------------------------------------------------------------------- + sal_Int32 ORowSetBase::impl_getRowCount() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getRowCount" ); @@ -1494,7 +1481,7 @@ struct ORowSetNotifierImpl }; DBG_NAME(ORowSetNotifier) -// ----------------------------------------------------------------------------- + ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) :m_pRowSet( _pRowSet ) ,m_bWasNew( sal_False ) @@ -1515,7 +1502,7 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) if ( m_pRowSet->isModification( ORowSetBase::GrantNotifierAccess() ) ) m_pRowSet->doCancelModification( ORowSetBase::GrantNotifierAccess() ); } -// ----------------------------------------------------------------------------- + ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet,const ORowSetValueVector::Vector& i_aRow ) :m_pImpl(new ORowSetNotifierImpl) ,m_pRowSet( _pRowSet ) @@ -1530,14 +1517,13 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet,const ORowSetValueVector OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This wil crash." ); m_pImpl->aRow = i_aRow; // yes, create a copy to store the old values } -// ----------------------------------------------------------------------------- + ORowSetNotifier::~ORowSetNotifier( ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetNotifier::~ORowSetNotifier" ); DBG_DTOR(ORowSetNotifier,NULL); } -// ----------------------------------------------------------------------------- void ORowSetNotifier::fire() { // we're not interested in firing changes FALSE->TRUE, only TRUE->FALSE. @@ -1557,19 +1543,19 @@ void ORowSetNotifier::fire() m_bNotifyCalled = sal_True; #endif } -// ----------------------------------------------------------------------------- + ::std::vector& ORowSetNotifier::getChangedColumns() const { OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); return m_pImpl->aChangedColumns; } -// ----------------------------------------------------------------------------- + ::std::vector& ORowSetNotifier::getChangedBookmarks() const { OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); return m_pImpl->aChangedBookmarks; } -// ----------------------------------------------------------------------------- + void ORowSetNotifier::firePropertyChange() { OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index f653d3b..4fff4d5 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ #include -namespace com { namespace sun { namespace star { +namespace com { namespace sun { namespace star { namespace sdb { struct RowChangeEvent; } namespace lang { struct Locale; } } } } @@ -189,7 +189,7 @@ namespace dbaccess const connectivity::ORowSetValue& getValue(sal_Int32 columnIndex); // the cache has to be checked before calling this method const connectivity::ORowSetValue& impl_getValue(sal_Int32 columnIndex); - // sets the current and the bookmark + // sets the current and the bookmark void setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const ORowSetRow& _rOldValues, ::osl::ResettableMutexGuard& _rGuard); void checkPositioningAllowed() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // checks if the cache is null @@ -373,7 +373,7 @@ namespace dbaccess // a method of ORowSetBase (or derivees) sal_Bool m_bWasNew; sal_Bool m_bWasModified; - + #ifdef DBG_UTIL sal_Bool m_bNotifyCalled; #endif @@ -415,10 +415,9 @@ namespace dbaccess */ ::std::vector& getChangedColumns() const; ::std::vector& getChangedBookmarks() const; - + }; } // end of namespace #endif // DBACCESS_CORE_API_ROWSETBASE_HXX - diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index cbe9046..424dbf2 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -77,7 +77,7 @@ using namespace ::osl; #define CHECK_MATRIX_POS(M) OSL_ENSURE(((M) >= static_cast(0)) && ((M) < static_cast(m_pMatrix->size())),"Position is invalid!") DBG_NAME(ORowSetCache) -// ------------------------------------------------------------------------- + ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, const Reference< XSingleSelectQueryAnalyzer >& _xAnalyzer, const ::comphelper::ComponentContext& _rContext, @@ -340,7 +340,6 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, m_nPrivileges = Privilege::SELECT; } -// ------------------------------------------------------------------------- ORowSetCache::~ORowSetCache() { m_pCacheSet = NULL; @@ -363,7 +362,6 @@ ORowSetCache::~ORowSetCache() DBG_DTOR(ORowSetCache,NULL); } -// ------------------------------------------------------------------------- void ORowSetCache::setMaxRowSize(sal_Int32 _nSize) { @@ -433,14 +431,13 @@ void ORowSetCache::setMaxRowSize(sal_Int32 _nSize) m_nEndPos = _nSize; } } -// ------------------------------------------------------------------------- // XResultSetMetaDataSupplier Reference< XResultSetMetaData > ORowSetCache::getMetaData( ) { return m_xMetaData; } -// ------------------------------------------------------------------------- + Any lcl_getBookmark(ORowSetValue& i_aValue,OCacheSet* i_pCacheSet) { switch ( i_aValue.getTypeKind() ) @@ -455,7 +452,7 @@ Any lcl_getBookmark(ORowSetValue& i_aValue,OCacheSet* i_pCacheSet) return i_aValue.getAny(); } } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XRowLocate Any ORowSetCache::getBookmark( ) { @@ -470,7 +467,7 @@ Any ORowSetCache::getBookmark( ) return lcl_getBookmark(((*m_aMatrixIter)->get())[0],m_pCacheSet); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::moveToBookmark( const Any& bookmark ) { if ( m_pCacheSet->moveToBookmark(bookmark) ) @@ -500,7 +497,7 @@ sal_Bool ORowSetCache::moveToBookmark( const Any& bookmark ) return m_aMatrixIter != m_pMatrix->end() && (*m_aMatrixIter).isValid(); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) { sal_Bool bRet( moveToBookmark( bookmark ) ); @@ -515,23 +512,23 @@ sal_Bool ORowSetCache::moveRelativeToBookmark( const Any& bookmark, sal_Int32 ro return bRet; } -// ------------------------------------------------------------------------- + sal_Int32 ORowSetCache::compareBookmarks( const Any& _first, const Any& _second ) { return (!_first.hasValue() || !_second.hasValue()) ? CompareBookmark::NOT_COMPARABLE : m_pCacheSet->compareBookmarks(_first,_second); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::hasOrderedBookmarks( ) { return m_pCacheSet->hasOrderedBookmarks(); } -// ------------------------------------------------------------------------- + sal_Int32 ORowSetCache::hashBookmark( const Any& bookmark ) { return m_pCacheSet->hashBookmark(bookmark); } + // XRowUpdate -// ----------------------------------------------------------------------------- void ORowSetCache::updateNull(sal_Int32 columnIndex,ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns ) @@ -547,7 +544,7 @@ void ORowSetCache::updateNull(sal_Int32 columnIndex,ORowSetValueVector::Vector& m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); } -// ----------------------------------------------------------------------------- + void ORowSetCache::updateValue(sal_Int32 columnIndex,const ORowSetValue& x ,ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns @@ -564,7 +561,7 @@ void ORowSetCache::updateValue(sal_Int32 columnIndex,const ORowSetValue& x m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); } -// ------------------------------------------------------------------------- + void ORowSetCache::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x , sal_Int32 length,ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns @@ -585,7 +582,7 @@ void ORowSetCache::updateCharacterStream( sal_Int32 columnIndex, const Reference m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); } -// ------------------------------------------------------------------------- + void ORowSetCache::updateObject( sal_Int32 columnIndex, const Any& x ,ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns @@ -602,7 +599,7 @@ void ORowSetCache::updateObject( sal_Int32 columnIndex, const Any& x m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); } -// ------------------------------------------------------------------------- + void ORowSetCache::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 /*scale*/ ,ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns @@ -619,7 +616,7 @@ void ORowSetCache::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal m_pCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); } -// ------------------------------------------------------------------------- + // XResultSet sal_Bool ORowSetCache::next( ) { @@ -642,33 +639,33 @@ sal_Bool ORowSetCache::next( ) return !m_bAfterLast; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::isBeforeFirst( ) { // return !m_nPosition; return m_bBeforeFirst; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::isAfterLast( ) { return m_bAfterLast; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::isFirst( ) { return m_nPosition == 1; // ask resultset for } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::isLast( ) { // return m_bRowCountFinal ? (m_nPosition==m_nRowCount) : m_pCacheSet->isLast(); return m_nPosition == m_nRowCount; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::beforeFirst( ) { @@ -684,7 +681,7 @@ sal_Bool ORowSetCache::beforeFirst( ) } return sal_True; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::afterLast( ) { @@ -707,7 +704,7 @@ sal_Bool ORowSetCache::afterLast( ) } return sal_True; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos) { OSL_ENSURE(_nNewStartPos != _nNewEndPos,"ORowSetCache::fillMatrix: StartPos and EndPos can not be equal!"); @@ -777,7 +774,7 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos } return bCheck; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::moveWindow() { @@ -1015,7 +1012,7 @@ sal_Bool ORowSetCache::moveWindow() return bRet; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::first( ) { // first move to the first row @@ -1040,7 +1037,7 @@ sal_Bool ORowSetCache::first( ) } return bRet; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::last( ) { sal_Bool bRet = m_pCacheSet->last(); @@ -1075,12 +1072,12 @@ sal_Bool ORowSetCache::last( ) return bRet; } -// ------------------------------------------------------------------------- + sal_Int32 ORowSetCache::getRow( ) { return (isBeforeFirst() || isAfterLast()) ? 0 : m_nPosition; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::absolute( sal_Int32 row ) { if(!row ) @@ -1133,7 +1130,7 @@ sal_Bool ORowSetCache::absolute( sal_Int32 row ) return !(m_bAfterLast || m_bBeforeFirst); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::relative( sal_Int32 rows ) { sal_Bool bErg = sal_True; @@ -1161,7 +1158,7 @@ sal_Bool ORowSetCache::relative( sal_Int32 rows ) } return bErg; } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::previous( ) { sal_Bool bRet = sal_False; @@ -1192,7 +1189,7 @@ sal_Bool ORowSetCache::previous( ) } return bRet; } -// ------------------------------------------------------------------------- + void ORowSetCache::refreshRow( ) { if(isAfterLast()) @@ -1205,17 +1202,17 @@ void ORowSetCache::refreshRow( ) cancelRowModification(); } } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::rowUpdated( ) { return m_pCacheSet->rowUpdated(); } -// ------------------------------------------------------------------------- + sal_Bool ORowSetCache::rowInserted( ) { return m_pCacheSet->rowInserted(); } -// ------------------------------------------------------------------------- + // XResultSetUpdate sal_Bool ORowSetCache::insertRow(::std::vector< Any >& o_aBookmarks) { @@ -1251,7 +1248,7 @@ sal_Bool ORowSetCache::insertRow(::std::vector< Any >& o_aBookmarks) } return bRet; } -// ------------------------------------------------------------------------- + void ORowSetCache::resetInsertRow(sal_Bool _bClearInsertRow) { if ( _bClearInsertRow ) @@ -1259,7 +1256,7 @@ void ORowSetCache::resetInsertRow(sal_Bool _bClearInsertRow) m_bNew = sal_False; m_bModified = sal_False; } -// ------------------------------------------------------------------------- + void ORowSetCache::cancelRowModification() { // clear the insertrow references -> implies that the current row of the rowset changes as well @@ -1272,7 +1269,7 @@ void ORowSetCache::cancelRowModification() } // for(;aCacheIter != aCacheEnd;++aCacheIter) resetInsertRow(sal_False); } -// ------------------------------------------------------------------------- + void ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow,::std::vector< Any >& o_aBookmarks ) { if(isAfterLast() || isBeforeFirst()) @@ -1303,7 +1300,7 @@ void ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow,::std::vector m_bModified = sal_False; } -// ------------------------------------------------------------------------- + bool ORowSetCache::deleteRow( ) { if(isAfterLast() || isBeforeFirst()) @@ -1330,7 +1327,7 @@ bool ORowSetCache::deleteRow( ) --m_nPosition; return true; } -// ------------------------------------------------------------------------- + void ORowSetCache::cancelRowUpdates( ) { m_bNew = m_bModified = sal_False; @@ -1348,7 +1345,7 @@ void ORowSetCache::cancelRowUpdates( ) ::dbtools::throwFunctionSequenceException(NULL); } } -// ------------------------------------------------------------------------- + void ORowSetCache::moveToInsertRow( ) { m_bNew = sal_True; @@ -1369,7 +1366,7 @@ void ORowSetCache::moveToInsertRow( ) aIter->setTypeKind(m_xMetaData->getColumnType(i)); } } -// ------------------------------------------------------------------------- + ORowSetCacheIterator ORowSetCache::createIterator(ORowSetBase* _pRowSet) { @@ -1378,7 +1375,7 @@ ORowSetCacheIterator ORowSetCache::createIterator(ORowSetBase* _pRowSet) aHelper.pRowSet = _pRowSet; return ORowSetCacheIterator(m_aCacheIterators.insert(m_aCacheIterators.begin(),ORowSetCacheMap::value_type(m_aCacheIterators.size()+1,aHelper)),this,_pRowSet); } -// ----------------------------------------------------------------------------- + void ORowSetCache::deleteIterator(const ORowSetBase* _pRowSet) { ORowSetCacheMap::iterator aCacheIter = m_aCacheIterators.begin(); @@ -1393,7 +1390,7 @@ void ORowSetCache::deleteIterator(const ORowSetBase* _pRowSet) ++aCacheIter; } } -// ----------------------------------------------------------------------------- + void ORowSetCache::rotateCacheIterator(ORowSetMatrix::difference_type _nDist) { if(_nDist) @@ -1422,7 +1419,7 @@ void ORowSetCache::rotateCacheIterator(ORowSetMatrix::difference_type _nDist) } } } -// ------------------------------------------------------------------------- + void ORowSetCache::setUpdateIterator(const ORowSetMatrix::iterator& _rOriginalRow) { m_aInsertRow = m_pInsertMatrix->begin(); @@ -1436,7 +1433,7 @@ void ORowSetCache::setUpdateIterator(const ORowSetMatrix::iterator& _rOriginalRo for(;aIter != aEnd;++aIter) aIter->setModified(sal_False); } -// ----------------------------------------------------------------------------- + void ORowSetCache::checkPositionFlags() { if(m_bRowCountFinal) @@ -1446,13 +1443,13 @@ void ORowSetCache::checkPositionFlags() m_nPosition = 0;//m_nRowCount; } } -// ----------------------------------------------------------------------------- + void ORowSetCache::checkUpdateConditions(sal_Int32 columnIndex) { if(m_bAfterLast || columnIndex >= (sal_Int32)(*m_aInsertRow)->get().size()) throwFunctionSequenceException(m_xSet.get()); } -//------------------------------------------------------------------------------ + sal_Bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode *pNode,const Reference< XConnection>& _xConnection,const ::rtl::OUString& _sUpdateTableName) { sal_Bool bOk = sal_False; @@ -1491,7 +1488,7 @@ sal_Bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode *pNode } return bOk; } -// ----------------------------------------------------------------------------- + sal_Bool ORowSetCache::checkJoin(const Reference< XConnection>& _xConnection, const Reference< XSingleSelectQueryAnalyzer >& _xAnalyzer, const ::rtl::OUString& _sUpdateTableName ) @@ -1551,7 +1548,7 @@ sal_Bool ORowSetCache::checkJoin(const Reference< XConnection>& _xConnection, } return bOk; } -// ----------------------------------------------------------------------------- + void ORowSetCache::clearInsertRow() { // we don't unbound the bookmark column @@ -1567,14 +1564,14 @@ void ORowSetCache::clearInsertRow() } // for(;aIter != (*m_aInsertRow)->end();++aIter) } } -// ----------------------------------------------------------------------------- + ORowSetMatrix::iterator ORowSetCache::calcPosition() const { sal_Int32 nValue = (m_nPosition - m_nStartPos) - 1; CHECK_MATRIX_POS(nValue); return ( nValue < 0 || nValue >= static_cast(m_pMatrix->size()) ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue); } -// ----------------------------------------------------------------------------- + TORowSetOldRowHelperRef ORowSetCache::registerOldRow() { @@ -1582,7 +1579,7 @@ TORowSetOldRowHelperRef ORowSetCache::registerOldRow() m_aOldRows.push_back(pRef); return pRef; } -// ----------------------------------------------------------------------------- + void ORowSetCache::deregisterOldRow(const TORowSetOldRowHelperRef& _rRow) { TOldRowSetRows::iterator aOldRowEnd = m_aOldRows.end(); @@ -1596,7 +1593,7 @@ void ORowSetCache::deregisterOldRow(const TORowSetOldRowHelperRef& _rRow) } } -// ----------------------------------------------------------------------------- + sal_Bool ORowSetCache::reFillMatrix(sal_Int32 _nNewStartPos,sal_Int32 _nNewEndPos) { TOldRowSetRows::iterator aOldRowEnd = m_aOldRows.end(); @@ -1611,7 +1608,7 @@ sal_Bool ORowSetCache::reFillMatrix(sal_Int32 _nNewStartPos,sal_Int32 _nNewEndPo rotateCacheIterator(static_cast(m_nFetchSize+1)); // forces that every iterator will be set to null return bRet; } -// ----------------------------------------------------------------------------- + sal_Bool ORowSetCache::fill(ORowSetMatrix::iterator& _aIter,const ORowSetMatrix::iterator& _aEnd,sal_Int32& _nPos,sal_Bool _bCheck) { sal_Int32 nColumnCount = m_xMetaData->getColumnCount(); @@ -1633,12 +1630,12 @@ sal_Bool ORowSetCache::fill(ORowSetMatrix::iterator& _aIter,const ORowSetMatrix: } return _bCheck; } -// ----------------------------------------------------------------------------- + bool ORowSetCache::isResultSetChanged() const { return m_pCacheSet->isResultSetChanged(); } -// ----------------------------------------------------------------------------- + void ORowSetCache::reset(const Reference< XResultSet>& _xDriverSet) { m_xMetaData.set(Reference< XResultSetMetaDataSupplier >(_xDriverSet,UNO_QUERY)->getMetaData()); @@ -1648,7 +1645,7 @@ void ORowSetCache::reset(const Reference< XResultSet>& _xDriverSet) m_nRowCount = 0; reFillMatrix(m_nStartPos+1,m_nEndPos+1); } -// ----------------------------------------------------------------------------- + void ORowSetCache::impl_updateRowFromCache_throw(ORowSetValueVector::Vector& io_aRow ,::std::vector& o_ChangedColumns) { @@ -1669,4 +1666,3 @@ void ORowSetCache::impl_updateRowFromCache_throw(ORowSetValueVector::Vector& io_ } } } -// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index 24d09df..f161f51 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/RowSetCacheIterator.cxx b/dbaccess/source/core/api/RowSetCacheIterator.cxx index 9f1137d..a9d2c0c 100644 --- a/dbaccess/source/core/api/RowSetCacheIterator.cxx +++ b/dbaccess/source/core/api/RowSetCacheIterator.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,12 +40,12 @@ ORowSetCacheIterator::ORowSetCacheIterator(const ORowSetCacheIterator& _rRH) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetCacheIterator::ORowSetCacheIterator" ); } -// ----------------------------------------------------------------------------- + ORowSetCacheIterator::operator ORowSetMatrix::iterator() { return m_aIter->second.aIterator; } -// ----------------------------------------------------------------------------- + ORowSetCacheIterator& ORowSetCacheIterator::operator =(const ORowSetCacheIterator& _rRH) { if(this == &_rRH) @@ -57,18 +57,18 @@ ORowSetCacheIterator& ORowSetCacheIterator::operator =(const ORowSetCacheIterato return *this; } -// ----------------------------------------------------------------------------- + ORowSetCacheIterator& ORowSetCacheIterator::operator =(const ORowSetMatrix::iterator& _rIter) { m_aIter->second.aIterator = _rIter; return *this; } -// ----------------------------------------------------------------------------- + ORowSetRow& ORowSetCacheIterator::operator *() { return *m_aIter->second.aIterator; } -// ----------------------------------------------------------------------------- + const ORowSetRow& ORowSetCacheIterator::operator *() const { if ( !m_pRowSet->isInsertRow() && m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) @@ -79,12 +79,12 @@ const ORowSetRow& ORowSetCacheIterator::operator *() const } return *m_aIter->second.aIterator; } -// ----------------------------------------------------------------------------- + ORowSetMatrix::iterator& ORowSetCacheIterator::operator ->() { return m_aIter->second.aIterator; } -// ----------------------------------------------------------------------------- + const ORowSetMatrix::iterator& ORowSetCacheIterator::operator ->() const { if ( !m_pRowSet->isInsertRow() && m_aIter->second.aIterator == m_pCache->m_pMatrix->end() ) @@ -95,33 +95,33 @@ const ORowSetMatrix::iterator& ORowSetCacheIterator::operator ->() const } return m_aIter->second.aIterator; } -// ----------------------------------------------------------------------------- + bool ORowSetCacheIterator::operator <=(const ORowSetMatrix::iterator& _rRH) const { return m_aIter->second.aIterator <= _rRH; } -// ----------------------------------------------------------------------------- + bool ORowSetCacheIterator::operator <(const ORowSetMatrix::iterator& _rRH) const { return m_aIter->second.aIterator < _rRH; } -// ----------------------------------------------------------------------------- + bool ORowSetCacheIterator::operator !=(const ORowSetMatrix::iterator& _rRH) const { return m_aIter->second.aIterator != _rRH; } -// ----------------------------------------------------------------------------- + bool ORowSetCacheIterator::operator ==(const ORowSetMatrix::iterator& _rRH) const { return m_aIter->second.aIterator == _rRH; } -// ----------------------------------------------------------------------------- + void ORowSetCacheIterator::setBookmark(const ::com::sun::star::uno::Any& _rBookmark) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetCacheIterator::setBookmark" ); m_aIter->second.aBookmark = _rBookmark; } -// ----------------------------------------------------------------------------- + sal_Bool ORowSetCacheIterator::isNull() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetCacheIterator::isNull" ); @@ -130,7 +130,7 @@ sal_Bool ORowSetCacheIterator::isNull() const { ORowSetCacheIterator_Helper aHelper = m_aIter->second; bRet = ( m_pRowSet->isInsertRow() - ? + ? m_aIter->second.aIterator == m_pCache->m_pInsertMatrix->end() : m_aIter->second.aIterator == m_pCache->m_pMatrix->end() @@ -138,7 +138,7 @@ sal_Bool ORowSetCacheIterator::isNull() const } return bRet; } -// ----------------------------------------------------------------------------- + ::osl::Mutex* ORowSetCacheIterator::getMutex() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetCacheIterator::getMutex" ); diff --git a/dbaccess/source/core/api/RowSetCacheIterator.hxx b/dbaccess/source/core/api/RowSetCacheIterator.hxx index c7ea4bd..8ef2f22 100644 --- a/dbaccess/source/core/api/RowSetCacheIterator.hxx +++ b/dbaccess/source/core/api/RowSetCacheIterator.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ namespace dbaccess ::com::sun::star::uno::Any aBookmark; ORowSetBase* pRowSet; } ORowSetCacheIterator_Helper; - + DECLARE_STL_STDKEY_MAP(sal_Int32,ORowSetCacheIterator_Helper,ORowSetCacheMap); class ORowSetCache; @@ -50,7 +50,7 @@ namespace dbaccess ORowSetCache* m_pCache; ORowSetBase* m_pRowSet; protected: - ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet) + ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet) : m_aIter(_rIter) ,m_pCache(_pCache) ,m_pRowSet(_pRowSet) @@ -67,7 +67,7 @@ namespace dbaccess ORowSetRow& operator *(); const ORowSetRow& operator *() const; - + ORowSetMatrix::iterator& operator ->(); const ORowSetMatrix::iterator& operator ->() const; @@ -84,5 +84,3 @@ namespace dbaccess }; } #endif // DBACCESS_ROWSETCACHEITERATOR_HXX - - diff --git a/dbaccess/source/core/api/RowSetRow.hxx b/dbaccess/source/core/api/RowSetRow.hxx index ec7786e..52ecb81 100644 --- a/dbaccess/source/core/api/RowSetRow.hxx +++ b/dbaccess/source/core/api/RowSetRow.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,14 +47,10 @@ namespace dbaccess ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh); public: ORowSetOldRowHelper() : m_refCount(0){} - ORowSetOldRowHelper(const ORowSetRow& _rRow) + ORowSetOldRowHelper(const ORowSetRow& _rRow) : m_refCount(0) , m_aRow(_rRow) {} -// ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh) -// : m_refCount(0) -// , m_aRow(_rRh.m_aRow) -// {} void acquire() { @@ -97,4 +93,3 @@ namespace dbaccess }; } #endif // DBACCESS_CORE_API_ROWSETROW_HXX - diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index eea07de..b2a88b4 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -103,10 +103,8 @@ namespace BooleanComparisonMode = ::com::sun::star::sdb::BooleanComparisonMode; #define R_BRACKET ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")) #define COMMA ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")) -// ------------------------------------------------------------------------- namespace { - // ..................................................................... /** parses the given statement, using the given parser, returns a parse node representing the statement @@ -240,7 +238,7 @@ namespace } DBG_NAME(OSingleSelectQueryComposer) -// ------------------------------------------------------------------------- + OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAccess>& _rxTables, const Reference< XConnection>& _xConnection, const ::comphelper::ComponentContext& _rContext ) @@ -291,7 +289,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc { } } -// ------------------------------------------------------------------------- + OSingleSelectQueryComposer::~OSingleSelectQueryComposer() { DBG_DTOR(OSingleSelectQueryComposer,NULL); @@ -305,7 +303,7 @@ OSingleSelectQueryComposer::~OSingleSelectQueryComposer() for(;aTabIter != aTabEnd;++aTabIter) delete *aTabIter; } -// ------------------------------------------------------------------------- + // OComponentHelper void SAL_CALL OSingleSelectQueryComposer::disposing(void) { @@ -327,7 +325,6 @@ IMPLEMENT_SERVICE_INFO1(OSingleSelectQueryComposer,"org.openoffice.comp.dba.OSin IMPLEMENT_TYPEPROVIDER3(OSingleSelectQueryComposer,OSubComponent,OSingleSelectQueryComposer_BASE,OPropertyContainer) IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OSingleSelectQueryComposer) -// ------------------------------------------------------------------------- // com::sun::star::lang::XUnoTunnel sal_Int64 SAL_CALL OSingleSelectQueryComposer::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { @@ -338,7 +335,6 @@ sal_Int64 SAL_CALL OSingleSelectQueryComposer::getSomething( const Sequence< sal return sal_Int64(0); } -// ------------------------------------------------------------------------- // XSingleSelectQueryAnalyzer ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getQuery( ) throw(RuntimeException) { @@ -350,7 +346,6 @@ sal_Int64 SAL_CALL OSingleSelectQueryComposer::getSomething( const Sequence< sal return getStatementPart(F_tmp,m_aSqlIterator); } -// ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setQuery( const ::rtl::OUString& command ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "OSingleSelectQueryComposer::setQuery" ); @@ -371,9 +366,9 @@ void SAL_CALL OSingleSelectQueryComposer::setQuery( const ::rtl::OUString& comma for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) m_aElementaryParts[ eLoopParts ] = ::rtl::OUString(); } -// ------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::setCommand( const ::rtl::OUString& Command,sal_Int32 _nCommandType ) throw(SQLException, RuntimeException) -{ +{ ::rtl::OUStringBuffer sSQL; switch(_nCommandType) { @@ -399,7 +394,7 @@ void SAL_CALL OSingleSelectQueryComposer::setCommand( const ::rtl::OUString& Com { DBG_UNHANDLED_EXCEPTION(); } - + sSQL.append(dbtools::composeTableNameForSelect(m_xConnection,xTable)); } else @@ -412,7 +407,7 @@ void SAL_CALL OSingleSelectQueryComposer::setCommand( const ::rtl::OUString& Com case CommandType::QUERY: if ( m_xConnectionQueries->hasByName(Command) ) { - + Reference xQuery(m_xConnectionQueries->getByName(Command),UNO_QUERY); ::rtl::OUString sCommand; xQuery->getPropertyValue(PROPERTY_COMMAND) >>= sCommand; @@ -424,7 +419,7 @@ void SAL_CALL OSingleSelectQueryComposer::setCommand( const ::rtl::OUString& Com sMessage.SearchAndReplaceAscii( "$table$", Command ); throwGenericSQLException(sMessage,*this); } - + break; default: break; @@ -440,16 +435,8 @@ void SAL_CALL OSingleSelectQueryComposer::setCommand( const ::rtl::OUString& Com ::rtl::OUString sCommand = sSQL.makeStringAndClear(); setElementaryQuery(sCommand); m_sOrignal = sCommand; -/* - // reset the additive iterator to the same statement - parseAndCheck_throwError( m_aSqlParser, m_sOrignal, m_aAdditiveIterator, *this ); - - // we have no "elementary" parts anymore (means filter/groupby/having/order clauses) - for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) - m_aElementaryParts[ eLoopParts ] = ::rtl::OUString(); -*/ } -// ----------------------------------------------------------------------------- + void OSingleSelectQueryComposer::setQuery_Impl( const ::rtl::OUString& command ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "OSingleSelectQueryComposer::setQuery_Impl" ); @@ -459,41 +446,38 @@ void OSingleSelectQueryComposer::setQuery_Impl( const ::rtl::OUString& command ) // strip it from all clauses, to have the pure SELECT statement m_aPureSelectSQL = getPureSelectStatement( m_aSqlIterator.getParseTree(), m_xConnection ); - // update columns and tables - // why? Shouldn't this be done on request only? - // otherwise nothing is working anymore :-) -// getColumns(); + // update tables getTables(); } -// ----------------------------------------------------------------------------- + Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getStructuredHavingClause( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getStructuredHavingClause" ); TGetParseNode F_tmp(&OSQLParseTreeIterator::getSimpleHavingTree); return getStructuredCondition(F_tmp); } -// ------------------------------------------------------------------------- + Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getStructuredFilter( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getStructuredFilter" ); TGetParseNode F_tmp(&OSQLParseTreeIterator::getSimpleWhereTree); return getStructuredCondition(F_tmp); } -// ----------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::appendHavingClauseByColumn" ); ::std::mem_fun1_t F_tmp(&OSingleSelectQueryComposer::implSetHavingClause); setConditionByColumn(column,andCriteria,F_tmp,filterOperator); } -// ----------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::appendFilterByColumn" ); ::std::mem_fun1_t F_tmp(&OSingleSelectQueryComposer::implSetFilter); setConditionByColumn(column,andCriteria,F_tmp,filterOperator); } -// ----------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::impl_getColumnName_throw(const Reference< XPropertySet >& column) { ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); @@ -563,7 +547,7 @@ void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< aNewName = getTableAlias(column) + ::dbtools::quoteName(aQuote,aName); return aNewName; } -// ------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::appendOrderByColumn( const Reference< XPropertySet >& column, sal_Bool ascending ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::appendOrderByColumn" ); @@ -579,7 +563,6 @@ void SAL_CALL OSingleSelectQueryComposer::appendOrderByColumn( const Reference< setOrder(sOrder); } -// ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::appendGroupByColumn( const Reference< XPropertySet >& column) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::appendGroupByColumn" ); @@ -590,7 +573,7 @@ void SAL_CALL OSingleSelectQueryComposer::appendGroupByColumn( const Reference< aComposer.append( sColumnName ); setGroup( aComposer.getComposedAndClear() ); } -// ------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::composeStatementFromParts( const ::std::vector< ::rtl::OUString >& _rParts ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::composeStatementFromParts" ); @@ -607,14 +590,12 @@ void SAL_CALL OSingleSelectQueryComposer::appendGroupByColumn( const Reference< return aSql.makeStringAndClear(); } -// ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getElementaryQuery() throw (::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getElementaryQuery" ); return composeStatementFromParts( m_aElementaryParts ); } -// ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const ::rtl::OUString& _rElementary ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "OSingleSelectQueryComposer::setElementaryQuery" ); @@ -649,7 +630,6 @@ void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const ::rtl::OUStr } } -// ------------------------------------------------------------------------- namespace { ::rtl::OUString getComposedClause( const ::rtl::OUString _rElementaryClause, const ::rtl::OUString _rAdditionalClause, @@ -665,7 +645,6 @@ namespace } } -// ------------------------------------------------------------------------- void OSingleSelectQueryComposer::setSingleAdditiveClause( SQLPart _ePart, const ::rtl::OUString& _rClause ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setSingleAdditiveClause" ); @@ -729,33 +708,30 @@ void OSingleSelectQueryComposer::setSingleAdditiveClause( SQLPart _ePart, const } } -// ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setFilter( const ::rtl::OUString& filter ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setFilter" ); setSingleAdditiveClause( Where, filter ); } -// ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setOrder( const ::rtl::OUString& order ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setOrder" ); setSingleAdditiveClause( Order, order ); } -// ----------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::setGroup( const ::rtl::OUString& group ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setGroup" ); setSingleAdditiveClause( Group, group ); } -// ------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::setHavingClause( const ::rtl::OUString& filter ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setHavingClause" ); setSingleAdditiveClause( Having, filter ); } -// ------------------------------------------------------------------------- // XTablesSupplier Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getTables( ) throw(RuntimeException) { @@ -776,7 +752,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getTables( ) thro return m_pTables; } -// ------------------------------------------------------------------------- + // XColumnsSupplier Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) throw(RuntimeException) { @@ -860,10 +836,10 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_QUERY_THROW ); } } - catch( const Exception& ) - { - //@see issue http://qa.openoffice.org/issues/show_bug.cgi?id=110111 - // access returns a different order of column names when executing select * from + catch( const Exception& ) + { + //@see issue http://qa.openoffice.org/issues/show_bug.cgi?id=110111 + // access returns a different order of column names when executing select * from // and asking the columns from the metadata. Reference< XParameters > xParameters( xPreparedStatement, UNO_QUERY_THROW ); Reference< XIndexAccess > xPara = getParameters(); @@ -958,11 +934,10 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr if ( !sColumnName.getLength() ) xProp->getPropertyValue(PROPERTY_NAME) >>= sColumnName; - aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sColumnName)); sal_Int32 j = 0; while ( aFindName != aNames.end() ) - { + { sColumnName += ::rtl::OUString::valueOf(++j); aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sColumnName)); } @@ -970,7 +945,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr pColumn->setName(sColumnName); pColumn->setRealName(sRealName); pColumn->setTableName(::comphelper::getString(xProp->getPropertyValue(PROPERTY_TABLENAME))); - + (aSelectColumns->get())[i-1] = pColumn; } else @@ -993,7 +968,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr return m_aCurrentColumns[SelectColumns]; } -// ------------------------------------------------------------------------- + sal_Bool OSingleSelectQueryComposer::setORCriteria(OSQLParseNode* pCondition, OSQLParseTreeIterator& _rIterator, ::std::vector< ::std::vector < PropertyValue > >& rFilters, const Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter) const { @@ -1032,7 +1007,6 @@ sal_Bool OSingleSelectQueryComposer::setORCriteria(OSQLParseNode* pCondition, OS } } -//-------------------------------------------------------------------------------------------------- sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition, OSQLParseTreeIterator& _rIterator, ::std::vector < PropertyValue >& rFilter, const Reference< XNumberFormatter > & xFormatter) const { @@ -1123,7 +1097,7 @@ sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition, return sal_True; } -// ----------------------------------------------------------------------------- + sal_Int32 OSingleSelectQueryComposer::getPredicateType(OSQLParseNode * _pPredicate) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getPredicateType" ); @@ -1153,7 +1127,7 @@ sal_Int32 OSingleSelectQueryComposer::getPredicateType(OSQLParseNode * _pPredica } return nPredicate; } -//------------------------------------------------------------------------------ + sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCondition, OSQLParseTreeIterator& _rIterator, ::std::vector < PropertyValue >& rFilter, const Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter) const { @@ -1280,8 +1254,8 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon } return sal_True; } + // functions for analysing SQL -//-------------------------------------------------------------------------------------------------- ::rtl::OUString OSingleSelectQueryComposer::getColumnName( ::connectivity::OSQLParseNode* pColumnRef, OSQLParseTreeIterator& _rIterator ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getColumnName" ); @@ -1289,7 +1263,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon _rIterator.getColumnRange(pColumnRef,aColumnName,aTableRange); return aColumnName; } -//------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getFilter( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getFilter" ); @@ -1297,7 +1271,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::osl::MutexGuard aGuard( m_aMutex ); return getSQLPart(Where,m_aAdditiveIterator,sal_False); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getOrder( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getOrder" ); @@ -1305,7 +1279,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::osl::MutexGuard aGuard( m_aMutex ); return getSQLPart(Order,m_aAdditiveIterator,sal_False); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getGroup( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getGroup" ); @@ -1313,7 +1287,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::osl::MutexGuard aGuard( m_aMutex ); return getSQLPart(Group,m_aAdditiveIterator,sal_False); } -// ----------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::getHavingClause() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getHavingClause" ); @@ -1321,7 +1295,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::osl::MutexGuard aGuard( m_aMutex ); return getSQLPart(Having,m_aAdditiveIterator,sal_False); } -// ----------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::getTableAlias(const Reference< XPropertySet >& column) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getTableAlias" ); @@ -1396,7 +1370,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon } return sReturn; } -// ----------------------------------------------------------------------------- + Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getParameters( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getParameters" ); @@ -1405,7 +1379,7 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getParameters( ) { ::vos::ORef< OSQLColumns> aCols = m_aSqlIterator.getParameters(); ::std::vector< ::rtl::OUString> aNames; - OSQLColumns::Vector::const_iterator aEnd = aCols->get().end(); + OSQLColumns::Vector::const_iterator aEnd = aCols->get().end(); for(OSQLColumns::Vector::const_iterator aIter = aCols->get().begin(); aIter != aEnd;++aIter) aNames.push_back(getString((*aIter)->getPropertyValue(PROPERTY_NAME))); m_aCurrentColumns[ParameterColumns] = new OPrivateColumns(aCols,m_xMetaData->supportsMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames,sal_True); @@ -1413,7 +1387,7 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getParameters( ) return m_aCurrentColumns[ParameterColumns]; } -// ----------------------------------------------------------------------------- + void OSingleSelectQueryComposer::clearColumns( const EColumnType _eType ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::clearColumns" ); @@ -1425,7 +1399,7 @@ void OSingleSelectQueryComposer::clearColumns( const EColumnType _eType ) m_aCurrentColumns[ _eType ] = NULL; } } -// ----------------------------------------------------------------------------- + void OSingleSelectQueryComposer::clearCurrentCollections() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::clearCurrentCollections" ); @@ -1448,7 +1422,7 @@ void OSingleSelectQueryComposer::clearCurrentCollections() m_pTables = NULL; } } -// ----------------------------------------------------------------------------- + Reference< XIndexAccess > OSingleSelectQueryComposer::setCurrentColumns( EColumnType _eType, const ::vos::ORef< OSQLColumns >& _rCols ) { @@ -1460,7 +1434,7 @@ Reference< XIndexAccess > OSingleSelectQueryComposer::setCurrentColumns( EColumn if ( !m_aCurrentColumns[_eType] ) { ::std::vector< ::rtl::OUString> aNames; - OSQLColumns::Vector::const_iterator aEnd = _rCols->get().end(); + OSQLColumns::Vector::const_iterator aEnd = _rCols->get().end(); for(OSQLColumns::Vector::const_iterator aIter = _rCols->get().begin(); aIter != aEnd;++aIter) aNames.push_back(getString((*aIter)->getPropertyValue(PROPERTY_NAME))); m_aCurrentColumns[_eType] = new OPrivateColumns(_rCols,m_xMetaData->supportsMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames,sal_True); @@ -1468,19 +1442,19 @@ Reference< XIndexAccess > OSingleSelectQueryComposer::setCurrentColumns( EColumn return m_aCurrentColumns[_eType]; } -// ----------------------------------------------------------------------------- + Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getGroupColumns( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getGroupColumns" ); return setCurrentColumns( GroupByColumns, m_aAdditiveIterator.getGroupColumns() ); } -// ------------------------------------------------------------------------- + Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getOrderColumns( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getOrderColumns" ); return setCurrentColumns( OrderColumns, m_aAdditiveIterator.getOrderColumns() ); } -// ----------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OSingleSelectQueryComposer::getQueryWithSubstitution( ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getQueryWithSubstitution" ); @@ -1499,7 +1473,7 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getOrderColumns( return sSqlStatement; } -// ----------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::getStatementPart( TGetParseNode& _aGetFunctor, OSQLParseTreeIterator& _rIterator ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getStatementPart" ); @@ -1511,7 +1485,7 @@ Reference< XIndexAccess > SAL_CALL OSingleSelectQueryComposer::getOrderColumns( return sResult; } -// ----------------------------------------------------------------------------- + namespace { ::rtl::OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter ) @@ -1545,19 +1519,19 @@ namespace return sRet.makeStringAndClear(); } } -// ----------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredFilter" ); setFilter(lcl_getCondition(filter)); } -// ----------------------------------------------------------------------------- + void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredHavingClause" ); setHavingClause(lcl_getCondition(filter)); } -// ----------------------------------------------------------------------------- + void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria ,::std::mem_fun1_t& _aSetFunctor,sal_Int32 filterOperator) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setConditionByColumn" ); @@ -1623,7 +1597,6 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert aSQL.append( ::dbtools::quoteName( aQuote, aName ) ); } - if ( aValue.hasValue() ) { if( !m_xTypeConverter.is() ) @@ -1635,7 +1608,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert ::rtl::OUString sEmpty; lcl_addFilterCriteria_throw(filterOperator,sEmpty,aSQL); } - + switch(nType) { case DataType::VARCHAR: @@ -1728,7 +1701,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert // add the filter and the sort order _aSetFunctor(this,sFilter); } -// ----------------------------------------------------------------------------- + Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredCondition( TGetParseNode& _aGetFunctor ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getStructuredCondition" ); @@ -1817,7 +1790,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC } return aFilterSeq; } -// ----------------------------------------------------------------------------- + ::rtl::OUString OSingleSelectQueryComposer::getKeyword( SQLPart _ePart ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getKeyword" ); @@ -1843,7 +1816,6 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC return sKeyword; } -// ----------------------------------------------------------------------------- ::rtl::OUString OSingleSelectQueryComposer::getSQLPart( SQLPart _ePart, OSQLParseTreeIterator& _rIterator, sal_Bool _bWithKeyword ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::getSQLPart" ); @@ -1872,4 +1844,3 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC sRet = sKeyword + sRet; return sRet; } -// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index 936ac2e..0e52b86 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,34 +51,33 @@ using namespace ::com::sun::star::lang; // using namespace ::cppu; using namespace ::osl; -// ------------------------------------------------------------------------- void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fillValueRow" ); _rRow = *m_aSetIter; } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XRowLocate Any SAL_CALL OStaticSet::getBookmark() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::getBookmark" ); return makeAny(getRow()); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::moveToBookmark" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return absolute(::comphelper::getINT32(bookmark)); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::moveRelativeToBookmark" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; return absolute(::comphelper::getINT32(bookmark)+rows); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OStaticSet::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::compareBookmarks" ); @@ -87,19 +86,19 @@ sal_Int32 SAL_CALL OStaticSet::compareBookmarks( const Any& _first, const Any& _ _second >>= nSecond; return (nFirst < nSecond) ? CompareBookmark::LESS : ((nFirst > nSecond) ? CompareBookmark::GREATER : CompareBookmark::EQUAL); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::hasOrderedBookmarks" ); return sal_True; } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OStaticSet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::hashBookmark" ); return ::comphelper::getINT32(bookmark); } -// ------------------------------------------------------------------------- + sal_Bool OStaticSet::fetchRow() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fetchRow" ); @@ -117,7 +116,7 @@ sal_Bool OStaticSet::fetchRow() m_bEnd = sal_True; return bRet; } -// ------------------------------------------------------------------------- + void OStaticSet::fillAllRows() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fillAllRows" ); @@ -134,7 +133,7 @@ void OStaticSet::fillAllRows() m_bEnd = sal_True; } } -// ------------------------------------------------------------------------- + // XResultSet sal_Bool SAL_CALL OStaticSet::next( ) throw(SQLException, RuntimeException) { @@ -153,38 +152,38 @@ sal_Bool SAL_CALL OStaticSet::next( ) throw(SQLException, RuntimeException) ++m_aSetIter; return !isAfterLast(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::isBeforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::isBeforeFirst" ); return m_aSetIter == m_aSet.begin(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::isAfterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::isAfterLast" ); return m_aSetIter == m_aSet.end() && m_bEnd; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::isFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::isFirst" ); return m_aSetIter == m_aSet.begin()+1; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::isLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::isLast" ); return m_aSetIter == m_aSet.end()-1 && m_bEnd; } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::beforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::beforeFirst" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; m_aSetIter = m_aSet.begin(); } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::afterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::afterLast" ); @@ -192,7 +191,7 @@ void SAL_CALL OStaticSet::afterLast( ) throw(SQLException, RuntimeException) fillAllRows(); m_aSetIter = m_aSet.end(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::first( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::first" ); @@ -203,17 +202,17 @@ sal_Bool SAL_CALL OStaticSet::first( ) throw(SQLException, RuntimeException) return m_aSetIter != m_aSet.end(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::last( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::last" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; fillAllRows(); m_aSetIter = m_aSet.end()-1; - + return !isBeforeFirst() && !isAfterLast(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL OStaticSet::getRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::getRow" ); @@ -224,7 +223,7 @@ sal_Int32 SAL_CALL OStaticSet::getRow( ) throw(SQLException, RuntimeException) OSL_ENSURE(nPos > 0,"RowPos is < 0"); return nPos; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::absolute" ); @@ -254,7 +253,7 @@ sal_Bool SAL_CALL OStaticSet::absolute( sal_Int32 row ) throw(SQLException, Runt bNext = fetchRow(); } - if(row > (sal_Int32)m_aSet.size()) + if(row > (sal_Int32)m_aSet.size()) m_aSetIter = m_aSet.end(); // check again else m_aSetIter = m_aSet.begin() + row; @@ -265,7 +264,7 @@ sal_Bool SAL_CALL OStaticSet::absolute( sal_Int32 row ) throw(SQLException, Runt return m_aSetIter != m_aSet.end() && m_aSetIter != m_aSet.begin(); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::relative( sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::relative" ); @@ -275,41 +274,41 @@ sal_Bool SAL_CALL OStaticSet::relative( sal_Int32 rows ) throw(SQLException, Run sal_Int32 nCurPos = getRow(); return absolute(nCurPos+rows); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::previous( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::previous" ); m_bInserted = m_bUpdated = m_bDeleted = sal_False; - + if(m_aSetIter != m_aSet.begin()) --m_aSetIter; return m_aSetIter != m_aSet.begin(); } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::refreshRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::refreshRow" ); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::rowUpdated( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::rowUpdated" ); return m_bUpdated; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::rowInserted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::rowInserted" ); return m_bInserted; } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL OStaticSet::rowDeleted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::rowDeleted" ); return m_bDeleted; } -// ------------------------------------------------------------------------- + Sequence< sal_Int32 > SAL_CALL OStaticSet::deleteRows( const Sequence< Any >& rows,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::deleteRows" ); @@ -323,7 +322,7 @@ Sequence< sal_Int32 > SAL_CALL OStaticSet::deleteRows( const Sequence< Any >& ro } return aRet; } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::insertRow" ); @@ -336,13 +335,13 @@ void SAL_CALL OStaticSet::insertRow( const ORowSetRow& _rInsertRow,const connect m_bEnd = sal_False; } } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::updateRow" ); OCacheSet::updateRow( _rInsertRow,_rOrginalRow,_xTable); } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQLTable& _xTable ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::deleteRow" ); @@ -355,20 +354,18 @@ void SAL_CALL OStaticSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connect m_aSet.erase(aPos); } } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::cancelRowUpdates" ); } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::moveToInsertRow" ); } -// ------------------------------------------------------------------------- + void SAL_CALL OStaticSet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::moveToCurrentRow" ); } -// ------------------------------------------------------------------------- - diff --git a/dbaccess/source/core/api/StaticSet.hxx b/dbaccess/source/core/api/StaticSet.hxx index b6d41d4..f470409 100644 --- a/dbaccess/source/core/api/StaticSet.hxx +++ b/dbaccess/source/core/api/StaticSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -88,4 +88,3 @@ namespace dbaccess }; } #endif //DBACCESS_CORE_API_STATICSET_HXX - diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 9160046..a167940 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -70,7 +70,7 @@ using namespace ::cppu; //= ODBTableDecorator //========================================================================== DBG_NAME(ODBTableDecorator) -// ----------------------------------------------------------------------------- + ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnection, const Reference< XColumnsSupplier >& _rxNewTable, const Reference< XNumberFormatsSupplier >& _rxNumberFormats, const Reference< XNameAccess >& _xColumnDefinitions ) throw(SQLException) :OTableDescriptor_BASE(m_aMutex) @@ -87,7 +87,7 @@ ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnect DBG_CTOR(ODBTableDecorator, NULL); ODataSettings::registerPropertiesFor(this); } -// ------------------------------------------------------------------------- + ODBTableDecorator::~ODBTableDecorator() { DBG_DTOR(ODBTableDecorator, NULL); @@ -95,7 +95,6 @@ ODBTableDecorator::~ODBTableDecorator() delete m_pColumns; } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > ODBTableDecorator::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getImplementationId" ); @@ -113,7 +112,6 @@ Sequence< sal_Int8 > ODBTableDecorator::getImplementationId() throw (RuntimeExce } // OComponentHelper -//------------------------------------------------------------------------------ void SAL_CALL ODBTableDecorator::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::disposing" ); @@ -130,7 +128,7 @@ void SAL_CALL ODBTableDecorator::disposing() m_pColumns->disposing(); m_xColumnMediator = NULL; } -// ----------------------------------------------------------------------------- + sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, @@ -138,7 +136,6 @@ sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue( const Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::convertFastPropertyValue" ); sal_Bool bRet = sal_True; switch(nHandle) { @@ -152,25 +149,25 @@ sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue( case PROPERTY_ID_TEXTLINECOLOR: case PROPERTY_ID_TEXTEMPHASIS: case PROPERTY_ID_TEXTRELIEF: - case PROPERTY_ID_FONTCHARWIDTH: - case PROPERTY_ID_FONTCHARSET: - case PROPERTY_ID_FONTFAMILY: - case PROPERTY_ID_FONTHEIGHT: - case PROPERTY_ID_FONTKERNING: - case PROPERTY_ID_FONTNAME: - case PROPERTY_ID_FONTORIENTATION: - case PROPERTY_ID_FONTPITCH: - case PROPERTY_ID_FONTSLANT: - case PROPERTY_ID_FONTSTRIKEOUT: - case PROPERTY_ID_FONTSTYLENAME: - case PROPERTY_ID_FONTUNDERLINE: - case PROPERTY_ID_FONTWEIGHT: - case PROPERTY_ID_FONTWIDTH: + case PROPERTY_ID_FONTCHARWIDTH: + case PROPERTY_ID_FONTCHARSET: + case PROPERTY_ID_FONTFAMILY: + case PROPERTY_ID_FONTHEIGHT: + case PROPERTY_ID_FONTKERNING: + case PROPERTY_ID_FONTNAME: + case PROPERTY_ID_FONTORIENTATION: + case PROPERTY_ID_FONTPITCH: + case PROPERTY_ID_FONTSLANT: + case PROPERTY_ID_FONTSTRIKEOUT: + case PROPERTY_ID_FONTSTYLENAME: + case PROPERTY_ID_FONTUNDERLINE: + case PROPERTY_ID_FONTWEIGHT: + case PROPERTY_ID_FONTWIDTH: case PROPERTY_ID_FONTWORDLINEMODE: - case PROPERTY_ID_FONTTYPE: + case PROPERTY_ID_FONTTYPE: bRet = ODataSettings::convertFastPropertyValue(rConvertedValue, rOldValue,nHandle,rValue); break; - + default: { Any aValue; @@ -181,14 +178,14 @@ sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue( } return bRet; } -// ----------------------------------------------------------------------------- + void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (Exception) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::setFastPropertyValue_NoBroadcast" ); switch(_nHandle) { case PROPERTY_ID_PRIVILEGES: - OSL_ENSURE(0,"Property is readonly!"); + OSL_ENSURE(0,"Property is readonly!"); case PROPERTY_ID_FILTER: case PROPERTY_ID_ORDER: case PROPERTY_ID_APPLYFILTER: @@ -198,22 +195,22 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con case PROPERTY_ID_TEXTLINECOLOR: case PROPERTY_ID_TEXTEMPHASIS: case PROPERTY_ID_TEXTRELIEF: - case PROPERTY_ID_FONTCHARWIDTH: - case PROPERTY_ID_FONTCHARSET: - case PROPERTY_ID_FONTFAMILY: - case PROPERTY_ID_FONTHEIGHT: - case PROPERTY_ID_FONTKERNING: - case PROPERTY_ID_FONTNAME: - case PROPERTY_ID_FONTORIENTATION: - case PROPERTY_ID_FONTPITCH: - case PROPERTY_ID_FONTSLANT: - case PROPERTY_ID_FONTSTRIKEOUT: - case PROPERTY_ID_FONTSTYLENAME: - case PROPERTY_ID_FONTUNDERLINE: - case PROPERTY_ID_FONTWEIGHT: - case PROPERTY_ID_FONTWIDTH: + case PROPERTY_ID_FONTCHARWIDTH: + case PROPERTY_ID_FONTCHARSET: + case PROPERTY_ID_FONTFAMILY: + case PROPERTY_ID_FONTHEIGHT: + case PROPERTY_ID_FONTKERNING: + case PROPERTY_ID_FONTNAME: + case PROPERTY_ID_FONTORIENTATION: + case PROPERTY_ID_FONTPITCH: + case PROPERTY_ID_FONTSLANT: + case PROPERTY_ID_FONTSTRIKEOUT: + case PROPERTY_ID_FONTSTYLENAME: + case PROPERTY_ID_FONTUNDERLINE: + case PROPERTY_ID_FONTWEIGHT: + case PROPERTY_ID_FONTWIDTH: case PROPERTY_ID_FONTWORDLINEMODE: - case PROPERTY_ID_FONTTYPE: + case PROPERTY_ID_FONTTYPE: ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue); break; @@ -249,10 +246,10 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con break; } } -//------------------------------------------------------------------------------ + void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getFastPropertyValue" ); + switch(_nHandle) { case PROPERTY_ID_PRIVILEGES: @@ -268,7 +265,7 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c } } // run through - + case PROPERTY_ID_FILTER: case PROPERTY_ID_ORDER: case PROPERTY_ID_APPLYFILTER: @@ -278,22 +275,22 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c case PROPERTY_ID_TEXTLINECOLOR: case PROPERTY_ID_TEXTEMPHASIS: case PROPERTY_ID_TEXTRELIEF: - case PROPERTY_ID_FONTCHARWIDTH: - case PROPERTY_ID_FONTCHARSET: - case PROPERTY_ID_FONTFAMILY: - case PROPERTY_ID_FONTHEIGHT: - case PROPERTY_ID_FONTKERNING: - case PROPERTY_ID_FONTNAME: - case PROPERTY_ID_FONTORIENTATION: - case PROPERTY_ID_FONTPITCH: - case PROPERTY_ID_FONTSLANT: - case PROPERTY_ID_FONTSTRIKEOUT: - case PROPERTY_ID_FONTSTYLENAME: - case PROPERTY_ID_FONTUNDERLINE: - case PROPERTY_ID_FONTWEIGHT: - case PROPERTY_ID_FONTWIDTH: + case PROPERTY_ID_FONTCHARWIDTH: + case PROPERTY_ID_FONTCHARSET: + case PROPERTY_ID_FONTFAMILY: + case PROPERTY_ID_FONTHEIGHT: + case PROPERTY_ID_FONTKERNING: + case PROPERTY_ID_FONTNAME: + case PROPERTY_ID_FONTORIENTATION: + case PROPERTY_ID_FONTPITCH: + case PROPERTY_ID_FONTSLANT: + case PROPERTY_ID_FONTSTRIKEOUT: + case PROPERTY_ID_FONTSTYLENAME: + case PROPERTY_ID_FONTUNDERLINE: + case PROPERTY_ID_FONTWEIGHT: + case PROPERTY_ID_FONTWIDTH: case PROPERTY_ID_FONTWORDLINEMODE: - case PROPERTY_ID_FONTTYPE: + case PROPERTY_ID_FONTTYPE: ODataSettings::getFastPropertyValue(_rValue, _nHandle); break; case PROPERTY_ID_CATALOGNAME: @@ -330,7 +327,7 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c OSL_ENSURE(0,"Invalid Handle for table"); } } -// ------------------------------------------------------------------------- + void ODBTableDecorator::construct() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::construct" ); @@ -345,13 +342,12 @@ void ODBTableDecorator::construct() registerProperty(PROPERTY_PRIVILEGES, PROPERTY_ID_PRIVILEGES, PropertyAttribute::BOUND | PropertyAttribute::READONLY, &m_nPrivileges, ::getCppuType(static_cast(NULL))); } -// ----------------------------------------------------------------------------- + ::cppu::IPropertyArrayHelper* ODBTableDecorator::createArrayHelper(sal_Int32 /*_nId*/) const { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::createArrayHelper" ); Reference xProp(m_xTable,UNO_QUERY); Reference xInfo = xProp->getPropertySetInfo(); - + Sequence< Property > aTableProps = xInfo->getProperties(); Property* pIter = aTableProps.getArray(); Property* pEnd = pIter + aTableProps.getLength(); @@ -372,13 +368,12 @@ void ODBTableDecorator::construct() } describeProperties(aTableProps); - - return new ::cppu::OPropertyArrayHelper(aTableProps); + + return new ::cppu::OPropertyArrayHelper(aTableProps); } -// ----------------------------------------------------------------------------- -::cppu::IPropertyArrayHelper & SAL_CALL ODBTableDecorator::getInfoHelper() + +::cppu::IPropertyArrayHelper & SAL_CALL ODBTableDecorator::getInfoHelper() { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getInfoHelper" ); Reference xProp(m_xTable,UNO_QUERY); Reference xInfo = xProp->getPropertySetInfo(); @@ -394,39 +389,35 @@ void ODBTableDecorator::construct() // property set infos: Depending on the table for which we act as decorator, different property // sets might exist. } -// ------------------------------------------------------------------------- + // XServiceInfo IMPLEMENT_SERVICE_INFO1(ODBTableDecorator, "com.sun.star.sdb.dbaccess.ODBTableDecorator", SERVICE_SDBCX_TABLE) -// ------------------------------------------------------------------------- + Any SAL_CALL ODBTableDecorator::queryInterface( const Type & rType ) throw(RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::queryInterface" ); Any aRet; if(m_xTable.is()) { aRet = m_xTable->queryInterface(rType); - if(aRet.hasValue()) + if(aRet.hasValue()) { // now we know that our table supports this type so we return ourself aRet = OTableDescriptor_BASE::queryInterface(rType); if(!aRet.hasValue()) - aRet = ODataSettings::queryInterface(rType); + aRet = ODataSettings::queryInterface(rType); } } return aRet; } -// ------------------------------------------------------------------------- + Sequence< Type > SAL_CALL ODBTableDecorator::getTypes( ) throw(RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getTypes" ); Reference xTypes(m_xTable,UNO_QUERY); OSL_ENSURE(xTypes.is(),"Table must be a TypePropvider!"); return xTypes->getTypes(); } -// ----------------------------------------------------------------------------- // XRename, -//------------------------------------------------------------------------------ void SAL_CALL ODBTableDecorator::rename( const ::rtl::OUString& _rNewName ) throw(SQLException, ElementExistException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::rename" ); @@ -445,7 +436,6 @@ void SAL_CALL ODBTableDecorator::rename( const ::rtl::OUString& _rNewName ) thro } // XAlterTable, -//------------------------------------------------------------------------------ void SAL_CALL ODBTableDecorator::alterColumnByName( const ::rtl::OUString& _rName, const Reference< XPropertySet >& _rxDescriptor ) throw(SQLException, NoSuchElementException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::alterColumnByName" ); @@ -462,7 +452,6 @@ void SAL_CALL ODBTableDecorator::alterColumnByName( const ::rtl::OUString& _rNam m_pColumns->refresh(); } -//------------------------------------------------------------------------------ void SAL_CALL ODBTableDecorator::alterColumnByIndex( sal_Int32 _nIndex, const Reference< XPropertySet >& _rxDescriptor ) throw(SQLException, IndexOutOfBoundsException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::alterColumnByIndex" ); @@ -478,7 +467,7 @@ void SAL_CALL ODBTableDecorator::alterColumnByIndex( sal_Int32 _nIndex, const Re else // not supported throw SQLException(DBACORE_RESSTRING(RID_STR_COLUMN_ALTER_BY_INDEX),*this,SQLSTATE_GENERAL,1000,Any() ); } -// ----------------------------------------------------------------------------- + Reference< XNameAccess> ODBTableDecorator::getIndexes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getIndexes" ); @@ -486,7 +475,7 @@ Reference< XNameAccess> ODBTableDecorator::getIndexes() throw (RuntimeException) ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY)->getIndexes(); } -// ------------------------------------------------------------------------- + Reference< XIndexAccess> ODBTableDecorator::getKeys() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getKeys" ); @@ -494,7 +483,7 @@ Reference< XIndexAccess> ODBTableDecorator::getKeys() throw (RuntimeException) ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); return Reference< XKeysSupplier>(m_xTable,UNO_QUERY)->getKeys(); } -// ------------------------------------------------------------------------- + Reference< XNameAccess> ODBTableDecorator::getColumns() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getColumns" ); @@ -506,7 +495,7 @@ Reference< XNameAccess> ODBTableDecorator::getColumns() throw (RuntimeException) return m_pColumns; } -// ----------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL ODBTableDecorator::getName() throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getName" ); @@ -516,7 +505,7 @@ Reference< XNameAccess> ODBTableDecorator::getColumns() throw (RuntimeException) OSL_ENSURE(xName.is(),"Table should support the XNamed interface"); return xName->getName(); } -// ----------------------------------------------------------------------------- + sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getSomething" ); @@ -529,7 +518,7 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& nRet = xTunnel->getSomething(rId); return nRet; } -// ----------------------------------------------------------------------------- + Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelImplementationId() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getUnoTunnelImplementationId" ); @@ -545,7 +534,7 @@ Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelImplementationId() } return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- + void ODBTableDecorator::fillPrivileges() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::fillPrivileges" ); @@ -576,7 +565,7 @@ void ODBTableDecorator::fillPrivileges() const DBG_ERROR("ODBTableDecorator::ODBTableDecorator : could not collect the privileges !"); } } -// ----------------------------------------------------------------------------- + Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::createDataDescriptor" ); @@ -596,13 +585,13 @@ Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( ) t NULL ); } -// ----------------------------------------------------------------------------- + Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL ODBTableDecorator::getPropertySetInfo( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::getPropertySetInfo" ); return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()); } -// ----------------------------------------------------------------------------- + void ODBTableDecorator::refreshColumns() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::refreshColumns" ); @@ -610,7 +599,7 @@ void ODBTableDecorator::refreshColumns() ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); ::std::vector< ::rtl::OUString> aVector; - + Reference xNames; if(m_xTable.is()) { @@ -635,12 +624,12 @@ void ODBTableDecorator::refreshColumns() OContainerMediator* pMediator = new OContainerMediator( pCol, m_xColumnDefinitions, m_xConnection, OContainerMediator::eColumns ); m_xColumnMediator = pMediator; pCol->setMediator( pMediator ); - m_pColumns = pCol; + m_pColumns = pCol; } else m_pColumns->reFill(aVector); } -// ----------------------------------------------------------------------------- + OColumn* ODBTableDecorator::createColumn(const ::rtl::OUString& _rName) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::createColumn" ); @@ -664,13 +653,13 @@ OColumn* ODBTableDecorator::createColumn(const ::rtl::OUString& _rName) const } return pReturn; } -// ----------------------------------------------------------------------------- + void ODBTableDecorator::columnAppended( const Reference< XPropertySet >& /*_rxSourceDescriptor*/ ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::columnAppended" ); // not interested in } -// ----------------------------------------------------------------------------- + void ODBTableDecorator::columnDropped(const ::rtl::OUString& _sName) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::columnDropped" ); @@ -679,7 +668,6 @@ void ODBTableDecorator::columnDropped(const ::rtl::OUString& _sName) xDrop->dropByName(_sName); } -// ----------------------------------------------------------------------------- Reference< XPropertySet > ODBTableDecorator::createColumnDescriptor() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::createColumnDescriptor" ); @@ -691,24 +679,19 @@ Reference< XPropertySet > ODBTableDecorator::createColumnDescriptor() xRet = new OTableColumnDescriptorWrapper( xNames->createDataDescriptor(), false, true ); return xRet; } -// ----------------------------------------------------------------------------- + void SAL_CALL ODBTableDecorator::acquire() throw() { OTableDescriptor_BASE::acquire(); } -// ----------------------------------------------------------------------------- + void SAL_CALL ODBTableDecorator::release() throw() { OTableDescriptor_BASE::release(); } -// ----------------------------------------------------------------------------- void SAL_CALL ODBTableDecorator::setName( const ::rtl::OUString& /*aName*/ ) throw (::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::setName" ); throwFunctionNotSupportedException( "XNamed::setName", *this ); } - -// ----------------------------------------------------------------------------- - - diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index 3644c4f..0c99fee 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -78,7 +78,6 @@ namespace dbaccess //==================================================================== //= View //==================================================================== - //-------------------------------------------------------------------- View::View( const Reference< XConnection >& _rxConnection, sal_Bool _bCaseSensitive, const ::rtl::OUString& _rCatalogName,const ::rtl::OUString& _rSchemaName, const ::rtl::OUString& _rName ) :View_Base( _bCaseSensitive, _rName, _rxConnection->getMetaData(), 0, ::rtl::OUString(), _rSchemaName, _rCatalogName ) @@ -96,15 +95,13 @@ namespace dbaccess } } - //-------------------------------------------------------------------- View::~View() { } - //-------------------------------------------------------------------- IMPLEMENT_FORWARD_REFCOUNT( View, View_Base ) IMPLEMENT_GET_IMPLEMENTATION_ID( View ) - // ------------------------------------------------------------------------- + Any SAL_CALL View::queryInterface( const Type & _rType ) throw(RuntimeException) { if(_rType == getCppuType( (Reference*)0) && !m_xViewAccess.is() ) @@ -114,14 +111,14 @@ namespace dbaccess aReturn = View_IBASE::queryInterface( _rType ); return aReturn; } - // ------------------------------------------------------------------------- + Sequence< Type > SAL_CALL View::getTypes( ) throw(RuntimeException) { Type aAlterType = getCppuType( (Reference*)0); Sequence< Type > aTypes( ::comphelper::concatSequences(View_Base::getTypes(),View_IBASE::getTypes()) ); ::std::vector aOwnTypes; - aOwnTypes.reserve(aTypes.getLength()); + aOwnTypes.reserve(aTypes.getLength()); const Type* pIter = aTypes.getConstArray(); const Type* pEnd = pIter + aTypes.getLength(); @@ -130,19 +127,17 @@ namespace dbaccess if( (*pIter != aAlterType || m_xViewAccess.is()) ) aOwnTypes.push_back(*pIter); } - + Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0]; return Sequence< Type >(pTypes, aOwnTypes.size()); } - //-------------------------------------------------------------------- void SAL_CALL View::alterCommand( const ::rtl::OUString& _rNewCommand ) throw (SQLException, RuntimeException) { OSL_ENSURE(m_xViewAccess.is(),"Illegal call to AlterView!"); m_xViewAccess->alterCommand(this,_rNewCommand); } - //-------------------------------------------------------------------- void SAL_CALL View::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { if ( _nHandle == m_nCommandHandle && m_xViewAccess.is() ) @@ -155,7 +150,5 @@ namespace dbaccess View_Base::getFastPropertyValue( _rValue, _nHandle ); } - // ----------------------------------------------------------------------------- -//........................................................................ + } // namespace dbaccess -//........................................................................ diff --git a/dbaccess/source/core/api/WrappedResultSet.cxx b/dbaccess/source/core/api/WrappedResultSet.cxx index 0b9c6b6..a47aecc 100644 --- a/dbaccess/source/core/api/WrappedResultSet.cxx +++ b/dbaccess/source/core/api/WrappedResultSet.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -60,7 +60,7 @@ void WrappedResultSet::construct(const Reference< XResultSet>& _xDriverSet,const m_xRowLocate.set(_xDriverSet,UNO_QUERY_THROW); m_xUpdRow.set(_xDriverSet,UNO_QUERY_THROW); } -// ----------------------------------------------------------------------------- + Any SAL_CALL WrappedResultSet::getBookmark() throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::getBookmark" ); @@ -70,37 +70,37 @@ Any SAL_CALL WrappedResultSet::getBookmark() throw(SQLException, RuntimeExceptio } return makeAny(m_xDriverSet->getRow()); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL WrappedResultSet::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::moveToBookmark" ); return m_xRowLocate->moveToBookmark( bookmark ); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL WrappedResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::moveRelativeToBookmark" ); return m_xRowLocate->moveRelativeToBookmark( bookmark,rows ); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL WrappedResultSet::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::compareBookmarks" ); return m_xRowLocate->compareBookmarks( _first,_second ); } -// ------------------------------------------------------------------------- + sal_Bool SAL_CALL WrappedResultSet::hasOrderedBookmarks( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::hasOrderedBookmarks" ); return m_xRowLocate->hasOrderedBookmarks(); } -// ------------------------------------------------------------------------- + sal_Int32 SAL_CALL WrappedResultSet::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::hashBookmark" ); return m_xRowLocate->hashBookmark(bookmark); } -// ------------------------------------------------------------------------- + // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL WrappedResultSet::deleteRows( const Sequence< Any >& rows ,const connectivity::OSQLTable& /*_xTable*/) throw(SQLException, RuntimeException) { @@ -112,7 +112,7 @@ Sequence< sal_Int32 > SAL_CALL WrappedResultSet::deleteRows( const Sequence< Any } return Sequence< sal_Int32 >(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::insertRow" ); @@ -128,7 +128,7 @@ void SAL_CALL WrappedResultSet::insertRow( const ORowSetRow& _rInsertRow,const c m_xUpd->insertRow(); (*_rInsertRow->get().begin()) = getBookmark(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::updateRow" ); @@ -142,37 +142,37 @@ void SAL_CALL WrappedResultSet::updateRow(const ORowSetRow& _rInsertRow ,const O } m_xUpd->updateRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::deleteRow(const ORowSetRow& /*_rDeleteRow*/ ,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::deleteRow" ); m_xUpd->deleteRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::cancelRowUpdates" ); m_xUpd->cancelRowUpdates(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::moveToInsertRow" ); m_xUpd->moveToInsertRow(); } -// ------------------------------------------------------------------------- + void SAL_CALL WrappedResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::moveToCurrentRow" ); m_xUpd->moveToCurrentRow(); } -// ------------------------------------------------------------------------- + void WrappedResultSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::fillValueRow" ); OCacheSet::fillValueRow(_rRow,_nPosition); } -// ------------------------------------------------------------------------- + void WrappedResultSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParameter,const ORowSetValue& _rValue) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "WrappedResultSet::updateColumn" ); @@ -252,4 +252,3 @@ void WrappedResultSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xPar } } } - diff --git a/dbaccess/source/core/api/WrappedResultSet.hxx b/dbaccess/source/core/api/WrappedResultSet.hxx index df43530..1bba377 100644 --- a/dbaccess/source/core/api/WrappedResultSet.hxx +++ b/dbaccess/source/core/api/WrappedResultSet.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/dbaccess/source/core/api/callablestatement.cxx b/dbaccess/source/core/api/callablestatement.cxx index b55f25a..9ea9dfd 100644 --- a/dbaccess/source/core/api/callablestatement.cxx +++ b/dbaccess/source/core/api/callablestatement.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,6 @@ using namespace ::cppu; using namespace ::osl; // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OCallableStatement::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getTypes" ); @@ -56,7 +55,6 @@ Sequence< Type > OCallableStatement::getTypes() throw (RuntimeException) return aTypes.getTypes(); } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > OCallableStatement::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getImplementationId" ); @@ -74,7 +72,6 @@ Sequence< sal_Int8 > OCallableStatement::getImplementationId() throw (RuntimeExc } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any OCallableStatement::queryInterface( const Type & rType ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::queryInterface" ); @@ -87,27 +84,23 @@ Any OCallableStatement::queryInterface( const Type & rType ) throw (RuntimeExcep return aIface; } -//-------------------------------------------------------------------------- void OCallableStatement::acquire() throw () { OPreparedStatement::acquire(); } -//-------------------------------------------------------------------------- void OCallableStatement::release() throw () { OPreparedStatement::release(); } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OCallableStatement::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getImplementationName" ); return rtl::OUString::createFromAscii("com.sun.star.sdb.OCallableStatement"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OCallableStatement::getSupportedServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getSupportedServiceNames" ); @@ -118,19 +111,16 @@ Sequence< ::rtl::OUString > OCallableStatement::getSupportedServiceNames( ) thr } // XOutParameters -//------------------------------------------------------------------------------ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::registerOutParameter" ); MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); - Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY)->registerOutParameter( parameterIndex, sqlType, typeName ); } -//------------------------------------------------------------------------------ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::registerNumericOutParameter" ); @@ -141,7 +131,6 @@ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 paramet } // XRow -//------------------------------------------------------------------------------ sal_Bool SAL_CALL OCallableStatement::wasNull( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::wasNull" ); @@ -151,7 +140,6 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( ) throw(SQLException, RuntimeExc return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->wasNull(); } -//------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getString" ); @@ -161,7 +149,6 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( ) throw(SQLException, RuntimeExc return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getString( columnIndex ); } -//------------------------------------------------------------------------------ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getBoolean" ); @@ -171,7 +158,6 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) throw( return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBoolean( columnIndex ); } -//------------------------------------------------------------------------------ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getByte" ); @@ -181,7 +167,6 @@ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) throw(SQL return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getByte( columnIndex ); } -//------------------------------------------------------------------------------ sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getShort" ); @@ -190,7 +175,6 @@ sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex ) throw(S return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getShort( columnIndex ); } -//------------------------------------------------------------------------------ sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getInt" ); @@ -199,7 +183,6 @@ sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex ) throw(SQL return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getInt( columnIndex ); } -//------------------------------------------------------------------------------ sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getLong" ); @@ -208,7 +191,6 @@ sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex ) throw(SQ return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getLong( columnIndex ); } -//------------------------------------------------------------------------------ float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getFloat" ); @@ -217,7 +199,6 @@ float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex ) throw(SQLEx return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getFloat( columnIndex ); } -//------------------------------------------------------------------------------ double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getDouble" ); @@ -226,7 +207,6 @@ double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex ) throw(SQL return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDouble( columnIndex ); } -//------------------------------------------------------------------------------ Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getBytes" ); @@ -235,7 +215,6 @@ Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnInde return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBytes( columnIndex ); } -//------------------------------------------------------------------------------ ::com::sun::star::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getDate" ); @@ -244,7 +223,6 @@ Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnInde return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDate( columnIndex ); } -//------------------------------------------------------------------------------ ::com::sun::star::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getTime" ); @@ -253,7 +231,6 @@ Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnInde return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTime( columnIndex ); } -//------------------------------------------------------------------------------ ::com::sun::star::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getTimestamp" ); @@ -263,7 +240,6 @@ Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnInde return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTimestamp( columnIndex ); } -//------------------------------------------------------------------------------ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getBinaryStream" ); @@ -273,7 +249,6 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::get return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBinaryStream( columnIndex ); } -//------------------------------------------------------------------------------ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getCharacterStream" ); @@ -283,7 +258,6 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL OCallableStatement::get return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getCharacterStream( columnIndex ); } -//------------------------------------------------------------------------------ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getObject" ); @@ -293,7 +267,6 @@ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Referen return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getObject( columnIndex, typeMap ); } -//------------------------------------------------------------------------------ Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getRef" ); @@ -302,7 +275,6 @@ Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex ) t return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getRef( columnIndex ); } -//------------------------------------------------------------------------------ Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getBlob" ); @@ -311,7 +283,6 @@ Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex ) return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBlob( columnIndex ); } -//------------------------------------------------------------------------------ Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getClob" ); @@ -320,7 +291,6 @@ Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex ) return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getClob( columnIndex ); } -//------------------------------------------------------------------------------ Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCallableStatement::getArray" ); diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx index 43412bb..717264d 100644 --- a/dbaccess/source/core/api/column.cxx +++ b/dbaccess/source/core/api/column.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -77,7 +77,6 @@ DBG_NAME(OColumn) //============================================================ //= OColumn //============================================================ -//-------------------------------------------------------------------------- OColumn::OColumn( const bool _bNameIsReadOnly ) :OColumnBase( m_aMutex ) ,::comphelper::OPropertyContainer( OColumnBase::rBHelper ) @@ -88,14 +87,12 @@ OColumn::OColumn( const bool _bNameIsReadOnly ) &m_sName, ::getCppuType( &m_sName ) ); } -//-------------------------------------------------------------------------- OColumn::~OColumn() { DBG_DTOR(OColumn, NULL); } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OColumn::getTypes() throw (RuntimeException) { return ::comphelper::concatSequences( @@ -108,19 +105,16 @@ Sequence< Type > OColumn::getTypes() throw (RuntimeException) IMPLEMENT_FORWARD_XINTERFACE2( OColumn, OColumnBase, ::comphelper::OPropertyContainer ) // ::com::sun::star::lang::XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OColumn::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OColumn"); } -//------------------------------------------------------------------------------ sal_Bool OColumn::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OColumn::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 1 ); @@ -129,49 +123,42 @@ Sequence< ::rtl::OUString > OColumn::getSupportedServiceNames( ) throw (Runtime } // OComponentHelper -//------------------------------------------------------------------------------ void OColumn::disposing() { OPropertyContainer::disposing(); } // com::sun::star::beans::XPropertySet -//------------------------------------------------------------------------------ Reference< XPropertySetInfo > OColumn::getPropertySetInfo() throw (RuntimeException) { return createPropertySetInfo( getInfoHelper() ) ; } -// ----------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OColumn::getName( ) throw(::com::sun::star::uno::RuntimeException) { return m_sName; } -// ----------------------------------------------------------------------------- + void SAL_CALL OColumn::setName( const ::rtl::OUString& _rName ) throw(::com::sun::star::uno::RuntimeException) { m_sName = _rName; } -// ----------------------------------------------------------------------------- void OColumn::fireValueChange(const ::connectivity::ORowSetValue& /*_rOldValue*/) { DBG_ERROR( "OColumn::fireValueChange: not implemented!" ); } -//------------------------------------------------------------------------------ void OColumn::registerProperty( const ::rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void* _pPointerToMember, const Type& _rMemberType ) { ::comphelper::OPropertyContainer::registerProperty( _rName, _nHandle, _nAttributes, _pPointerToMember, _rMemberType ); } -//------------------------------------------------------------------------------ void OColumn::registerMayBeVoidProperty( const ::rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, Any* _pPointerToMember, const Type& _rExpectedType ) { ::comphelper::OPropertyContainer::registerMayBeVoidProperty( _rName, _nHandle, _nAttributes, _pPointerToMember, _rExpectedType ); } -//------------------------------------------------------------------------------ void OColumn::registerPropertyNoMember( const ::rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, const Type& _rType, const void* _pInitialValue ) { ::comphelper::OPropertyContainer::registerPropertyNoMember( _rName, _nHandle, _nAttributes, _rType, _pInitialValue ); @@ -182,7 +169,6 @@ void OColumn::registerPropertyNoMember( const ::rtl::OUString& _rName, sal_Int32 //============================================================ DBG_NAME(OColumns); -//-------------------------------------------------------------------------- OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, sal_Bool _bCaseSensitive,const ::std::vector< ::rtl::OUString> &_rVector, @@ -203,7 +189,6 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, DBG_CTOR(OColumns, NULL); } -// ------------------------------------------------------------------------- OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxDrvColumns, sal_Bool _bCaseSensitive,const ::std::vector< ::rtl::OUString> &_rVector, @@ -223,26 +208,23 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, { DBG_CTOR(OColumns, NULL); } -//-------------------------------------------------------------------------- + OColumns::~OColumns() { DBG_DTOR(OColumns, NULL); } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OColumns::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OColumns"); } -//------------------------------------------------------------------------------ sal_Bool OColumns::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OColumns::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 1 ); @@ -271,7 +253,6 @@ void OColumns::clearColumns() disposing(); } -// ----------------------------------------------------------------------------- void SAL_CALL OColumns::disposing(void) { MutexGuard aGuard(m_rMutex); @@ -281,14 +262,12 @@ void SAL_CALL OColumns::disposing(void) OColumns_BASE::disposing(); } -// ------------------------------------------------------------------------- void OColumns::impl_refresh() throw(::com::sun::star::uno::RuntimeException) { if (m_pRefreshColumns) m_pRefreshColumns->refreshColumns(); } -// ------------------------------------------------------------------------- connectivity::sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) { OSL_ENSURE(m_pColFactoryImpl, "OColumns::createObject: no column factory!"); @@ -308,7 +287,7 @@ connectivity::sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _r return xRet; } -// ------------------------------------------------------------------------- + Reference< XPropertySet > OColumns::createDescriptor() { if ( m_pColFactoryImpl ) @@ -322,16 +301,16 @@ Reference< XPropertySet > OColumns::createDescriptor() else return Reference< XPropertySet >(); } -// ------------------------------------------------------------------------- + Any SAL_CALL OColumns::queryInterface( const Type & rType ) throw(RuntimeException) { Any aRet; if(m_xDrvColumns.is()) { aRet = m_xDrvColumns->queryInterface(rType); - if ( aRet.hasValue() ) + if ( aRet.hasValue() ) aRet = OColumns_BASE::queryInterface( rType); - if ( !aRet.hasValue() ) + if ( !aRet.hasValue() ) aRet = TXChild::queryInterface( rType); return aRet; } @@ -344,11 +323,11 @@ Any SAL_CALL OColumns::queryInterface( const Type & rType ) throw(RuntimeExcepti } aRet = OColumns_BASE::queryInterface( rType); - if ( !aRet.hasValue() ) + if ( !aRet.hasValue() ) aRet = TXChild::queryInterface( rType); return aRet; } -// ------------------------------------------------------------------------- + Sequence< Type > SAL_CALL OColumns::getTypes( ) throw(RuntimeException) { sal_Bool bAppendFound = sal_False,bDropFound = sal_False; @@ -399,7 +378,7 @@ Sequence< Type > SAL_CALL OColumns::getTypes( ) throw(RuntimeException) } return aRet; } -// ------------------------------------------------------------------------- + // XAppend sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { @@ -437,7 +416,7 @@ sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString& _rForName, cons return xReturn; } -// ------------------------------------------------------------------------- + // XDrop void OColumns::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) { @@ -465,17 +444,15 @@ void OColumns::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) ::dbaccess::notifyDataSourceModified(m_xParent,sal_True); } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OColumns::getParent( ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_rMutex); return m_xParent; } -// ----------------------------------------------------------------------------- + void SAL_CALL OColumns::setParent( const Reference< XInterface >& _xParent ) throw (NoSupportException, RuntimeException) { ::osl::MutexGuard aGuard(m_rMutex); m_xParent = _xParent; } -// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx index 58252b7..8356070 100644 --- a/dbaccess/source/core/api/columnsettings.cxx +++ b/dbaccess/source/core/api/columnsettings.cxx @@ -1,6 +1,6 @@ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -67,20 +67,18 @@ namespace dbaccess //= OColumnSettings //============================================================================== DBG_NAME( OColumnSettings ) - //------------------------------------------------------------------------------ + OColumnSettings::OColumnSettings() :m_bHidden(sal_False) { DBG_CTOR( OColumnSettings, NULL ); } - //------------------------------------------------------------------------------ OColumnSettings::~OColumnSettings() { DBG_DTOR( OColumnSettings, NULL ); } - //------------------------------------------------------------------------------ void OColumnSettings::registerProperties( IPropertyContainer& _rPropertyContainer ) { const sal_Int32 nBoundAttr = PropertyAttribute::BOUND; @@ -99,7 +97,6 @@ namespace dbaccess _rPropertyContainer.registerProperty( PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN, nBoundAttr, &m_bHidden, ::getCppuType( &m_bHidden ) ); } - //------------------------------------------------------------------------------ bool OColumnSettings::isColumnSettingProperty( const sal_Int32 _nPropertyHandle ) { return ( _nPropertyHandle == PROPERTY_ID_ALIGN ) @@ -112,7 +109,6 @@ namespace dbaccess || ( _nPropertyHandle == PROPERTY_ID_HIDDEN ); } - //------------------------------------------------------------------------------ bool OColumnSettings::isDefaulted( const sal_Int32 _nPropertyHandle, const Any& _rPropertyValue ) { switch ( _nPropertyHandle ) @@ -139,7 +135,6 @@ namespace dbaccess return sal_False; } - //------------------------------------------------------------------------------ bool OColumnSettings::hasDefaultSettings( const Reference< XPropertySet >& _rxColumn ) { ENSURE_OR_THROW( _rxColumn.is(), "illegal column" ); diff --git a/dbaccess/source/core/api/datacolumn.cxx b/dbaccess/source/core/api/datacolumn.cxx index 791bd7c..18c62cf 100644 --- a/dbaccess/source/core/api/datacolumn.cxx +++ b/dbaccess/source/core/api/datacolumn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ using namespace ::comphelper; using namespace ::cppu; DBG_NAME(ODataColumn) -//-------------------------------------------------------------------------- + ODataColumn::ODataColumn( const Reference < XResultSetMetaData >& _xMetaData, const Reference < XRow >& _xRow, @@ -62,14 +62,13 @@ ODataColumn::ODataColumn( { DBG_CTOR(ODataColumn,NULL); } -// ----------------------------------------------------------------------------- + ODataColumn::~ODataColumn() { DBG_DTOR(ODataColumn,NULL); } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > ODataColumn::getTypes() throw (RuntimeException) { OTypeCollection aTypes(::getCppuType( (const Reference< XColumn > *)0 ), @@ -78,7 +77,6 @@ Sequence< Type > ODataColumn::getTypes() throw (RuntimeException) return aTypes.getTypes(); } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > ODataColumn::getImplementationId() throw (RuntimeException) { static OImplementationId * pId = 0; @@ -94,7 +92,6 @@ Sequence< sal_Int8 > ODataColumn::getImplementationId() throw (RuntimeException) return pId->getImplementationId(); } -//------------------------------------------------------------------------------ Any SAL_CALL ODataColumn::queryInterface( const Type & _rType ) throw (RuntimeException) { Any aReturn = OResultColumn::queryInterface(_rType); @@ -107,13 +104,11 @@ Any SAL_CALL ODataColumn::queryInterface( const Type & _rType ) throw (RuntimeEx } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString ODataColumn::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.ODataColumn"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ODataColumn::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 3 ); @@ -124,7 +119,6 @@ Sequence< ::rtl::OUString > ODataColumn::getSupportedServiceNames( ) throw (Run } // OComponentHelper -//------------------------------------------------------------------------------ void ODataColumn::disposing() { OResultColumn::disposing(); @@ -134,16 +128,14 @@ void ODataColumn::disposing() } // ::com::sun::star::sdb::XColumn -//------------------------------------------------------------------------------ sal_Bool ODataColumn::wasNull(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(!m_xRow.is()); - + return m_xRow->wasNull(); } -//------------------------------------------------------------------------------ rtl::OUString ODataColumn::getString(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -152,7 +144,6 @@ rtl::OUString ODataColumn::getString(void) throw( SQLException, RuntimeException return m_xRow->getString(m_nPos); } -//------------------------------------------------------------------------------ sal_Bool ODataColumn::getBoolean(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -161,7 +152,6 @@ sal_Bool ODataColumn::getBoolean(void) throw( SQLException, RuntimeException ) return m_xRow->getBoolean(m_nPos); } -//------------------------------------------------------------------------------ sal_Int8 ODataColumn::getByte(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -170,7 +160,6 @@ sal_Int8 ODataColumn::getByte(void) throw( SQLException, RuntimeException ) return m_xRow->getByte(m_nPos); } -//------------------------------------------------------------------------------ sal_Int16 ODataColumn::getShort(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -179,7 +168,6 @@ sal_Int16 ODataColumn::getShort(void) throw( SQLException, RuntimeException ) return m_xRow->getShort(m_nPos); } -//------------------------------------------------------------------------------ sal_Int32 ODataColumn::getInt(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -188,7 +176,6 @@ sal_Int32 ODataColumn::getInt(void) throw( SQLException, RuntimeException ) return m_xRow->getInt(m_nPos); } -//------------------------------------------------------------------------------ sal_Int64 ODataColumn::getLong(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -197,7 +184,6 @@ sal_Int64 ODataColumn::getLong(void) throw( SQLException, RuntimeException ) return m_xRow->getLong(m_nPos); } -//------------------------------------------------------------------------------ float ODataColumn::getFloat(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -205,7 +191,7 @@ float ODataColumn::getFloat(void) throw( SQLException, RuntimeException ) return m_xRow->getFloat(m_nPos); } -//------------------------------------------------------------------------------ + double ODataColumn::getDouble(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -214,7 +200,6 @@ double ODataColumn::getDouble(void) throw( SQLException, RuntimeException ) return m_xRow->getDouble(m_nPos); } -//------------------------------------------------------------------------------ Sequence< sal_Int8 > ODataColumn::getBytes(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -222,7 +207,7 @@ Sequence< sal_Int8 > ODataColumn::getBytes(void) throw( SQLException, RuntimeExc return m_xRow->getBytes(m_nPos); } -//------------------------------------------------------------------------------ + com::sun::star::util::Date ODataColumn::getDate(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -231,7 +216,6 @@ com::sun::star::util::Date ODataColumn::getDate(void) throw( SQLException, Runti return m_xRow->getDate(m_nPos); } -//------------------------------------------------------------------------------ com::sun::star::util::Time ODataColumn::getTime(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -239,7 +223,7 @@ com::sun::star::util::Time ODataColumn::getTime(void) throw( SQLException, Runti return m_xRow->getTime(m_nPos); } -//------------------------------------------------------------------------------ + com::sun::star::util::DateTime ODataColumn::getTimestamp(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -248,7 +232,6 @@ com::sun::star::util::DateTime ODataColumn::getTimestamp(void) throw( SQLExcepti return m_xRow->getTimestamp(m_nPos); } -//------------------------------------------------------------------------------ Reference< ::com::sun::star::io::XInputStream > ODataColumn::getBinaryStream(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -257,7 +240,6 @@ Reference< ::com::sun::star::io::XInputStream > ODataColumn::getBinaryStream(vo return m_xRow->getBinaryStream(m_nPos); } -//------------------------------------------------------------------------------ Reference< ::com::sun::star::io::XInputStream > ODataColumn::getCharacterStream(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -266,7 +248,6 @@ Reference< ::com::sun::star::io::XInputStream > ODataColumn::getCharacterStream return m_xRow->getCharacterStream(m_nPos); } -//------------------------------------------------------------------------------ Any ODataColumn::getObject(const Reference< ::com::sun::star::container::XNameAccess > & typeMap) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -275,7 +256,6 @@ Any ODataColumn::getObject(const Reference< ::com::sun::star::container::XNameAc return m_xRow->getObject(m_nPos, typeMap); } -//------------------------------------------------------------------------------ Reference< XRef > ODataColumn::getRef(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -284,7 +264,6 @@ Reference< XRef > ODataColumn::getRef(void) throw( SQLException, RuntimeExcepti return m_xRow->getRef(m_nPos); } -//------------------------------------------------------------------------------ Reference< XBlob > ODataColumn::getBlob(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -293,7 +272,6 @@ Reference< XBlob > ODataColumn::getBlob(void) throw( SQLException, RuntimeExcep return m_xRow->getBlob(m_nPos); } -//------------------------------------------------------------------------------ Reference< XClob > ODataColumn::getClob(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -302,7 +280,6 @@ Reference< XClob > ODataColumn::getClob(void) throw( SQLException, RuntimeExcep return m_xRow->getClob(m_nPos); } -//------------------------------------------------------------------------------ Reference< XArray > ODataColumn::getArray(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -312,7 +289,6 @@ Reference< XArray > ODataColumn::getArray(void) throw( SQLException, RuntimeExc } // ::com::sun::star::sdb::XColumnUpdate -//------------------------------------------------------------------------------ void ODataColumn::updateNull(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -321,7 +297,6 @@ void ODataColumn::updateNull(void) throw( SQLException, RuntimeException ) m_xRowUpdate->updateNull(m_nPos); } -//------------------------------------------------------------------------------ void ODataColumn::updateBoolean(sal_Bool x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -330,7 +305,6 @@ void ODataColumn::updateBoolean(sal_Bool x) throw( SQLException, RuntimeExceptio m_xRowUpdate->updateBoolean(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateByte(sal_Int8 x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -339,7 +313,6 @@ void ODataColumn::updateByte(sal_Int8 x) throw( SQLException, RuntimeException ) m_xRowUpdate->updateByte(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateShort(sal_Int16 x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -348,7 +321,6 @@ void ODataColumn::updateShort(sal_Int16 x) throw( SQLException, RuntimeException m_xRowUpdate->updateShort(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateInt(sal_Int32 x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -357,7 +329,6 @@ void ODataColumn::updateInt(sal_Int32 x) throw( SQLException, RuntimeException ) m_xRowUpdate->updateInt(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateLong(sal_Int64 x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -366,7 +337,6 @@ void ODataColumn::updateLong(sal_Int64 x) throw( SQLException, RuntimeException m_xRowUpdate->updateLong(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateFloat(float x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -375,7 +345,6 @@ void ODataColumn::updateFloat(float x) throw( SQLException, RuntimeException ) m_xRowUpdate->updateFloat(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateDouble(double x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -384,7 +353,6 @@ void ODataColumn::updateDouble(double x) throw( SQLException, RuntimeException ) m_xRowUpdate->updateDouble(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateString(const rtl::OUString& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -393,7 +361,6 @@ void ODataColumn::updateString(const rtl::OUString& x) throw( SQLException, Runt m_xRowUpdate->updateString(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateBytes(const Sequence< sal_Int8 >& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -402,7 +369,6 @@ void ODataColumn::updateBytes(const Sequence< sal_Int8 >& x) throw( SQLException m_xRowUpdate->updateBytes(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateDate(const com::sun::star::util::Date& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -411,7 +377,6 @@ void ODataColumn::updateDate(const com::sun::star::util::Date& x) throw( SQLExce m_xRowUpdate->updateDate(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateTime(const ::com::sun::star::util::Time& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -420,7 +385,6 @@ void ODataColumn::updateTime(const ::com::sun::star::util::Time& x) throw( SQLEx m_xRowUpdate->updateTime(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateTimestamp(const ::com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -429,7 +393,6 @@ void ODataColumn::updateTimestamp(const ::com::sun::star::util::DateTime& x) thr m_xRowUpdate->updateTimestamp(m_nPos, x); } -//------------------------------------------------------------------------------ void ODataColumn::updateCharacterStream(const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -438,7 +401,6 @@ void ODataColumn::updateCharacterStream(const Reference< ::com::sun::star::io::X m_xRowUpdate->updateCharacterStream(m_nPos, x, length); } -//------------------------------------------------------------------------------ void ODataColumn::updateBinaryStream(const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -447,7 +409,6 @@ void ODataColumn::updateBinaryStream(const Reference< ::com::sun::star::io::XInp m_xRowUpdate->updateBinaryStream(m_nPos, x, length); } -//------------------------------------------------------------------------------ void ODataColumn::updateNumericObject(const Any& x, sal_Int32 scale) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); @@ -456,12 +417,10 @@ void ODataColumn::updateNumericObject(const Any& x, sal_Int32 scale) throw( SQLE m_xRowUpdate->updateNumericObject(m_nPos, x, scale); } -//------------------------------------------------------------------------------ void ODataColumn::updateObject(const Any& x) throw( SQLException, RuntimeException ) { MutexGuard aGuard( m_aMutex ); ::connectivity::checkDisposed(!m_xRowUpdate.is()); - + m_xRowUpdate->updateObject(m_nPos, x); } - diff --git a/dbaccess/source/core/api/datacolumn.hxx b/dbaccess/source/core/api/datacolumn.hxx index 6e772a5..c4a1324 100644 --- a/dbaccess/source/core/api/datacolumn.hxx +++ b/dbaccess/source/core/api/datacolumn.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/datasettings.cxx b/dbaccess/source/core/api/datasettings.cxx index 9bfd696..f7c9e0b 100644 --- a/dbaccess/source/core/api/datasettings.cxx +++ b/dbaccess/source/core/api/datasettings.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,13 +50,11 @@ using namespace ::com::sun::star::beans; using namespace ::comphelper; using namespace ::cppu; -//........................................................................ namespace dbaccess { //========================================================================== //= ODataSettings //========================================================================== -//-------------------------------------------------------------------------- void ODataSettings::registerPropertiesFor(ODataSettings_Base* _pItem) { if ( m_bQuery ) @@ -112,7 +110,6 @@ void ODataSettings::registerPropertiesFor(ODataSettings_Base* _pItem) registerProperty(PROPERTY_FONTTYPE, PROPERTY_ID_FONTTYPE, PropertyAttribute::BOUND,&_pItem->m_aFont.Type, ::getCppuType(&_pItem->m_aFont.Type)); } -//-------------------------------------------------------------------------- ODataSettings::ODataSettings(OBroadcastHelper& _rBHelper,sal_Bool _bQuery) :OPropertyStateContainer(_rBHelper) ,ODataSettings_Base() @@ -120,7 +117,6 @@ ODataSettings::ODataSettings(OBroadcastHelper& _rBHelper,sal_Bool _bQuery) { } -//-------------------------------------------------------------------------- ODataSettings_Base::ODataSettings_Base() :m_bApplyFilter(sal_False) ,m_aFont(::comphelper::getDefaultFont()) @@ -129,7 +125,6 @@ ODataSettings_Base::ODataSettings_Base() { } -//-------------------------------------------------------------------------- ODataSettings_Base::ODataSettings_Base(const ODataSettings_Base& _rSource) :m_sFilter( _rSource.m_sFilter ) ,m_sHavingClause( _rSource.m_sHavingClause ) @@ -145,12 +140,10 @@ ODataSettings_Base::ODataSettings_Base(const ODataSettings_Base& _rSource) { } -// ----------------------------------------------------------------------------- ODataSettings_Base::~ODataSettings_Base() { } -// ----------------------------------------------------------------------------- void ODataSettings::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) const { static ::com::sun::star::awt::FontDescriptor aFD = ::comphelper::getDefaultFont(); @@ -202,7 +195,7 @@ void ODataSettings::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefau _rDefault <<= aFD.Weight; break; case PROPERTY_ID_FONTSLANT: - _rDefault <<= aFD.Slant; + _rDefault <<= aFD.Slant; break; case PROPERTY_ID_FONTUNDERLINE: _rDefault <<= aFD.Underline; @@ -224,7 +217,5 @@ void ODataSettings::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefau break; } } -//........................................................................ -} // namespace dbaccess -//........................................................................ +} // namespace dbaccess diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index 2a0f263..bc1e578 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -67,7 +67,6 @@ using namespace dbaccess; //============================================================ IMPLEMENT_FORWARD_XINTERFACE2(OTableColumnDescriptor,OColumn,TXChild) -//------------------------------------------------------------------------------ void OTableColumnDescriptor::impl_registerProperties() { sal_Int32 nDefaultAttr = m_bActAsDescriptor ? 0 : PropertyAttribute::READONLY; @@ -90,17 +89,14 @@ void OTableColumnDescriptor::impl_registerProperties() OColumnSettings::registerProperties( *this ); } -//-------------------------------------------------------------------------- IMPLEMENT_GET_IMPLEMENTATION_ID( OTableColumnDescriptor ) // ::com::sun::star::lang::XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OTableColumnDescriptor::getImplementationName( ) throw (RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OTableColumnDescriptor"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OTableColumnDescriptor::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -110,7 +106,6 @@ Sequence< ::rtl::OUString > OTableColumnDescriptor::getSupportedServiceNames( ) } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OTableColumnDescriptor::createArrayHelper( ) const { Sequence< Property > aProps; @@ -119,26 +114,23 @@ Sequence< ::rtl::OUString > OTableColumnDescriptor::getSupportedServiceNames( ) } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OTableColumnDescriptor::getInfoHelper() { return *static_cast< ::comphelper::OPropertyArrayUsageHelper< OTableColumnDescriptor >* >(this)->getArrayHelper(); } -//------------------------------------------------------------------------------ void OTableColumnDescriptor::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { OColumn::setFastPropertyValue_NoBroadcast( nHandle, rValue ); ::dbaccess::notifyDataSourceModified( m_xParent, sal_True ); } -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OTableColumnDescriptor::getParent( ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); return m_xParent; } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableColumnDescriptor::setParent( const Reference< XInterface >& _xParent ) throw (NoSupportException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); @@ -149,7 +141,6 @@ void SAL_CALL OTableColumnDescriptor::setParent( const Reference< XInterface >& //============================================================ DBG_NAME(OTableColumn); -// ------------------------------------------------------------------------- OTableColumn::OTableColumn( const ::rtl::OUString& _rName ) :OTableColumnDescriptor( false /* do not act as descriptor */ ) { @@ -157,28 +148,23 @@ OTableColumn::OTableColumn( const ::rtl::OUString& _rName ) m_sName = _rName; } -// ----------------------------------------------------------------------------- OTableColumn::~OTableColumn() { DBG_DTOR(OTableColumn,NULL); } -//-------------------------------------------------------------------------- IMPLEMENT_GET_IMPLEMENTATION_ID( OTableColumn ) -//------------------------------------------------------------------------------ rtl::OUString OTableColumn::getImplementationName( ) throw (RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OTableColumn"); } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& SAL_CALL OTableColumn::getInfoHelper() { return *OTableColumn_PBase::getArrayHelper(); } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OTableColumn::createArrayHelper( ) const { return OTableColumnDescriptor::createArrayHelper(); @@ -189,7 +175,6 @@ rtl::OUString OTableColumn::getImplementationName( ) throw (RuntimeException) // ========================================================================= DBG_NAME( OQueryColumn ); -// ------------------------------------------------------------------------- OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection,const ::rtl::OUString i_sLabel ) :OTableColumnDescriptor( false /* do not act as descriptor */ ) ,m_sLabel(i_sLabel) @@ -211,7 +196,7 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_ISAUTOINCREMENT ) >>= m_bAutoIncrement ); OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_ISCURRENCY ) >>= m_bCurrency ); OSL_VERIFY( _rxParserColumn->getPropertyValue( PROPERTY_NAME ) >>= m_sName ); - + m_bRowVersion = sal_False; Reference< XPropertySetInfo > xPSI( _rxParserColumn->getPropertySetInfo(), UNO_SET_THROW ); @@ -245,13 +230,11 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co osl_decrementInterlockedCount( &m_refCount ); } -//-------------------------------------------------------------------------- OQueryColumn::~OQueryColumn() { DBG_DTOR( OQueryColumn, NULL ); } -//-------------------------------------------------------------------------- Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const Reference< XConnection >& _rxConnection ) { OSL_PRECOND( _rxConnection.is(), "OQueryColumn::impl_determineOriginalTableColumn: illegal connection!" ); @@ -296,28 +279,23 @@ Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const return xOriginalTableColumn; } -//-------------------------------------------------------------------------- IMPLEMENT_GET_IMPLEMENTATION_ID( OQueryColumn ) -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OQueryColumn::getImplementationName( ) throw(RuntimeException) { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.dbaccess.OQueryColumn" ) ); } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& SAL_CALL OQueryColumn::getInfoHelper() { return *OQueryColumn_PBase::getArrayHelper(); } -//-------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper* OQueryColumn::createArrayHelper() const { return OTableColumnDescriptor::createArrayHelper(); } -//-------------------------------------------------------------------------- void SAL_CALL OQueryColumn::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { OTableColumnDescriptor::getFastPropertyValue( _rValue, _nHandle ); @@ -354,7 +332,7 @@ void SAL_CALL OQueryColumn::getFastPropertyValue( Any& _rValue, sal_Int32 _nHand //= OColumnWrapper //========================================================================== DBG_NAME(OColumnWrapper); -//-------------------------------------------------------------------------- + OColumnWrapper::OColumnWrapper( const Reference< XPropertySet > & rCol, const bool _bNameIsReadOnly ) :OColumn( _bNameIsReadOnly ) ,m_xAggregate(rCol) @@ -375,13 +353,12 @@ OColumnWrapper::OColumnWrapper( const Reference< XPropertySet > & rCol, const bo m_xAggregate->getPropertyValue(PROPERTY_NAME) >>= m_sName; } } -// ----------------------------------------------------------------------------- + OColumnWrapper::~OColumnWrapper() { DBG_DTOR(OColumnWrapper,NULL); } -//------------------------------------------------------------------------------ ::rtl::OUString OColumnWrapper::impl_getPropertyNameFromHandle( const sal_Int32 _nHandle ) const { ::rtl::OUString sPropName; @@ -391,7 +368,6 @@ OColumnWrapper::~OColumnWrapper() return sPropName; } -//------------------------------------------------------------------------------ void OColumnWrapper::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { // derived classes are free to either use the OPropertyContainer(Helper) mechanisms for properties, @@ -407,7 +383,6 @@ void OColumnWrapper::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons } } -//------------------------------------------------------------------------------ sal_Bool OColumnWrapper::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw (IllegalArgumentException) { @@ -428,7 +403,6 @@ sal_Bool OColumnWrapper::convertFastPropertyValue( Any & rConvertedValue, Any & return bModified; } -//------------------------------------------------------------------------------ void OColumnWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { if ( OColumn::isRegisteredProperty( nHandle ) ) @@ -441,7 +415,6 @@ void OColumnWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const } } -// ----------------------------------------------------------------------------- sal_Int64 SAL_CALL OColumnWrapper::getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw(RuntimeException) { Reference< XUnoTunnel > xTunnel( m_xAggregate, UNO_QUERY); @@ -453,7 +426,6 @@ sal_Int64 SAL_CALL OColumnWrapper::getSomething( const Sequence< sal_Int8 >& aId //============================================================ //= OTableColumnDescriptorWrapper //============================================================ -//-------------------------------------------------------------------------- OTableColumnDescriptorWrapper::OTableColumnDescriptorWrapper( const Reference< XPropertySet >& _rCol, const bool _bPureWrap, const bool _bIsDescriptor ) :OColumnWrapper( _rCol, !_bIsDescriptor ) ,m_bPureWrap( _bPureWrap ) @@ -464,17 +436,14 @@ OTableColumnDescriptorWrapper::OTableColumnDescriptorWrapper( const Reference< X } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- IMPLEMENT_GET_IMPLEMENTATION_ID( OTableColumnDescriptorWrapper ) // ::com::sun::star::lang::XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OTableColumnDescriptorWrapper::getImplementationName( ) throw (RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OTableColumnDescriptorWrapper"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -484,7 +453,6 @@ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNa } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OTableColumnDescriptorWrapper::createArrayHelper( sal_Int32 nId ) const { const sal_Int32 nHaveAlways = 7; @@ -552,13 +520,11 @@ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNa } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OTableColumnDescriptorWrapper::getInfoHelper() { return *static_cast< OIdPropertyArrayUsageHelper< OTableColumnDescriptorWrapper >* >(this)->getArrayHelper(m_nColTypeID); } -//------------------------------------------------------------------------------ void OTableColumnDescriptorWrapper::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { if ( m_bPureWrap ) @@ -571,7 +537,6 @@ void OTableColumnDescriptorWrapper::getFastPropertyValue( Any& rValue, sal_Int32 } } -//------------------------------------------------------------------------------ sal_Bool OTableColumnDescriptorWrapper::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw (IllegalArgumentException) { sal_Bool bModified(sal_False); @@ -596,7 +561,6 @@ sal_Bool OTableColumnDescriptorWrapper::convertFastPropertyValue( Any & rConvert return bModified; } -//------------------------------------------------------------------------------ void OTableColumnDescriptorWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue @@ -616,7 +580,6 @@ void OTableColumnDescriptorWrapper::setFastPropertyValue_NoBroadcast( //============================================================ //= OTableColumnWrapper //============================================================ -//-------------------------------------------------------------------------- OTableColumnWrapper::OTableColumnWrapper( const Reference< XPropertySet >& rCol, const Reference< XPropertySet >& _xColDefintion, const bool _bPureWrap ) :OTableColumnDescriptorWrapper( rCol, _bPureWrap, false ) @@ -636,21 +599,17 @@ OTableColumnWrapper::OTableColumnWrapper( const Reference< XPropertySet >& rCol, osl_decrementInterlockedCount( &m_refCount ); } -//-------------------------------------------------------------------------- OTableColumnWrapper::~OTableColumnWrapper() { } -//-------------------------------------------------------------------------- IMPLEMENT_GET_IMPLEMENTATION_ID( OTableColumnWrapper ) -//------------------------------------------------------------------------------ rtl::OUString OTableColumnWrapper::getImplementationName( ) throw (RuntimeException) { return rtl::OUString::createFromAscii( "com.sun.star.sdb.OTableColumnWrapper" ); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OTableColumnWrapper::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -659,16 +618,13 @@ Sequence< ::rtl::OUString > OTableColumnWrapper::getSupportedServiceNames( ) th return aSNS; } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OTableColumnWrapper::getInfoHelper() { return *static_cast< OIdPropertyArrayUsageHelper< OTableColumnWrapper >* >(this)->getArrayHelper(m_nColTypeID); } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OTableColumnWrapper::createArrayHelper( sal_Int32 nId ) const { return OTableColumnDescriptorWrapper::createArrayHelper( nId ); } - diff --git a/dbaccess/source/core/api/makefile.mk b/dbaccess/source/core/api/makefile.mk index 9a4dc9d..8ceda2f 100644 --- a/dbaccess/source/core/api/makefile.mk +++ b/dbaccess/source/core/api/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx index 8237df8..c4ab995 100644 --- a/dbaccess/source/core/api/preparedstatement.cxx +++ b/dbaccess/source/core/api/preparedstatement.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,6 @@ using namespace dbaccess; DBG_NAME(OPreparedStatement) -//-------------------------------------------------------------------------- OPreparedStatement::OPreparedStatement(const Reference< XConnection > & _xConn, const Reference< XInterface > & _xStatement) :OStatementBase(_xConn, _xStatement) @@ -66,7 +65,6 @@ OPreparedStatement::OPreparedStatement(const Reference< XConnection > & _xConn, m_pColumns = new OColumns(*this, m_aMutex, xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(),::std::vector< ::rtl::OUString>(), NULL,NULL); } -//-------------------------------------------------------------------------- OPreparedStatement::~OPreparedStatement() { m_pColumns->acquire(); @@ -77,7 +75,6 @@ OPreparedStatement::~OPreparedStatement() } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OPreparedStatement::getTypes() throw (RuntimeException) { OTypeCollection aTypes(::getCppuType( (const Reference< XServiceInfo > *)0 ), @@ -90,7 +87,6 @@ Sequence< Type > OPreparedStatement::getTypes() throw (RuntimeException) return aTypes.getTypes(); } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > OPreparedStatement::getImplementationId() throw (RuntimeException) { static OImplementationId * pId = 0; @@ -107,7 +103,6 @@ Sequence< sal_Int8 > OPreparedStatement::getImplementationId() throw (RuntimeExc } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any OPreparedStatement::queryInterface( const Type & rType ) throw (RuntimeException) { Any aIface = OStatementBase::queryInterface( rType ); @@ -124,32 +119,27 @@ Any OPreparedStatement::queryInterface( const Type & rType ) throw (RuntimeExcep return aIface; } -//-------------------------------------------------------------------------- void OPreparedStatement::acquire() throw () { OStatementBase::acquire(); } -//-------------------------------------------------------------------------- void OPreparedStatement::release() throw () { OStatementBase::release(); } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OPreparedStatement::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OPreparedStatement"); } -//------------------------------------------------------------------------------ sal_Bool OPreparedStatement::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OPreparedStatement::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -159,7 +149,6 @@ Sequence< ::rtl::OUString > OPreparedStatement::getSupportedServiceNames( ) thr } // OComponentHelper -//------------------------------------------------------------------------------ void OPreparedStatement::disposing() { { @@ -171,7 +160,6 @@ void OPreparedStatement::disposing() } // ::com::sun::star::sdbcx::XColumnsSupplier -//------------------------------------------------------------------------------ Reference< ::com::sun::star::container::XNameAccess > OPreparedStatement::getColumns(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -206,7 +194,6 @@ Reference< ::com::sun::star::container::XNameAccess > OPreparedStatement::getCol } // XResultSetMetaDataSupplier -//------------------------------------------------------------------------------ Reference< XResultSetMetaData > OPreparedStatement::getMetaData(void) throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -215,7 +202,6 @@ Reference< XResultSetMetaData > OPreparedStatement::getMetaData(void) throw( SQL } // XPreparedStatement -//------------------------------------------------------------------------------ Reference< XResultSet > OPreparedStatement::executeQuery() throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -235,7 +221,6 @@ Reference< XResultSet > OPreparedStatement::executeQuery() throw( SQLException, return xResultSet; } -//------------------------------------------------------------------------------ sal_Int32 OPreparedStatement::executeUpdate() throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -246,7 +231,6 @@ sal_Int32 OPreparedStatement::executeUpdate() throw( SQLException, RuntimeExcept return Reference< XPreparedStatement >( m_xAggregateAsSet, UNO_QUERY_THROW )->executeUpdate(); } -//------------------------------------------------------------------------------ sal_Bool OPreparedStatement::execute() throw( SQLException, RuntimeException ) { MutexGuard aGuard(m_aMutex); @@ -257,14 +241,12 @@ sal_Bool OPreparedStatement::execute() throw( SQLException, RuntimeException ) return Reference< XPreparedStatement >( m_xAggregateAsSet, UNO_QUERY_THROW )->execute(); } -//------------------------------------------------------------------------------ Reference< XConnection > OPreparedStatement::getConnection(void) throw( SQLException, RuntimeException ) { return Reference< XConnection > (m_xParent, UNO_QUERY); } // XParameters -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -273,7 +255,6 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s m_xAggregateAsParameters->setNull(parameterIndex, sqlType); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -282,7 +263,6 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I m_xAggregateAsParameters->setObjectNull(parameterIndex, sqlType, typeName); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -291,7 +271,6 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool m_xAggregateAsParameters->setBoolean(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -300,7 +279,6 @@ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x m_xAggregateAsParameters->setByte(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -309,7 +287,6 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 m_xAggregateAsParameters->setShort(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -318,7 +295,6 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x m_xAggregateAsParameters->setInt(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -327,7 +303,6 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x m_xAggregateAsParameters->setLong(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -336,7 +311,6 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) m_xAggregateAsParameters->setFloat(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -345,7 +319,6 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x m_xAggregateAsParameters->setDouble(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -354,7 +327,6 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::r m_xAggregateAsParameters->setString(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -363,7 +335,6 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ m_xAggregateAsParameters->setBytes(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -372,7 +343,6 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const ::com m_xAggregateAsParameters->setDate(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -381,7 +351,6 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const ::com m_xAggregateAsParameters->setTime(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -390,7 +359,6 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const m_xAggregateAsParameters->setTimestamp(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -399,7 +367,6 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con m_xAggregateAsParameters->setBinaryStream(parameterIndex, x, length); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -408,7 +375,6 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, m_xAggregateAsParameters->setCharacterStream(parameterIndex, x, length); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -417,7 +383,6 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any m_xAggregateAsParameters->setObject(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -426,7 +391,6 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c m_xAggregateAsParameters->setObjectWithInfo(parameterIndex, x, targetSqlType, scale); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -435,7 +399,6 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere m_xAggregateAsParameters->setRef(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -444,7 +407,6 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer m_xAggregateAsParameters->setBlob(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -453,7 +415,6 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer m_xAggregateAsParameters->setClob(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -462,7 +423,6 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe m_xAggregateAsParameters->setArray(parameterIndex, x); } -//------------------------------------------------------------------------------ void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -470,4 +430,3 @@ void SAL_CALL OPreparedStatement::clearParameters( ) throw(SQLException, Runtim m_xAggregateAsParameters->clearParameters(); } - diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 7bd27b0..b498f0d 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -83,7 +83,7 @@ namespace dbaccess //= OQuery //========================================================================== DBG_NAME(OQuery) -//-------------------------------------------------------------------------- + OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition ,const Reference< XConnection >& _rxConn ,const Reference< XMultiServiceFactory >& _xORB) @@ -122,16 +122,15 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition osl_decrementInterlockedCount(&m_refCount); } -//-------------------------------------------------------------------------- OQuery::~OQuery() { DBG_DTOR(OQuery, NULL); } -// ----------------------------------------------------------------------------- + IMPLEMENT_IMPLEMENTATION_ID(OQuery); IMPLEMENT_GETTYPES3(OQuery,OQueryDescriptor_Base,ODataSettings,OContentHelper); IMPLEMENT_FORWARD_XINTERFACE3( OQuery,OContentHelper,OQueryDescriptor_Base,ODataSettings) -//-------------------------------------------------------------------------- + void OQuery::rebuildColumns() { OSL_PRECOND( getColumnCount() == 0, "OQuery::rebuildColumns: column container should be empty!" ); @@ -231,11 +230,9 @@ void OQuery::rebuildColumns() } // XServiceInfo -//-------------------------------------------------------------------------- IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, SERVICE_SDB_QUERYDEFINITION) // ::com::sun::star::beans::XPropertyChangeListener -//-------------------------------------------------------------------------- void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) throw(RuntimeException) { sal_Int32 nOwnHandle = -1; @@ -268,7 +265,6 @@ void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) thro fire(&nOwnHandle, &_rSource.NewValue, &_rSource.OldValue, 1, sal_False); } -//-------------------------------------------------------------------------- void SAL_CALL OQuery::disposing( const EventObject& _rSource ) throw (RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -282,14 +278,12 @@ void SAL_CALL OQuery::disposing( const EventObject& _rSource ) throw (RuntimeExc } // XDataDescriptorFactory -//-------------------------------------------------------------------------- Reference< XPropertySet > SAL_CALL OQuery::createDataDescriptor( ) throw(RuntimeException) { return new OQueryDescriptor(*this); } // pseudo-XComponent -//-------------------------------------------------------------------------- void SAL_CALL OQuery::disposing() { MutexGuard aGuard(m_aMutex); @@ -303,13 +297,12 @@ void SAL_CALL OQuery::disposing() m_pWarnings = NULL; } -//-------------------------------------------------------------------------- void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) throw (Exception) { ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue); ::rtl::OUString sAggPropName; sal_Int16 nAttr = 0; - if (getInfoHelper().fillPropertyMembersByHandle(&sAggPropName,&nAttr,_nHandle) && + if (getInfoHelper().fillPropertyMembersByHandle(&sAggPropName,&nAttr,_nHandle) && m_xCommandPropInfo.is() && m_xCommandPropInfo->hasPropertyByName(sAggPropName)) { // the base class holds the property values itself, but we have to forward this to our CommandDefinition @@ -324,19 +317,16 @@ void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _r } } -//-------------------------------------------------------------------------- Reference< XPropertySetInfo > SAL_CALL OQuery::getPropertySetInfo( ) throw(RuntimeException) { return createPropertySetInfo( getInfoHelper() ) ; } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OQuery::getInfoHelper() { return *getArrayHelper(); } -//-------------------------------------------------------------------------- ::cppu::IPropertyArrayHelper* OQuery::createArrayHelper( ) const { Sequence< Property > aProps; @@ -344,12 +334,12 @@ Reference< XPropertySetInfo > SAL_CALL OQuery::getPropertySetInfo( ) throw(Runti describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); } -// ----------------------------------------------------------------------------- + OColumn* OQuery::createColumn(const ::rtl::OUString& /*_rName*/) const { return NULL; } -// ----------------------------------------------------------------------------- + void SAL_CALL OQuery::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -358,7 +348,7 @@ void SAL_CALL OQuery::rename( const ::rtl::OUString& newName ) throw (SQLExcepti if(xRename.is()) xRename->rename(newName); } -// ----------------------------------------------------------------------------- + void OQuery::registerProperties() { // the properties which OCommandBase supplies (it has no own registration, as it's not derived from @@ -385,14 +375,9 @@ void OQuery::registerProperties() &m_aLayoutInformation, ::getCppuType(&m_aLayoutInformation)); } -// ----------------------------------------------------------------------------- ::rtl::OUString OQuery::determineContentType() const { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.org.openoffice.DatabaseQuery" ) ); } -// ----------------------------------------------------------------------------- -//........................................................................ } // namespace dbaccess -//........................................................................ - diff --git a/dbaccess/source/core/api/query.hxx b/dbaccess/source/core/api/query.hxx index 449e2db..346a70f 100644 --- a/dbaccess/source/core/api/query.hxx +++ b/dbaccess/source/core/api/query.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,7 +69,7 @@ class OQuery :public OContentHelper friend struct TRelease; public: - typedef ::std::map< ::rtl::OUString,OColumn*,::comphelper::UStringMixLess> TNameColumnMap; + typedef ::std::map< ::rtl::OUString,OColumn*,::comphelper::UStringMixLess> TNameColumnMap; protected: // TNameColumnMap m_aColumnMap; // contains all columnnames to columns diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx index 144142c..1158c11 100644 --- a/dbaccess/source/core/api/querycomposer.cxx +++ b/dbaccess/source/core/api/querycomposer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,7 +74,7 @@ using namespace ::utl; DBG_NAME(OQueryComposer) -// ------------------------------------------------------------------------- + OQueryComposer::OQueryComposer(const Reference< XConnection>& _xConnection) : OSubComponent(m_aMutex,_xConnection) { @@ -86,26 +86,26 @@ OQueryComposer::OQueryComposer(const Reference< XConnection>& _xConnection) m_xComposer.set( xFac->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); m_xComposerHelper.set( xFac->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); } -// ------------------------------------------------------------------------- + OQueryComposer::~OQueryComposer() { DBG_DTOR(OQueryComposer,NULL); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::disposing" ); ::comphelper::disposeComponent(m_xComposerHelper); ::comphelper::disposeComponent(m_xComposer); } -// ------------------------------------------------------------------------- + // ::com::sun::star::lang::XTypeProvider Sequence< Type > SAL_CALL OQueryComposer::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getTypes" ); return ::comphelper::concatSequences(OSubComponent::getTypes(),OQueryComposer_BASE::getTypes()); } -// ------------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL OQueryComposer::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getImplementationId" ); @@ -121,7 +121,7 @@ Sequence< sal_Int8 > SAL_CALL OQueryComposer::getImplementationId() throw (Runti } return pId->getImplementationId(); } -// ------------------------------------------------------------------------- + // com::sun::star::lang::XUnoTunnel sal_Int64 SAL_CALL OQueryComposer::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { @@ -131,7 +131,7 @@ sal_Int64 SAL_CALL OQueryComposer::getSomething( const Sequence< sal_Int8 >& rId return 0; } -// ------------------------------------------------------------------------- + Any SAL_CALL OQueryComposer::queryInterface( const Type & rType ) throw(RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::queryInterface" ); @@ -140,21 +140,20 @@ Any SAL_CALL OQueryComposer::queryInterface( const Type & rType ) throw(RuntimeE aRet = OQueryComposer_BASE::queryInterface(rType); return aRet; } -// ------------------------------------------------------------------------- + // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OQueryComposer::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getImplementationName" ); return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.dbaccess.OQueryComposer")); } -//------------------------------------------------------------------------------ + sal_Bool OQueryComposer::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::supportsService" ); return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > OQueryComposer::getSupportedServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getSupportedServiceNames" ); @@ -162,7 +161,7 @@ Sequence< ::rtl::OUString > OQueryComposer::getSupportedServiceNames( ) throw ( aSNS[0] = SERVICE_SDB_SQLQUERYCOMPOSER; return aSNS; } -// ------------------------------------------------------------------------- + // XSQLQueryComposer ::rtl::OUString SAL_CALL OQueryComposer::getQuery( ) throw(RuntimeException) { @@ -176,7 +175,7 @@ Sequence< ::rtl::OUString > OQueryComposer::getSupportedServiceNames( ) throw ( xProp->getPropertyValue(PROPERTY_ORIGINAL) >>= sQuery; return sQuery; } -// ------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::setQuery" ); @@ -188,7 +187,7 @@ void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(S m_sOrgFilter = m_xComposer->getFilter(); m_sOrgOrder = m_xComposer->getOrder(); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OQueryComposer::getComposedQuery( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getComposedQuery" ); @@ -198,7 +197,7 @@ void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(S return m_xComposer->getQuery(); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OQueryComposer::getFilter( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getFilter" ); @@ -208,7 +207,7 @@ void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(S aFilterCreator = ::std::for_each(m_aFilters.begin(),m_aFilters.end(),aFilterCreator); return aFilterCreator.getComposedAndClear(); } -// ------------------------------------------------------------------------- + Sequence< Sequence< PropertyValue > > SAL_CALL OQueryComposer::getStructuredFilter( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getStructuredFilter" ); @@ -217,7 +216,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OQueryComposer::getStructuredFilt MutexGuard aGuard(m_aMutex); return m_xComposer->getStructuredFilter(); } -// ------------------------------------------------------------------------- + ::rtl::OUString SAL_CALL OQueryComposer::getOrder( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getOrder" ); @@ -228,7 +227,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OQueryComposer::getStructuredFilt aOrderCreator = ::std::for_each(m_aOrders.begin(),m_aOrders.end(),aOrderCreator); return aOrderCreator.getComposedAndClear(); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::appendFilterByColumn" ); @@ -261,7 +260,7 @@ void SAL_CALL OQueryComposer::appendFilterByColumn( const Reference< XPropertySe setFilter( aFilterCreator.getComposedAndClear() ); } -// ------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::appendOrderByColumn( const Reference< XPropertySet >& column, sal_Bool ascending ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::appendOrderByColumn" ); @@ -278,7 +277,7 @@ void SAL_CALL OQueryComposer::appendOrderByColumn( const Reference< XPropertySet setOrder(aOrderCreator.getComposedAndClear()); } -// ------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::setFilter( const ::rtl::OUString& filter ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::setFilter" ); @@ -295,7 +294,7 @@ void SAL_CALL OQueryComposer::setFilter( const ::rtl::OUString& filter ) throw(S m_xComposer->setFilter( aFilterCreator.getComposedAndClear() ); } -// ------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::setOrder( const ::rtl::OUString& order ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::setOrder" ); @@ -313,7 +312,7 @@ void SAL_CALL OQueryComposer::setOrder( const ::rtl::OUString& order ) throw(SQL m_xComposer->setOrder(aOrderCreator.getComposedAndClear()); } -// ------------------------------------------------------------------------- + // XTablesSupplier Reference< XNameAccess > SAL_CALL OQueryComposer::getTables( ) throw(RuntimeException) { @@ -323,7 +322,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getTables( ) throw(RuntimeExc ::osl::MutexGuard aGuard( m_aMutex ); return Reference(m_xComposer,UNO_QUERY)->getTables(); } -// ------------------------------------------------------------------------- + // XColumnsSupplier Reference< XNameAccess > SAL_CALL OQueryComposer::getColumns( ) throw(RuntimeException) { @@ -333,7 +332,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getColumns( ) throw(RuntimeEx ::osl::MutexGuard aGuard( m_aMutex ); return Reference(m_xComposer,UNO_QUERY)->getColumns(); } -// ------------------------------------------------------------------------- + Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OQueryComposer::getParameters" ); @@ -342,19 +341,13 @@ Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( ) throw(Runti ::osl::MutexGuard aGuard( m_aMutex ); return Reference(m_xComposer,UNO_QUERY)->getParameters(); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::acquire() throw() { OSubComponent::acquire(); } -// ----------------------------------------------------------------------------- + void SAL_CALL OQueryComposer::release() throw() { OSubComponent::release(); } -// ----------------------------------------------------------------------------- - - - - - diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index f8d5224..0e1f31f 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,7 +75,7 @@ namespace dbaccess //= OQueryContainer //========================================================================== DBG_NAME(OQueryContainer) -//------------------------------------------------------------------------------ + OQueryContainer::OQueryContainer( const Reference< XNameContainer >& _rxCommandDefinitions , const Reference< XConnection >& _rxConn @@ -92,7 +92,7 @@ OQueryContainer::OQueryContainer( { m_pCommandsListener = new OContainerListener( *this, m_aMutex ); m_pCommandsListener->acquire(); - + Reference< XContainer > xContainer( m_xCommandDefinitions, UNO_QUERY_THROW ); xContainer->addContainerListener( m_pCommandsListener ); @@ -115,20 +115,17 @@ OQueryContainer::OQueryContainer( setElementApproval( PContainerApprove( new ObjectNameApproval( _rxConn, ObjectNameApproval::TypeQuery ) ) ); } -//------------------------------------------------------------------------------ OQueryContainer::~OQueryContainer() { DBG_DTOR(OQueryContainer, NULL); // dispose(); // maybe we're already disposed, but this should be uncritical } -// ----------------------------------------------------------------------------- + IMPLEMENT_FORWARD_XINTERFACE2( OQueryContainer,ODefinitionContainer,OQueryContainer_Base) -//------------------------------------------------------------------------------ IMPLEMENT_FORWARD_XTYPEPROVIDER2( OQueryContainer,ODefinitionContainer,OQueryContainer_Base) -//------------------------------------------------------------------------------ void OQueryContainer::disposing() { ODefinitionContainer::disposing(); @@ -154,18 +151,15 @@ void OQueryContainer::disposing() } // XServiceInfo -//------------------------------------------------------------------------------ IMPLEMENT_SERVICE_INFO2(OQueryContainer, "com.sun.star.sdb.dbaccess.OQueryContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDB_QUERIES) // XDataDescriptorFactory -//-------------------------------------------------------------------------- Reference< XPropertySet > SAL_CALL OQueryContainer::createDataDescriptor( ) throw(RuntimeException) { return new OQueryDescriptor(); } // XAppend -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet >& _rxDesc ) throw(SQLException, ElementExistException, RuntimeException) { ResettableMutexGuard aGuard(m_aMutex); @@ -206,7 +200,6 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet } // XDrop -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::dropByName( const ::rtl::OUString& _rName ) throw(SQLException, NoSuchElementException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -221,7 +214,6 @@ void SAL_CALL OQueryContainer::dropByName( const ::rtl::OUString& _rName ) throw m_xCommandDefinitions->removeByName(_rName); } -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::dropByIndex( sal_Int32 _nIndex ) throw(SQLException, IndexOutOfBoundsException, RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -238,7 +230,7 @@ void SAL_CALL OQueryContainer::dropByIndex( sal_Int32 _nIndex ) throw(SQLExcepti dropByName(sName); } -//------------------------------------------------------------------------------ + void SAL_CALL OQueryContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) { Reference< XContent > xNewElement; @@ -261,7 +253,6 @@ void SAL_CALL OQueryContainer::elementInserted( const ::com::sun::star::containe insertByName(sElementName,makeAny(xNewElement)); } -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) { ::rtl::OUString sAccessor; @@ -275,7 +266,6 @@ void SAL_CALL OQueryContainer::elementRemoved( const ::com::sun::star::container removeByName(sAccessor); } -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) { Reference< XPropertySet > xReplacedElement; @@ -289,14 +279,13 @@ void SAL_CALL OQueryContainer::elementReplaced( const ::com::sun::star::containe DBG_ASSERT(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(), "OQueryContainer::elementReplaced : oops .... we're inconsistent with our master container !"); if (!sAccessor.getLength() || !hasByName(sAccessor)) return; - + xNewElement = implCreateWrapper(sAccessor); } replaceByName(sAccessor,makeAny(xNewElement)); } -//------------------------------------------------------------------------------ Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const ContainerEvent& Event ) throw (WrappedTargetException, RuntimeException) { ::rtl::OUString sName; @@ -315,19 +304,16 @@ Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const Contain return xReturn; } -//------------------------------------------------------------------------------ Reference< XVeto > SAL_CALL OQueryContainer::approveReplaceElement( const ContainerEvent& /*Event*/ ) throw (WrappedTargetException, RuntimeException) { return NULL; } -//------------------------------------------------------------------------------ Reference< XVeto > SAL_CALL OQueryContainer::approveRemoveElement( const ContainerEvent& /*Event*/ ) throw (WrappedTargetException, RuntimeException) { return NULL; } -//------------------------------------------------------------------------------ void SAL_CALL OQueryContainer::disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw(::com::sun::star::uno::RuntimeException) { if (_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinitions, UNO_QUERY).get()) @@ -335,7 +321,7 @@ void SAL_CALL OQueryContainer::disposing( const ::com::sun::star::lang::EventObj DBG_ERROR("OQueryContainer::disposing : nobody should dispose the CommandDefinition container before disposing my connection !"); dispose(); } - else + else { Reference< XContent > xSource(_rSource.Source, UNO_QUERY); // it's one of our documents .... @@ -353,20 +339,17 @@ void SAL_CALL OQueryContainer::disposing( const ::com::sun::star::lang::EventObj } } -// ----------------------------------------------------------------------------- ::rtl::OUString OQueryContainer::determineContentType() const { return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.org.openoffice.DatabaseQueryContainer" ) ); } -// ----------------------------------------------------------------------------- Reference< XContent > OQueryContainer::implCreateWrapper(const ::rtl::OUString& _rName) { Reference< XContent > xObject(m_xCommandDefinitions->getByName(_rName),UNO_QUERY); return implCreateWrapper(xObject); } -//-------------------------------------------------------------------------- Reference< XContent > OQueryContainer::implCreateWrapper(const Reference< XContent >& _rxCommandDesc) { Reference xContainer(_rxCommandDesc,UNO_QUERY); @@ -388,12 +371,12 @@ Reference< XContent > OQueryContainer::implCreateWrapper(const Reference< XConte return xReturn; } -//-------------------------------------------------------------------------- + Reference< XContent > OQueryContainer::createObject( const ::rtl::OUString& _rName) { return implCreateWrapper(_rName); } -// ----------------------------------------------------------------------------- + sal_Bool OQueryContainer::checkExistence(const ::rtl::OUString& _rName) { sal_Bool bRet = sal_False; @@ -413,19 +396,19 @@ sal_Bool OQueryContainer::checkExistence(const ::rtl::OUString& _rName) } return bRet; } -//-------------------------------------------------------------------------- + sal_Bool SAL_CALL OQueryContainer::hasElements( ) throw (RuntimeException) { MutexGuard aGuard(m_aMutex); return m_xCommandDefinitions->hasElements(); } -// ----------------------------------------------------------------------------- + sal_Int32 SAL_CALL OQueryContainer::getCount( ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); return Reference(m_xCommandDefinitions,UNO_QUERY)->getCount(); } -// ----------------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL OQueryContainer::getElementNames( ) throw(RuntimeException) { MutexGuard aGuard(m_aMutex); @@ -433,7 +416,4 @@ Sequence< ::rtl::OUString > SAL_CALL OQueryContainer::getElementNames( ) throw( return m_xCommandDefinitions->getElementNames(); } -//........................................................................ } // namespace dbaccess -//........................................................................ - diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx index cacf354..dcfc879 100644 --- a/dbaccess/source/core/api/querydescriptor.cxx +++ b/dbaccess/source/core/api/querydescriptor.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,17 +48,15 @@ using namespace ::comphelper; using namespace ::osl; using namespace ::cppu; -//........................................................................ namespace dbaccess { -//........................................................................ //========================================================================== //= OQueryDescriptor //========================================================================== DBG_NAME(OQueryDescriptor) -//-------------------------------------------------------------------------- -OQueryDescriptor::OQueryDescriptor() + +OQueryDescriptor::OQueryDescriptor() :OQueryDescriptor_Base(m_aMutex,*this) ,ODataSettings(m_aBHelper,sal_True) { @@ -67,7 +65,6 @@ OQueryDescriptor::OQueryDescriptor() ODataSettings::registerPropertiesFor(this); } -//-------------------------------------------------------------------------- OQueryDescriptor::OQueryDescriptor(const OQueryDescriptor_Base& _rSource) :OQueryDescriptor_Base(_rSource,*this) ,ODataSettings(m_aBHelper,sal_True) @@ -76,15 +73,15 @@ OQueryDescriptor::OQueryDescriptor(const OQueryDescriptor_Base& _rSource) registerProperties(); ODataSettings::registerPropertiesFor(this); } -// ----------------------------------------------------------------------------- + OQueryDescriptor::~OQueryDescriptor() { DBG_DTOR(OQueryDescriptor,NULL); } -// ----------------------------------------------------------------------------- + IMPLEMENT_TYPEPROVIDER2(OQueryDescriptor,OQueryDescriptor_Base,ODataSettings); IMPLEMENT_FORWARD_XINTERFACE3( OQueryDescriptor,OWeakObject,OQueryDescriptor_Base,ODataSettings) -//-------------------------------------------------------------------------- + void OQueryDescriptor::registerProperties() { // the properties which OCommandBase supplies (it has no own registration, as it's not derived from @@ -110,19 +107,17 @@ void OQueryDescriptor::registerProperties() registerProperty(PROPERTY_LAYOUTINFORMATION, PROPERTY_ID_LAYOUTINFORMATION, PropertyAttribute::BOUND, &m_aLayoutInformation, ::getCppuType(&m_aLayoutInformation)); } -// ----------------------------------------------------------------------------- -//-------------------------------------------------------------------------- + Reference< XPropertySetInfo > SAL_CALL OQueryDescriptor::getPropertySetInfo( ) throw(RuntimeException) { return createPropertySetInfo( getInfoHelper() ) ; } -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OQueryDescriptor::getInfoHelper() { return *getArrayHelper(); } -//-------------------------------------------------------------------------- + ::cppu::IPropertyArrayHelper* OQueryDescriptor::createArrayHelper( ) const { Sequence< Property > aProps; @@ -130,9 +125,8 @@ Reference< XPropertySetInfo > SAL_CALL OQueryDescriptor::getPropertySetInfo( ) return new ::cppu::OPropertyArrayHelper(aProps); } -// ----------------------------------------------------------------------------- DBG_NAME(OQueryDescriptor_Base); -//-------------------------------------------------------------------------- + OQueryDescriptor_Base::OQueryDescriptor_Base(::osl::Mutex& _rMutex,::cppu::OWeakObject& _rMySelf) :m_bColumnsOutOfDate(sal_True) ,m_rMutex(_rMutex) @@ -140,7 +134,7 @@ OQueryDescriptor_Base::OQueryDescriptor_Base(::osl::Mutex& _rMutex,::cppu::OWeak DBG_CTOR(OQueryDescriptor_Base,NULL); m_pColumns = new OColumns(_rMySelf, m_rMutex, sal_True,::std::vector< ::rtl::OUString>(), this,this); } -//-------------------------------------------------------------------------- + OQueryDescriptor_Base::OQueryDescriptor_Base(const OQueryDescriptor_Base& _rSource,::cppu::OWeakObject& _rMySelf) :m_bColumnsOutOfDate(sal_True) ,m_rMutex(_rSource.m_rMutex) @@ -156,7 +150,6 @@ OQueryDescriptor_Base::OQueryDescriptor_Base(const OQueryDescriptor_Base& _rSour m_aLayoutInformation = _rSource.m_aLayoutInformation; } -//-------------------------------------------------------------------------- OQueryDescriptor_Base::~OQueryDescriptor_Base() { m_pColumns->acquire(); @@ -165,7 +158,7 @@ OQueryDescriptor_Base::~OQueryDescriptor_Base() DBG_DTOR(OQueryDescriptor_Base,NULL); } -// ----------------------------------------------------------------------------- + sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) throw(RuntimeException) { if (_rIdentifier.getLength() != 16) @@ -176,9 +169,9 @@ sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 return 0; } -//-------------------------------------------------------------------------- + IMPLEMENT_IMPLEMENTATION_ID(OQueryDescriptor_Base) -//-------------------------------------------------------------------------- + void OQueryDescriptor_Base::setColumnsOutOfDate( sal_Bool _bOutOfDate ) { m_bColumnsOutOfDate = _bOutOfDate; @@ -186,13 +179,11 @@ void OQueryDescriptor_Base::setColumnsOutOfDate( sal_Bool _bOutOfDate ) m_pColumns->setInitialized(); } -//-------------------------------------------------------------------------- void OQueryDescriptor_Base::implAppendColumn( const ::rtl::OUString& _rName, OColumn* _pColumn ) { m_pColumns->append( _rName, _pColumn ); } -//-------------------------------------------------------------------------- void OQueryDescriptor_Base::clearColumns( ) { m_pColumns->clearColumns(); @@ -200,7 +191,6 @@ void OQueryDescriptor_Base::clearColumns( ) setColumnsOutOfDate(); } -//-------------------------------------------------------------------------- Reference< XNameAccess > SAL_CALL OQueryDescriptor_Base::getColumns( ) throw (RuntimeException) { MutexGuard aGuard(m_rMutex); @@ -227,23 +217,20 @@ Reference< XNameAccess > SAL_CALL OQueryDescriptor_Base::getColumns( ) throw (Ru throw; } } - + return m_pColumns; } -//-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OQueryDescriptor_Base::getImplementationName( ) throw(RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.sdb.OQueryDescriptor"); } -//-------------------------------------------------------------------------- sal_Bool SAL_CALL OQueryDescriptor_Base::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException) { return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//-------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL OQueryDescriptor_Base::getSupportedServiceNames( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(2); @@ -251,37 +238,32 @@ Sequence< ::rtl::OUString > SAL_CALL OQueryDescriptor_Base::getSupportedServiceN aSupported.getArray()[1] = SERVICE_SDB_QUERYDESCRIPTOR; return aSupported; } -//-------------------------------------------------------------------------- + void OQueryDescriptor_Base::disposeColumns() { m_pColumns->disposing(); } -// ----------------------------------------------------------------------------- void OQueryDescriptor_Base::columnAppended( const Reference< XPropertySet >& /*_rxSourceDescriptor*/ ) { // not interested in } -// ----------------------------------------------------------------------------- void OQueryDescriptor_Base::columnDropped(const ::rtl::OUString& /*_sName*/) { // not interested in } -// ----------------------------------------------------------------------------- Reference< XPropertySet > OQueryDescriptor_Base::createColumnDescriptor() { OSL_ENSURE( false, "OQueryDescriptor_Base::createColumnDescriptor: called why?" ); return NULL; } -// ----------------------------------------------------------------------------- void OQueryDescriptor_Base::rebuildColumns( ) { } -// ----------------------------------------------------------------------------- // IRefreshableColumns void OQueryDescriptor_Base::refreshColumns() { @@ -291,15 +273,10 @@ void OQueryDescriptor_Base::refreshColumns() rebuildColumns(); } -//------------------------------------------------------------------------------ OColumn* OQueryDescriptor_Base::createColumn( const ::rtl::OUString& /*_rName*/ ) const { // creating a column/descriptor for a query/descriptor does not make sense at all return NULL; } -// ----------------------------------------------------------------------------- -//........................................................................ -} // namespace dbaccess -//........................................................................ - +} // namespace dbaccess diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx index 53d75bc..c856ea7 100644 --- a/dbaccess/source/core/api/querydescriptor.hxx +++ b/dbaccess/source/core/api/querydescriptor.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx index 76dd933..8463933 100644 --- a/dbaccess/source/core/api/resultcolumn.cxx +++ b/dbaccess/source/core/api/resultcolumn.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,7 +52,7 @@ using namespace ::cppu; using namespace dbaccess; DBG_NAME(OResultColumn) -//-------------------------------------------------------------------------- + OResultColumn::OResultColumn( const Reference < XResultSetMetaData >& _xMetaData, sal_Int32 _nPos, const Reference< XDatabaseMetaData >& _rxDBMeta ) :OColumn( true ) @@ -62,7 +62,7 @@ OResultColumn::OResultColumn( const Reference < XResultSetMetaData >& _xMetaData { DBG_CTOR(OResultColumn,NULL); } -// ----------------------------------------------------------------------------- + void OResultColumn::impl_determineIsRowVersion_nothrow() { if ( m_aIsRowVersion.hasValue() ) @@ -72,7 +72,7 @@ void OResultColumn::impl_determineIsRowVersion_nothrow() OSL_ENSURE( m_xDBMetaData.is(), "OResultColumn::impl_determineIsRowVersion_nothrow: no DBMetaData!" ); if ( !m_xDBMetaData.is() ) return; - + try { ::rtl::OUString sCatalog, sSchema, sTable, sColumnName; @@ -107,13 +107,13 @@ void OResultColumn::impl_determineIsRowVersion_nothrow() DBG_UNHANDLED_EXCEPTION(); } } -// ----------------------------------------------------------------------------- + OResultColumn::~OResultColumn() { DBG_DTOR(OResultColumn,NULL); } + // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< sal_Int8 > OResultColumn::getImplementationId() throw (RuntimeException) { static OImplementationId * pId = 0; @@ -130,13 +130,11 @@ Sequence< sal_Int8 > OResultColumn::getImplementationId() throw (RuntimeExceptio } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OResultColumn::getImplementationName( ) throw(RuntimeException) { return rtl::OUString::createFromAscii("com.sun.star.sdb.OResultColumn"); } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OResultColumn::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< ::rtl::OUString > aSNS( 2 ); @@ -146,7 +144,6 @@ Sequence< ::rtl::OUString > OResultColumn::getSupportedServiceNames( ) throw (R } // OComponentHelper -//------------------------------------------------------------------------------ void OResultColumn::disposing() { OColumn::disposing(); @@ -156,7 +153,6 @@ void OResultColumn::disposing() } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OResultColumn::createArrayHelper( ) const { BEGIN_PROPERTY_HELPER(21) @@ -185,13 +181,11 @@ void OResultColumn::disposing() } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OResultColumn::getInfoHelper() { return *static_cast< ::comphelper::OPropertyArrayUsageHelper< OResultColumn >* >(this)->getArrayHelper(); } -//------------------------------------------------------------------------------ namespace { template< typename TYPE > @@ -203,7 +197,6 @@ namespace } } -//------------------------------------------------------------------------------ void OResultColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { try @@ -328,4 +321,3 @@ void OResultColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const } } } - diff --git a/dbaccess/source/core/api/resultcolumn.hxx b/dbaccess/source/core/api/resultcolumn.hxx index b11c78b..cbac3c6 100644 --- a/dbaccess/source/core/api/resultcolumn.hxx +++ b/dbaccess/source/core/api/resultcolumn.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index 219b657..0b8492f 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,7 +61,6 @@ using namespace dbtools; DBG_NAME(OResultSet) -//-------------------------------------------------------------------------- OResultSet::OResultSet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _xResultSet, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xStatement, sal_Bool _bCaseSensitive) @@ -105,7 +104,6 @@ OResultSet::OResultSet(const ::com::sun::star::uno::Reference< ::com::sun::star: } } -//-------------------------------------------------------------------------- OResultSet::~OResultSet() { m_pColumns->acquire(); @@ -116,7 +114,6 @@ OResultSet::~OResultSet() } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OResultSet::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTypes" ); @@ -126,7 +123,6 @@ Sequence< Type > OResultSet::getTypes() throw (RuntimeException) return aTypes.getTypes(); } -//-------------------------------------------------------------------------- Sequence< sal_Int8 > OResultSet::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationId" ); @@ -144,7 +140,6 @@ Sequence< sal_Int8 > OResultSet::getImplementationId() throw (RuntimeException) } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any OResultSet::queryInterface( const Type & rType ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::queryInterface" ); @@ -157,13 +152,11 @@ Any OResultSet::queryInterface( const Type & rType ) throw (RuntimeException) return aIface; } -//-------------------------------------------------------------------------- void OResultSet::acquire() throw () { OResultSetBase::acquire(); } -//-------------------------------------------------------------------------- void OResultSet::release() throw () { OResultSetBase::release(); @@ -171,7 +164,6 @@ void OResultSet::release() throw () // OResultSetBase -//------------------------------------------------------------------------------ void OResultSet::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::disposing" ); @@ -193,7 +185,6 @@ void OResultSet::disposing() } // XCloseable -//------------------------------------------------------------------------------ void OResultSet::close(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::close" ); @@ -205,21 +196,18 @@ void OResultSet::close(void) throw( SQLException, RuntimeException ) } // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OResultSet::getImplementationName( ) throw(RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationName" ); return rtl::OUString::createFromAscii("com.sun.star.sdb.OResultSet"); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::supportsService" ); return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OResultSet::getSupportedServiceNames( ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getSupportedServiceNames" ); @@ -230,7 +218,6 @@ Sequence< ::rtl::OUString > OResultSet::getSupportedServiceNames( ) throw (Runt } // com::sun::star::beans::XPropertySet -//------------------------------------------------------------------------------ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getPropertySetInfo" ); @@ -238,7 +225,6 @@ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() throw (RuntimeExc } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::createArrayHelper" ); @@ -253,14 +239,12 @@ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() throw (RuntimeExc } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OResultSet::getInfoHelper() { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInfoHelper" ); return *getArrayHelper(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::convertFastPropertyValue(Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::convertFastPropertyValue" ); @@ -270,7 +254,6 @@ sal_Bool OResultSet::convertFastPropertyValue(Any & rConvertedValue, Any & rOldV return sal_True; } -//------------------------------------------------------------------------------ void OResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::setFastPropertyValue_NoBroadcast" ); @@ -289,7 +272,6 @@ void OResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& } } -//------------------------------------------------------------------------------ void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFastPropertyValue" ); @@ -316,7 +298,6 @@ void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const } // XWarningsSupplier -//------------------------------------------------------------------------------ Any OResultSet::getWarnings(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getWarnings" ); @@ -325,7 +306,6 @@ Any OResultSet::getWarnings(void) throw( SQLException, RuntimeException ) return m_aWarnings.getWarnings(); } -//------------------------------------------------------------------------------ void OResultSet::clearWarnings(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::clearWarnings" ); @@ -335,7 +315,6 @@ void OResultSet::clearWarnings(void) throw( SQLException, RuntimeException ) } // ::com::sun::star::sdbc::XResultSetMetaDataSupplier -//------------------------------------------------------------------------------ Reference< XResultSetMetaData > OResultSet::getMetaData(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getMetaData" ); @@ -346,7 +325,6 @@ Reference< XResultSetMetaData > OResultSet::getMetaData(void) throw( SQLExceptio } // ::com::sun::star::sdbc::XColumnLocate -//------------------------------------------------------------------------------ sal_Int32 OResultSet::findColumn(const rtl::OUString& columnName) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::findColumn" ); @@ -356,7 +334,6 @@ sal_Int32 OResultSet::findColumn(const rtl::OUString& columnName) throw( SQLExce return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY)->findColumn(columnName); } -//------------------------------------------------------------------------------ namespace { static Reference< XDatabaseMetaData > lcl_getDBMetaDataFromStatement_nothrow( const Reference< XInterface >& _rxStatement ) @@ -381,8 +358,8 @@ namespace return xDBMetaData; } } + // ::com::sun::star::sdbcx::XColumnsSupplier -//------------------------------------------------------------------------------ Reference< ::com::sun::star::container::XNameAccess > OResultSet::getColumns(void) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getColumns" ); @@ -454,7 +431,6 @@ Reference< ::com::sun::star::container::XNameAccess > OResultSet::getColumns(voi } // ::com::sun::star::sdbc::XRow -//------------------------------------------------------------------------------ sal_Bool OResultSet::wasNull(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::wasNull" ); @@ -463,7 +439,7 @@ sal_Bool OResultSet::wasNull(void) throw( SQLException, RuntimeException ) return m_xDelegatorRow->wasNull(); } -//------------------------------------------------------------------------------ + rtl::OUString OResultSet::getString(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getString" ); @@ -472,7 +448,7 @@ rtl::OUString OResultSet::getString(sal_Int32 columnIndex) throw( SQLException, return m_xDelegatorRow->getString(columnIndex); } -//------------------------------------------------------------------------------ + sal_Bool OResultSet::getBoolean(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBoolean" ); @@ -481,7 +457,7 @@ sal_Bool OResultSet::getBoolean(sal_Int32 columnIndex) throw( SQLException, Runt return m_xDelegatorRow->getBoolean(columnIndex); } -//------------------------------------------------------------------------------ + sal_Int8 OResultSet::getByte(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getByte" ); @@ -490,7 +466,7 @@ sal_Int8 OResultSet::getByte(sal_Int32 columnIndex) throw( SQLException, Runtime return m_xDelegatorRow->getByte(columnIndex); } -//------------------------------------------------------------------------------ + sal_Int16 OResultSet::getShort(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getShort" ); @@ -499,7 +475,7 @@ sal_Int16 OResultSet::getShort(sal_Int32 columnIndex) throw( SQLException, Runti return m_xDelegatorRow->getShort(columnIndex); } -//------------------------------------------------------------------------------ + sal_Int32 OResultSet::getInt(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInt" ); @@ -508,7 +484,7 @@ sal_Int32 OResultSet::getInt(sal_Int32 columnIndex) throw( SQLException, Runtime return m_xDelegatorRow->getInt(columnIndex); } -//------------------------------------------------------------------------------ + sal_Int64 OResultSet::getLong(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getLong" ); @@ -517,7 +493,7 @@ sal_Int64 OResultSet::getLong(sal_Int32 columnIndex) throw( SQLException, Runtim return m_xDelegatorRow->getLong(columnIndex); } -//------------------------------------------------------------------------------ + float OResultSet::getFloat(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFloat" ); @@ -526,7 +502,7 @@ float OResultSet::getFloat(sal_Int32 columnIndex) throw( SQLException, RuntimeEx return m_xDelegatorRow->getFloat(columnIndex); } -//------------------------------------------------------------------------------ + double OResultSet::getDouble(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDouble" ); @@ -535,7 +511,7 @@ double OResultSet::getDouble(sal_Int32 columnIndex) throw( SQLException, Runtime return m_xDelegatorRow->getDouble(columnIndex); } -//------------------------------------------------------------------------------ + Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBytes" ); @@ -544,7 +520,7 @@ Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLExcep return m_xDelegatorRow->getBytes(columnIndex); } -//------------------------------------------------------------------------------ + ::com::sun::star::util::Date OResultSet::getDate(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDate" ); @@ -553,7 +529,7 @@ Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLExcep return m_xDelegatorRow->getDate(columnIndex); } -//------------------------------------------------------------------------------ + ::com::sun::star::util::Time OResultSet::getTime(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTime" ); @@ -562,7 +538,7 @@ Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLExcep return m_xDelegatorRow->getTime(columnIndex); } -//------------------------------------------------------------------------------ + ::com::sun::star::util::DateTime OResultSet::getTimestamp(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTimestamp" ); @@ -571,7 +547,7 @@ Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLExcep return m_xDelegatorRow->getTimestamp(columnIndex); } -//------------------------------------------------------------------------------ + Reference< ::com::sun::star::io::XInputStream > OResultSet::getBinaryStream(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBinaryStream" ); @@ -580,7 +556,7 @@ Reference< ::com::sun::star::io::XInputStream > OResultSet::getBinaryStream(sal return m_xDelegatorRow->getBinaryStream(columnIndex); } -//------------------------------------------------------------------------------ + Reference< ::com::sun::star::io::XInputStream > OResultSet::getCharacterStream(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getCharacterStream" ); @@ -589,7 +565,7 @@ Reference< ::com::sun::star::io::XInputStream > OResultSet::getCharacterStream( return m_xDelegatorRow->getCharacterStream(columnIndex); } -//------------------------------------------------------------------------------ + Any OResultSet::getObject(sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess > & typeMap) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getObject" ); @@ -598,7 +574,7 @@ Any OResultSet::getObject(sal_Int32 columnIndex, const Reference< ::com::sun::st return m_xDelegatorRow->getObject(columnIndex, typeMap); } -//------------------------------------------------------------------------------ + Reference< XRef > OResultSet::getRef(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRef" ); @@ -607,7 +583,7 @@ Reference< XRef > OResultSet::getRef(sal_Int32 columnIndex) throw( SQLException return m_xDelegatorRow->getRef(columnIndex); } -//------------------------------------------------------------------------------ + Reference< XBlob > OResultSet::getBlob(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBlob" ); @@ -616,7 +592,7 @@ Reference< XBlob > OResultSet::getBlob(sal_Int32 columnIndex) throw( SQLExcepti return m_xDelegatorRow->getBlob(columnIndex); } -//------------------------------------------------------------------------------ + Reference< XClob > OResultSet::getClob(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getClob" ); @@ -625,7 +601,7 @@ Reference< XClob > OResultSet::getClob(sal_Int32 columnIndex) throw( SQLExcepti return m_xDelegatorRow->getClob(columnIndex); } -//------------------------------------------------------------------------------ + Reference< XArray > OResultSet::getArray(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getArray" ); @@ -636,7 +612,6 @@ Reference< XArray > OResultSet::getArray(sal_Int32 columnIndex) throw( SQLExcep } // ::com::sun::star::sdbc::XRowUpdate -//------------------------------------------------------------------------------ void OResultSet::updateNull(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNull" ); @@ -648,7 +623,6 @@ void OResultSet::updateNull(sal_Int32 columnIndex) throw( SQLException, RuntimeE m_xDelegatorRowUpdate->updateNull(columnIndex); } -//------------------------------------------------------------------------------ void OResultSet::updateBoolean(sal_Int32 columnIndex, sal_Bool x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBoolean" ); @@ -659,7 +633,7 @@ void OResultSet::updateBoolean(sal_Int32 columnIndex, sal_Bool x) throw( SQLExce m_xDelegatorRowUpdate->updateBoolean(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateByte(sal_Int32 columnIndex, sal_Int8 x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateByte" ); @@ -670,7 +644,7 @@ void OResultSet::updateByte(sal_Int32 columnIndex, sal_Int8 x) throw( SQLExcepti m_xDelegatorRowUpdate->updateByte(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateShort(sal_Int32 columnIndex, sal_Int16 x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateShort" ); @@ -681,7 +655,7 @@ void OResultSet::updateShort(sal_Int32 columnIndex, sal_Int16 x) throw( SQLExcep m_xDelegatorRowUpdate->updateShort(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateInt(sal_Int32 columnIndex, sal_Int32 x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateInt" ); @@ -692,7 +666,7 @@ void OResultSet::updateInt(sal_Int32 columnIndex, sal_Int32 x) throw( SQLExcepti m_xDelegatorRowUpdate->updateInt(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateLong(sal_Int32 columnIndex, sal_Int64 x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateLong" ); @@ -703,7 +677,7 @@ void OResultSet::updateLong(sal_Int32 columnIndex, sal_Int64 x) throw( SQLExcept m_xDelegatorRowUpdate->updateLong(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateFloat(sal_Int32 columnIndex, float x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateFloat" ); @@ -714,7 +688,7 @@ void OResultSet::updateFloat(sal_Int32 columnIndex, float x) throw( SQLException m_xDelegatorRowUpdate->updateFloat(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateDouble(sal_Int32 columnIndex, double x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDouble" ); @@ -725,7 +699,7 @@ void OResultSet::updateDouble(sal_Int32 columnIndex, double x) throw( SQLExcepti m_xDelegatorRowUpdate->updateDouble(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateString(sal_Int32 columnIndex, const rtl::OUString& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateString" ); @@ -736,7 +710,7 @@ void OResultSet::updateString(sal_Int32 columnIndex, const rtl::OUString& x) thr m_xDelegatorRowUpdate->updateString(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateBytes(sal_Int32 columnIndex, const Sequence< sal_Int8 >& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBytes" ); @@ -747,7 +721,7 @@ void OResultSet::updateBytes(sal_Int32 columnIndex, const Sequence< sal_Int8 >& m_xDelegatorRowUpdate->updateBytes(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateDate(sal_Int32 columnIndex, const ::com::sun::star::util::Date& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDate" ); @@ -758,7 +732,7 @@ void OResultSet::updateDate(sal_Int32 columnIndex, const ::com::sun::star::util: m_xDelegatorRowUpdate->updateDate(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateTime(sal_Int32 columnIndex, const ::com::sun::star::util::Time& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTime" ); @@ -769,7 +743,7 @@ void OResultSet::updateTime(sal_Int32 columnIndex, const ::com::sun::star::util: m_xDelegatorRowUpdate->updateTime(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateTimestamp(sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTimestamp" ); @@ -780,7 +754,7 @@ void OResultSet::updateTimestamp(sal_Int32 columnIndex, const ::com::sun::star:: m_xDelegatorRowUpdate->updateTimestamp(columnIndex, x); } -//------------------------------------------------------------------------------ + void OResultSet::updateBinaryStream(sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBinaryStream" ); @@ -791,7 +765,7 @@ void OResultSet::updateBinaryStream(sal_Int32 columnIndex, const Reference< ::co m_xDelegatorRowUpdate->updateBinaryStream(columnIndex, x, length); } -//------------------------------------------------------------------------------ + void OResultSet::updateCharacterStream(sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateCharacterStream" ); @@ -802,7 +776,7 @@ void OResultSet::updateCharacterStream(sal_Int32 columnIndex, const Reference< : m_xDelegatorRowUpdate->updateCharacterStream(columnIndex, x, length); } -//------------------------------------------------------------------------------ + void OResultSet::updateNumericObject(sal_Int32 columnIndex, const Any& x, sal_Int32 scale) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNumericObject" ); @@ -814,7 +788,6 @@ void OResultSet::updateNumericObject(sal_Int32 columnIndex, const Any& x, sal_In m_xDelegatorRowUpdate->updateNumericObject(columnIndex, x, scale); } -//------------------------------------------------------------------------------ void OResultSet::updateObject(sal_Int32 columnIndex, const Any& x) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateObject" ); @@ -827,7 +800,6 @@ void OResultSet::updateObject(sal_Int32 columnIndex, const Any& x) throw( SQLExc } // ::com::sun::star::sdbc::XResultSet -//------------------------------------------------------------------------------ sal_Bool OResultSet::next(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::next" ); @@ -837,7 +809,6 @@ sal_Bool OResultSet::next(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->next(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::isBeforeFirst(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isBeforeFirst" ); @@ -847,7 +818,6 @@ sal_Bool OResultSet::isBeforeFirst(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->isBeforeFirst(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::isAfterLast(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isAfterLast" ); @@ -857,7 +827,6 @@ sal_Bool OResultSet::isAfterLast(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->isAfterLast(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::isFirst(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isFirst" ); @@ -867,7 +836,6 @@ sal_Bool OResultSet::isFirst(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->isFirst(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::isLast(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isLast" ); @@ -877,7 +845,6 @@ sal_Bool OResultSet::isLast(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->isLast(); } -//------------------------------------------------------------------------------ void OResultSet::beforeFirst(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::beforeFirst" ); @@ -887,7 +854,6 @@ void OResultSet::beforeFirst(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSet->beforeFirst(); } -//------------------------------------------------------------------------------ void OResultSet::afterLast(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::afterLast" ); @@ -897,7 +863,6 @@ void OResultSet::afterLast(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSet->afterLast(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::first(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::first" ); @@ -907,7 +872,6 @@ sal_Bool OResultSet::first(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->first(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::last(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::last" ); @@ -917,7 +881,6 @@ sal_Bool OResultSet::last(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->last(); } -//------------------------------------------------------------------------------ sal_Int32 OResultSet::getRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRow" ); @@ -927,7 +890,6 @@ sal_Int32 OResultSet::getRow(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->getRow(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::absolute(sal_Int32 row) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::absolute" ); @@ -937,7 +899,6 @@ sal_Bool OResultSet::absolute(sal_Int32 row) throw( SQLException, RuntimeExcepti return m_xDelegatorResultSet->absolute(row); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::relative(sal_Int32 rows) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::relative" ); @@ -947,7 +908,6 @@ sal_Bool OResultSet::relative(sal_Int32 rows) throw( SQLException, RuntimeExcept return m_xDelegatorResultSet->relative(rows); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::previous(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::previous" ); @@ -957,7 +917,6 @@ sal_Bool OResultSet::previous(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->previous(); } -//------------------------------------------------------------------------------ void OResultSet::refreshRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::refreshRow" ); @@ -967,7 +926,6 @@ void OResultSet::refreshRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSet->refreshRow(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::rowUpdated(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowUpdated" ); @@ -977,7 +935,6 @@ sal_Bool OResultSet::rowUpdated(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->rowUpdated(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::rowInserted(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowInserted" ); @@ -987,7 +944,6 @@ sal_Bool OResultSet::rowInserted(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->rowInserted(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::rowDeleted(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowDeleted" ); @@ -997,7 +953,6 @@ sal_Bool OResultSet::rowDeleted(void) throw( SQLException, RuntimeException ) return m_xDelegatorResultSet->rowDeleted(); } -//------------------------------------------------------------------------------ Reference< XInterface > OResultSet::getStatement(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getStatement" ); @@ -1008,7 +963,6 @@ Reference< XInterface > OResultSet::getStatement(void) throw( SQLException, Runt } // ::com::sun::star::sdbcx::XRowLocate -//------------------------------------------------------------------------------ Any OResultSet::getBookmark(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBookmark" ); @@ -1020,7 +974,6 @@ Any OResultSet::getBookmark(void) throw( SQLException, RuntimeException ) return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->getBookmark(); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::moveToBookmark(const Any& bookmark) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToBookmark" ); @@ -1032,19 +985,17 @@ sal_Bool OResultSet::moveToBookmark(const Any& bookmark) throw( SQLException, Ru return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveToBookmark(bookmark); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveRelativeToBookmark" ); MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); - + checkBookmarkable(); return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveRelativeToBookmark(bookmark, rows); } -//------------------------------------------------------------------------------ sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::compareBookmarks" ); @@ -1056,7 +1007,6 @@ sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second) th return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->compareBookmarks(_first, _second); } -//------------------------------------------------------------------------------ sal_Bool OResultSet::hasOrderedBookmarks(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hasOrderedBookmarks" ); @@ -1068,7 +1018,6 @@ sal_Bool OResultSet::hasOrderedBookmarks(void) throw( SQLException, RuntimeExcep return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hasOrderedBookmarks(); } -//------------------------------------------------------------------------------ sal_Int32 OResultSet::hashBookmark(const Any& bookmark) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hashBookmark" ); @@ -1081,7 +1030,6 @@ sal_Int32 OResultSet::hashBookmark(const Any& bookmark) throw( SQLException, Run } // ::com::sun::star::sdbc::XResultSetUpdate -//------------------------------------------------------------------------------ void OResultSet::insertRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::insertRow" ); @@ -1093,7 +1041,6 @@ void OResultSet::insertRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->insertRow(); } -//------------------------------------------------------------------------------ void OResultSet::updateRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateRow" ); @@ -1105,7 +1052,6 @@ void OResultSet::updateRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->updateRow(); } -//------------------------------------------------------------------------------ void OResultSet::deleteRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::deleteRow" ); @@ -1117,7 +1063,6 @@ void OResultSet::deleteRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->deleteRow(); } -//------------------------------------------------------------------------------ void OResultSet::cancelRowUpdates(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::cancelRowUpdates" ); @@ -1129,7 +1074,6 @@ void OResultSet::cancelRowUpdates(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->cancelRowUpdates(); } -//------------------------------------------------------------------------------ void OResultSet::moveToInsertRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToInsertRow" ); @@ -1141,7 +1085,6 @@ void OResultSet::moveToInsertRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->moveToInsertRow(); } -//------------------------------------------------------------------------------ void OResultSet::moveToCurrentRow(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToCurrentRow" ); @@ -1153,7 +1096,6 @@ void OResultSet::moveToCurrentRow(void) throw( SQLException, RuntimeException ) m_xDelegatorResultSetUpdate->moveToCurrentRow(); } -// ----------------------------------------------------------------------------- void OResultSet::checkReadOnly() const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkReadOnly" ); @@ -1163,12 +1105,9 @@ void OResultSet::checkReadOnly() const throwSQLException( "The result set is read-only.", SQL_GENERAL_ERROR, *const_cast< OResultSet* >( this ) ); } -// ----------------------------------------------------------------------------- void OResultSet::checkBookmarkable() const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkBookmarkable" ); if ( !m_bIsBookmarkable ) throwSQLException( "The result set does not have bookmark support.", SQL_GENERAL_ERROR, *const_cast< OResultSet* >( this ) ); } -// ----------------------------------------------------------------------------- - diff --git a/dbaccess/source/core/api/resultset.hxx b/dbaccess/source/core/api/resultset.hxx index 6fc8f31..0063e0b 100644 --- a/dbaccess/source/core/api/resultset.hxx +++ b/dbaccess/source/core/api/resultset.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index 0ec8e9d..74f062e 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,7 +53,6 @@ using namespace dbtools; DBG_NAME(OStatementBase) -//-------------------------------------------------------------------------- OStatementBase::OStatementBase(const Reference< XConnection > & _xConn, const Reference< XInterface > & _xStatement) :OSubComponent(m_aMutex, _xConn) @@ -69,14 +68,12 @@ OStatementBase::OStatementBase(const Reference< XConnection > & _xConn, m_xAggregateAsCancellable = Reference< ::com::sun::star::util::XCancellable > (m_xAggregateAsSet, UNO_QUERY); } -//-------------------------------------------------------------------------- OStatementBase::~OStatementBase() { DBG_DTOR(OStatementBase, NULL); } // com::sun::star::lang::XTypeProvider -//-------------------------------------------------------------------------- Sequence< Type > OStatementBase::getTypes() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getTypes" ); @@ -97,7 +94,6 @@ Sequence< Type > OStatementBase::getTypes() throw (RuntimeException) } // com::sun::star::uno::XInterface -//-------------------------------------------------------------------------- Any OStatementBase::queryInterface( const Type & rType ) throw (RuntimeException) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::queryInterface" ); @@ -127,19 +123,16 @@ Any OStatementBase::queryInterface( const Type & rType ) throw (RuntimeException return aIface; } -//-------------------------------------------------------------------------- void OStatementBase::acquire() throw () { OSubComponent::acquire(); } -//-------------------------------------------------------------------------- void OStatementBase::release() throw () { OSubComponent::release(); } -//------------------------------------------------------------------------------ void OStatementBase::disposeResultSet() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::disposeResultSet" ); @@ -151,7 +144,6 @@ void OStatementBase::disposeResultSet() } // OComponentHelper -//------------------------------------------------------------------------------ void OStatementBase::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::disposing" ); @@ -185,7 +177,6 @@ void OStatementBase::disposing() } // XCloseable -//------------------------------------------------------------------------------ void OStatementBase::close(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::close" ); @@ -197,7 +188,6 @@ void OStatementBase::close(void) throw( SQLException, RuntimeException ) } // OPropertySetHelper -//------------------------------------------------------------------------------ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getPropertySetInfo" ); @@ -205,7 +195,6 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() throw (Runtim } // comphelper::OPropertyArrayUsageHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper* OStatementBase::createArrayHelper( ) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::createArrayHelper" ); @@ -224,14 +213,12 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() throw (Runtim } // cppu::OPropertySetHelper -//------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OStatementBase::getInfoHelper() { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getInfoHelper" ); return *getArrayHelper(); } -//------------------------------------------------------------------------------ sal_Bool OStatementBase::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::convertFastPropertyValue" ); @@ -267,7 +254,6 @@ sal_Bool OStatementBase::convertFastPropertyValue( Any & rConvertedValue, Any & return bModified; } -//------------------------------------------------------------------------------ void OStatementBase::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::setFastPropertyValue_NoBroadcast" ); @@ -298,7 +284,6 @@ void OStatementBase::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const } } -//------------------------------------------------------------------------------ void OStatementBase::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getFastPropertyValue" ); @@ -326,7 +311,6 @@ void OStatementBase::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons } // XWarningsSupplier -//------------------------------------------------------------------------------ Any OStatementBase::getWarnings(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getWarnings" ); @@ -336,7 +320,6 @@ Any OStatementBase::getWarnings(void) throw( SQLException, RuntimeException ) return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY)->getWarnings(); } -//------------------------------------------------------------------------------ void OStatementBase::clearWarnings(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::clearWarnings" ); @@ -347,7 +330,6 @@ void OStatementBase::clearWarnings(void) throw( SQLException, RuntimeException ) } // ::com::sun::star::util::XCancellable -//------------------------------------------------------------------------------ void OStatementBase::cancel(void) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::cancel" ); @@ -359,7 +341,6 @@ void OStatementBase::cancel(void) throw( RuntimeException ) } // XMultipleResults -//------------------------------------------------------------------------------ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getResultSet" ); @@ -374,7 +355,6 @@ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( ) throw(SQLExcep return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getResultSet(); } -//------------------------------------------------------------------------------ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getUpdateCount" ); @@ -389,7 +369,6 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) throw(SQLException, Runtim return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getUpdateCount(); } -//------------------------------------------------------------------------------ sal_Bool SAL_CALL OStatementBase::getMoreResults( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getMoreResults" ); @@ -409,7 +388,6 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults( ) throw(SQLException, Runtime } // XPreparedBatchExecution -//------------------------------------------------------------------------------ void SAL_CALL OStatementBase::addBatch( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::addBatch" ); @@ -424,7 +402,6 @@ void SAL_CALL OStatementBase::addBatch( ) throw(SQLException, RuntimeException) Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch(); } -//------------------------------------------------------------------------------ void SAL_CALL OStatementBase::clearBatch( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::clearBatch" ); @@ -439,7 +416,6 @@ void SAL_CALL OStatementBase::clearBatch( ) throw(SQLException, RuntimeExceptio Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch(); } -//------------------------------------------------------------------------------ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::executeBatch" ); @@ -456,7 +432,7 @@ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) throw(SQLExcepti return Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch(); } -// ----------------------------------------------------------------------------- + Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatementBase::getGeneratedValues" ); @@ -472,7 +448,6 @@ Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( ) throw (S //************************************************************ // OStatement //************************************************************ -//------------------------------------------------------------------------------ OStatement::OStatement( const Reference< XConnection >& _xConn, const Reference< XInterface > & _xStatement ) :OStatementBase( _xConn, _xStatement ) ,m_bAttemptedComposerCreation( false ) @@ -481,26 +456,22 @@ OStatement::OStatement( const Reference< XConnection >& _xConn, const Reference< m_xAggregateStatement.set( _xStatement, UNO_QUERY_THROW ); } -//------------------------------------------------------------------------------ IMPLEMENT_FORWARD_XINTERFACE2( OStatement, OStatementBase, OStatement_IFACE ); IMPLEMENT_FORWARD_XTYPEPROVIDER2( OStatement, OStatementBase, OStatement_IFACE ); // XServiceInfo -//------------------------------------------------------------------------------ rtl::OUString OStatement::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::getImplementationName" ); return rtl::OUString::createFromAscii("com.sun.star.sdb.OStatement"); } -//------------------------------------------------------------------------------ sal_Bool OStatement::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::supportsService" ); return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } -//------------------------------------------------------------------------------ Sequence< ::rtl::OUString > OStatement::getSupportedServiceNames( ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::getSupportedServiceNames" ); @@ -510,7 +481,6 @@ Sequence< ::rtl::OUString > OStatement::getSupportedServiceNames( ) throw (Runt } // XStatement -//------------------------------------------------------------------------------ Reference< XResultSet > OStatement::executeQuery( const rtl::OUString& _rSQL ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::executeQuery" ); @@ -538,7 +508,6 @@ Reference< XResultSet > OStatement::executeQuery( const rtl::OUString& _rSQL ) t return xResultSet; } -//------------------------------------------------------------------------------ sal_Int32 OStatement::executeUpdate( const rtl::OUString& _rSQL ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::executeUpdate" ); @@ -551,7 +520,6 @@ sal_Int32 OStatement::executeUpdate( const rtl::OUString& _rSQL ) throw( SQLExce return m_xAggregateStatement->executeUpdate( sSQL ); } -//------------------------------------------------------------------------------ sal_Bool OStatement::execute( const rtl::OUString& _rSQL ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::execute" ); @@ -563,7 +531,7 @@ sal_Bool OStatement::execute( const rtl::OUString& _rSQL ) throw( SQLException, ::rtl::OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) ); return m_xAggregateStatement->execute( sSQL ); } -//------------------------------------------------------------------------------ + void OStatement::addBatch( const rtl::OUString& _rSQL ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::execute" ); @@ -578,7 +546,7 @@ void OStatement::addBatch( const rtl::OUString& _rSQL ) throw( SQLException, Run ::rtl::OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) ); Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch( sSQL ); } -//------------------------------------------------------------------------------ + void OStatement::clearBatch( ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::execute" ); @@ -591,7 +559,7 @@ void OStatement::clearBatch( ) throw( SQLException, RuntimeException ) Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch(); } -//------------------------------------------------------------------------------ + Sequence< sal_Int32 > OStatement::executeBatch( ) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::execute" ); @@ -604,14 +572,13 @@ Sequence< sal_Int32 > OStatement::executeBatch( ) throw( SQLException, RuntimeEx return Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch( ); } -//------------------------------------------------------------------------------ + Reference< XConnection > OStatement::getConnection(void) throw( SQLException, RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::getConnection" ); return Reference< XConnection >( m_xParent, UNO_QUERY ); } -// ----------------------------------------------------------------------------- void SAL_CALL OStatement::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::disposing" ); @@ -620,7 +587,6 @@ void SAL_CALL OStatement::disposing() m_xAggregateStatement.clear(); } -// ----------------------------------------------------------------------------- ::rtl::OUString OStatement::impl_doEscapeProcessing_nothrow( const ::rtl::OUString& _rSQL ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::impl_doEscapeProcessing_nothrow" ); @@ -634,7 +600,7 @@ void SAL_CALL OStatement::disposing() bool bParseable = false; try { m_xComposer->setQuery( _rSQL ); bParseable = true; } catch( const SQLException& ) { } - + if ( !bParseable ) // if we cannot parse it, silently accept this. The driver is probably able to cope with it then return _rSQL; @@ -650,7 +616,6 @@ void SAL_CALL OStatement::disposing() return _rSQL; } -// ----------------------------------------------------------------------------- bool OStatement::impl_ensureComposer_nothrow() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStatement::impl_ensureComposer_nothrow" ); diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx index 62ca29b..5f31d35 100644 --- a/dbaccess/source/core/api/table.cxx +++ b/dbaccess/source/core/api/table.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,13 +75,13 @@ typedef ::std::map > OColMap; //= ODBTable //========================================================================== DBG_NAME(ODBTable) -//-------------------------------------------------------------------------- + ODBTable::ODBTable(connectivity::sdbcx::OCollection* _pTables ,const Reference< XConnection >& _rxConn ,const ::rtl::OUString& _rCatalog - ,const ::rtl::OUString& _rSchema + ,const ::rtl::OUString& _rSchema ,const ::rtl::OUString& _rName - ,const ::rtl::OUString& _rType + ,const ::rtl::OUString& _rType ,const ::rtl::OUString& _rDesc ,const Reference< XNameAccess >& _xColumnDefinitions) throw(SQLException) :OTable_Base(_pTables,_rxConn,_rxConn->getMetaData().is() && _rxConn->getMetaData()->supportsMixedCaseQuotedIdentifiers(), _rName, _rType, _rDesc, _rSchema, _rCatalog ) @@ -97,25 +97,24 @@ ODBTable::ODBTable(connectivity::sdbcx::OCollection* _pTables // ODBC driver does not allow more than one statement per connection, and in getFastPropertyValue it's more // likely that it's already used up than it's here.) } -// ----------------------------------------------------------------------------- + ODBTable::ODBTable(connectivity::sdbcx::OCollection* _pTables ,const Reference< XConnection >& _rxConn) - throw(SQLException) + throw(SQLException) :OTable_Base(_pTables,_rxConn, _rxConn->getMetaData().is() && _rxConn->getMetaData()->supportsMixedCaseQuotedIdentifiers()) ,m_nPrivileges(-1) { DBG_CTOR(ODBTable, NULL); RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::ODBTable" ); } -// ------------------------------------------------------------------------- + ODBTable::~ODBTable() { DBG_DTOR(ODBTable, NULL); } -// ----------------------------------------------------------------------------- + IMPLEMENT_FORWARD_REFCOUNT(ODBTable,OTable_Base) -//-------------------------------------------------------------------------- OColumn* ODBTable::createColumn(const ::rtl::OUString& _rName) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createColumn" ); @@ -139,13 +138,13 @@ OColumn* ODBTable::createColumn(const ::rtl::OUString& _rName) const return pReturn; } -// ----------------------------------------------------------------------------- + void ODBTable::columnAppended( const Reference< XPropertySet >& /*_rxSourceDescriptor*/ ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::columnAppended" ); // not interested in } -// ----------------------------------------------------------------------------- + void ODBTable::columnDropped(const ::rtl::OUString& _sName) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::columnDropped" ); @@ -155,7 +154,7 @@ void ODBTable::columnDropped(const ::rtl::OUString& _sName) xDrop->dropByName(_sName); } } -//-------------------------------------------------------------------------- + Sequence< sal_Int8 > ODBTable::getImplementationId() throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getImplementationId" ); @@ -173,7 +172,6 @@ Sequence< sal_Int8 > ODBTable::getImplementationId() throw (RuntimeException) } // OComponentHelper -//------------------------------------------------------------------------------ void SAL_CALL ODBTable::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::disposing" ); @@ -184,7 +182,6 @@ void SAL_CALL ODBTable::disposing() m_pColumnMediator = NULL; } -//------------------------------------------------------------------------------ void ODBTable::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getFastPropertyValue" ); @@ -195,12 +192,12 @@ void ODBTable::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const OTable_Base::getFastPropertyValue(_rValue, _nHandle); } -// ------------------------------------------------------------------------- + void ODBTable::construct() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::construct" ); ::osl::MutexGuard aGuard(m_aMutex); - + // we don't collect the privileges here, this is potentially expensive. Instead we determine them on request. // (see getFastPropertyValue) m_nPrivileges = -1; @@ -227,10 +224,10 @@ void ODBTable::construct() registerProperty(PROPERTY_PRIVILEGES, PROPERTY_ID_PRIVILEGES, PropertyAttribute::BOUND | PropertyAttribute::READONLY, &m_nPrivileges, ::getCppuType(static_cast(NULL))); - + registerMayBeVoidProperty(PROPERTY_TEXTLINECOLOR, PROPERTY_ID_TEXTLINECOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID, &m_aTextLineColor, ::getCppuType(static_cast(NULL))); - + registerProperty(PROPERTY_TEXTEMPHASIS, PROPERTY_ID_TEXTEMPHASIS, PropertyAttribute::BOUND, &m_nFontEmphasis, ::getCppuType(&m_nFontEmphasis)); @@ -256,7 +253,7 @@ void ODBTable::construct() refreshColumns(); } -// ----------------------------------------------------------------------------- + ::cppu::IPropertyArrayHelper* ODBTable::createArrayHelper( sal_Int32 _nId) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createArrayHelper" ); @@ -278,18 +275,18 @@ void ODBTable::construct() pIter->Attributes = PropertyAttribute::READONLY; } } - - return new ::cppu::OPropertyArrayHelper(aProps); + + return new ::cppu::OPropertyArrayHelper(aProps); } -// ----------------------------------------------------------------------------- -::cppu::IPropertyArrayHelper & SAL_CALL ODBTable::getInfoHelper() -{ + +::cppu::IPropertyArrayHelper & SAL_CALL ODBTable::getInfoHelper() +{ return *ODBTable_PROP::getArrayHelper(isNew() ? 1 : 0); } -// ------------------------------------------------------------------------- + // XServiceInfo IMPLEMENT_SERVICE_INFO1(ODBTable, "com.sun.star.sdb.dbaccess.ODBTable", SERVICE_SDBCX_TABLE) -// ------------------------------------------------------------------------- + Any SAL_CALL ODBTable::queryInterface( const Type & rType ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getInfoHelper" ); @@ -299,7 +296,7 @@ Any SAL_CALL ODBTable::queryInterface( const Type & rType ) throw(RuntimeExcepti return Any(); return OTable_Base::queryInterface( rType); } -// ------------------------------------------------------------------------- + Sequence< Type > SAL_CALL ODBTable::getTypes( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getTypes" ); @@ -308,7 +305,7 @@ Sequence< Type > SAL_CALL ODBTable::getTypes( ) throw(RuntimeException) Sequence< Type > aTypes(OTable_Base::getTypes()); ::std::vector aOwnTypes; - aOwnTypes.reserve(aTypes.getLength()); + aOwnTypes.reserve(aTypes.getLength()); const Type* pIter = aTypes.getConstArray(); const Type* pEnd = pIter + aTypes.getLength(); @@ -317,12 +314,12 @@ Sequence< Type > SAL_CALL ODBTable::getTypes( ) throw(RuntimeException) if( (*pIter != aRenameType || getRenameService().is()) && (*pIter != aAlterType || getAlterService().is())) aOwnTypes.push_back(*pIter); } - + Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0]; return Sequence< Type >(pTypes, aOwnTypes.size()); } + // XRename, -//------------------------------------------------------------------------------ void SAL_CALL ODBTable::rename( const ::rtl::OUString& _rNewName ) throw(SQLException, ElementExistException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::rename" ); @@ -337,7 +334,6 @@ void SAL_CALL ODBTable::rename( const ::rtl::OUString& _rNewName ) throw(SQLExce } // XAlterTable, -//------------------------------------------------------------------------------ void SAL_CALL ODBTable::alterColumnByName( const ::rtl::OUString& _rName, const Reference< XPropertySet >& _rxDescriptor ) throw(SQLException, NoSuchElementException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::alterColumnByName" ); @@ -353,7 +349,7 @@ void SAL_CALL ODBTable::alterColumnByName( const ::rtl::OUString& _rName, const getAlterService()->alterColumnByName(xTable,_rName,_rxDescriptor); m_pColumns->refresh(); } -// ----------------------------------------------------------------------------- + sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getSomething" ); @@ -365,7 +361,7 @@ sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId ) thr return nRet; } -// ----------------------------------------------------------------------------- + Sequence< sal_Int8 > ODBTable::getUnoTunnelImplementationId() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::getUnoTunnelImplementationId" ); @@ -381,13 +377,13 @@ Sequence< sal_Int8 > ODBTable::getUnoTunnelImplementationId() } return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- + Reference< XPropertySet > ODBTable::createColumnDescriptor() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createColumnDescriptor" ); return new OTableColumnDescriptor( true ); } -// ----------------------------------------------------------------------------- + sdbcx::OCollection* ODBTable::createColumns(const TStringVector& _rNames) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createColumns" ); @@ -401,16 +397,15 @@ sdbcx::OCollection* ODBTable::createColumns(const TStringVector& _rNames) pCol->setMediator( m_pColumnMediator.get() ); return pCol; } -// ----------------------------------------------------------------------------- + sdbcx::OCollection* ODBTable::createKeys(const TStringVector& _rNames) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createKeys" ); return new connectivity::OKeysHelper(this,m_aMutex,_rNames); } -// ----------------------------------------------------------------------------- + sdbcx::OCollection* ODBTable::createIndexes(const TStringVector& _rNames) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::createIndexes" ); return new OIndexes(this,m_aMutex,_rNames,NULL); } -// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index ab63265..04c4cfb 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -109,8 +109,8 @@ namespace //= OTableContainer //========================================================================== DBG_NAME(OTableContainer) -//------------------------------------------------------------------------------ -OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, + +OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const Reference< XConnection >& _xCon, sal_Bool _bCase, @@ -122,11 +122,10 @@ OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, ,m_xTableDefinitions(_xTableDefinitions) ,m_pTableMediator( NULL ) ,m_bInDrop(sal_False) -{ +{ DBG_CTOR(OTableContainer, NULL); } -//------------------------------------------------------------------------------ OTableContainer::~OTableContainer() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::OTableContainer" ); @@ -134,7 +133,6 @@ OTableContainer::~OTableContainer() DBG_DTOR(OTableContainer, NULL); } -// ----------------------------------------------------------------------------- void OTableContainer::removeMasterContainerListener() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::removeMasterContainerListener" ); @@ -149,19 +147,15 @@ void OTableContainer::removeMasterContainerListener() } } -// ----------------------------------------------------------------------------- ::rtl::OUString OTableContainer::getTableTypeRestriction() const { // no restriction at all (other than the ones provided externally) return ::rtl::OUString(); } -// ----------------------------------------------------------------------------- // XServiceInfo -//------------------------------------------------------------------------------ IMPLEMENT_SERVICE_INFO2(OTableContainer, "com.sun.star.sdb.dbaccess.OTableContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES) -// ----------------------------------------------------------------------------- namespace { void lcl_createDefintionObject(const ::rtl::OUString& _rName @@ -188,12 +182,12 @@ void lcl_createDefintionObject(const ::rtl::OUString& _rName } Reference xColumnsSupplier(_xTableDefinition,UNO_QUERY); if ( xColumnsSupplier.is() ) - _xColumnDefinitions = xColumnsSupplier->getColumns(); + _xColumnDefinitions = xColumnsSupplier->getColumns(); } } -// ------------------------------------------------------------------------- + } -// ------------------------------------------------------------------------- + connectivity::sdbcx::ObjectType OTableContainer::createObject(const ::rtl::OUString& _rName) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::createObject" ); @@ -207,7 +201,7 @@ connectivity::sdbcx::ObjectType OTableContainer::createObject(const ::rtl::OUStr Reference xTableDefinition; Reference xColumnDefinitions; lcl_createDefintionObject(_rName,m_xTableDefinitions,xTableDefinition,xColumnDefinitions,sal_False); - + if ( xSup.is() ) { ODBTableDecorator* pTable = new ODBTableDecorator( m_xConnection, xSup, ::dbtools::getNumberFormats( m_xConnection ) ,xColumnDefinitions); @@ -219,8 +213,8 @@ connectivity::sdbcx::ObjectType OTableContainer::createObject(const ::rtl::OUStr ::rtl::OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_xMetaData, _rName, - sCatalog, - sSchema, + sCatalog, + sSchema, sTable, ::dbtools::eInDataManipulation); Any aCatalog; @@ -262,10 +256,10 @@ connectivity::sdbcx::ObjectType OTableContainer::createObject(const ::rtl::OUStr if ( m_pTableMediator.is() ) m_pTableMediator->notifyElementCreated(_rName,xDest); } - + return xRet; } -// ----------------------------------------------------------------------------- + Reference< XPropertySet > OTableContainer::createDescriptor() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::createDescriptor" ); @@ -290,7 +284,7 @@ Reference< XPropertySet > OTableContainer::createDescriptor() } return xRet; } -// ----------------------------------------------------------------------------- + // XAppend ObjectType OTableContainer::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { @@ -378,7 +372,7 @@ ObjectType OTableContainer::appendObject( const ::rtl::OUString& _rForName, cons return createObject( _rForName ); } -// ------------------------------------------------------------------------- + // XDrop void OTableContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) { @@ -414,7 +408,7 @@ void OTableContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElement ::dbtools::throwFunctionSequenceException(static_cast(static_cast(this))); ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP "); - + if ( bIsView ) // here we have a view aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW ")); else @@ -443,7 +437,7 @@ void OTableContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElement } m_bInDrop = sal_False; } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableContainer::elementInserted( const ContainerEvent& Event ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::elementInserted" ); @@ -462,12 +456,12 @@ void SAL_CALL OTableContainer::elementInserted( const ContainerEvent& Event ) th } } } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableContainer::elementRemoved( const ContainerEvent& /*Event*/ ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::elementRemoved" ); } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableContainer::elementReplaced( const ContainerEvent& Event ) throw (RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::elementReplaced" ); @@ -476,11 +470,11 @@ void SAL_CALL OTableContainer::elementReplaced( const ContainerEvent& Event ) th ::rtl::OUString sOldComposedName,sNewComposedName; Event.ReplacedElement >>= sOldComposedName; Event.Accessor >>= sNewComposedName; - + renameObject(sOldComposedName,sNewComposedName); } } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableContainer::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::disposing" ); @@ -489,13 +483,12 @@ void SAL_CALL OTableContainer::disposing() m_xTableDefinitions = NULL; m_pTableMediator = NULL; } -// ----------------------------------------------------------------------------- + void SAL_CALL OTableContainer::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::disposing" ); } -// ----------------------------------------------------------------------------- void OTableContainer::addMasterContainerListener() { try @@ -508,4 +501,3 @@ void OTableContainer::addMasterContainerListener() DBG_UNHANDLED_EXCEPTION(); } } - diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 42412aa..5ba7594 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -72,7 +72,7 @@ using namespace ::connectivity::sdbcx; //= OViewContainer //========================================================================== DBG_NAME(OViewContainer) -//------------------------------------------------------------------------------ + OViewContainer::OViewContainer(::cppu::OWeakObject& _rParent ,::osl::Mutex& _rMutex ,const Reference< XConnection >& _xCon @@ -86,17 +86,15 @@ OViewContainer::OViewContainer(::cppu::OWeakObject& _rParent DBG_CTOR(OViewContainer, NULL); } -//------------------------------------------------------------------------------ OViewContainer::~OViewContainer() { // dispose(); DBG_DTOR(OViewContainer, NULL); } -//------------------------------------------------------------------------------ + // XServiceInfo -//------------------------------------------------------------------------------ IMPLEMENT_SERVICE_INFO2(OViewContainer, "com.sun.star.sdb.dbaccess.OViewContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES) -// ----------------------------------------------------------------------------- + ObjectType OViewContainer::createObject(const ::rtl::OUString& _rName) { ObjectType xProp; @@ -108,8 +106,8 @@ ObjectType OViewContainer::createObject(const ::rtl::OUString& _rName) ::rtl::OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_xMetaData, _rName, - sCatalog, - sSchema, + sCatalog, + sSchema, sTable, ::dbtools::eInDataManipulation); return new View(m_xConnection, @@ -122,7 +120,7 @@ ObjectType OViewContainer::createObject(const ::rtl::OUString& _rName) return xProp; } -// ----------------------------------------------------------------------------- + Reference< XPropertySet > OViewContainer::createDescriptor() { Reference< XPropertySet > xRet; @@ -137,7 +135,7 @@ Reference< XPropertySet > OViewContainer::createDescriptor() return xRet; } -// ----------------------------------------------------------------------------- + // XAppend ObjectType OViewContainer::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& descriptor ) { @@ -181,7 +179,7 @@ ObjectType OViewContainer::appendObject( const ::rtl::OUString& _rForName, const return createObject( _rForName ); } -// ------------------------------------------------------------------------- + // XDrop void OViewContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName) { @@ -221,7 +219,7 @@ void OViewContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementN } } } -// ----------------------------------------------------------------------------- + void SAL_CALL OViewContainer::elementInserted( const ContainerEvent& Event ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_rMutex); @@ -238,7 +236,7 @@ void SAL_CALL OViewContainer::elementInserted( const ContainerEvent& Event ) thr insertElement(sName,createObject(sName)); } } -// ----------------------------------------------------------------------------- + void SAL_CALL OViewContainer::elementRemoved( const ContainerEvent& Event ) throw (RuntimeException) { ::osl::MutexGuard aGuard(m_rMutex); @@ -258,15 +256,15 @@ void SAL_CALL OViewContainer::elementRemoved( const ContainerEvent& Event ) thro m_bInElementRemoved = false; } } -// ----------------------------------------------------------------------------- + void SAL_CALL OViewContainer::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (RuntimeException) { } -// ----------------------------------------------------------------------------- + void SAL_CALL OViewContainer::elementReplaced( const ContainerEvent& /*Event*/ ) throw (RuntimeException) { } -// ----------------------------------------------------------------------------- + ::rtl::OUString OViewContainer::getTableTypeRestriction() const { // no restriction at all (other than the ones provided externally) -- 1.7.1