LCOV - code coverage report
Current view: top level - dbaccess/source/core/api - RowSetBase.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 474 623 76.1 %
Date: 2012-08-25 Functions: 67 97 69.1 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 507 1245 40.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : 
      20                 :            : 
      21                 :            : #include "RowSetBase.hxx"
      22                 :            : #include "CRowSetDataColumn.hxx"
      23                 :            : #include <connectivity/sdbcx/VCollection.hxx>
      24                 :            : #include "RowSetCache.hxx"
      25                 :            : #include "dbastrings.hrc"
      26                 :            : #include "core_resource.hrc"
      27                 :            : #include <com/sun/star/lang/DisposedException.hpp>
      28                 :            : #include <com/sun/star/beans/PropertyAttribute.hpp>
      29                 :            : #include <com/sun/star/sdbcx/CompareBookmark.hpp>
      30                 :            : #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
      31                 :            : #include <com/sun/star/lang/Locale.hpp>
      32                 :            : #include <com/sun/star/util/NumberFormat.hpp>
      33                 :            : #include <comphelper/sequence.hxx>
      34                 :            : #include <comphelper/extract.hxx>
      35                 :            : #include <comphelper/seqstream.hxx>
      36                 :            : #include <connectivity/dbexception.hxx>
      37                 :            : #include <osl/thread.h>
      38                 :            : #include <tools/debug.hxx>
      39                 :            : #include <rtl/logfile.hxx>
      40                 :            : 
      41                 :            : using namespace dbaccess;
      42                 :            : using namespace connectivity;
      43                 :            : using namespace connectivity::sdbcx;
      44                 :            : using namespace comphelper;
      45                 :            : using namespace dbtools;
      46                 :            : using namespace ::com::sun::star::uno;
      47                 :            : using namespace ::com::sun::star::beans;
      48                 :            : using namespace ::com::sun::star::sdbc;
      49                 :            : using namespace ::com::sun::star::sdb;
      50                 :            : using namespace ::com::sun::star::sdbcx;
      51                 :            : using namespace ::com::sun::star::container;
      52                 :            : using namespace ::com::sun::star::lang;
      53                 :            : using namespace ::com::sun::star::util;
      54                 :            : using namespace ::cppu;
      55                 :            : using namespace ::osl;
      56                 :            : 
      57                 :            : namespace dbaccess
      58                 :            : {
      59                 :            : 
      60                 :            : // =========================================================================
      61                 :            : // = OEmptyCollection
      62                 :            : // =========================================================================
      63         [ #  # ]:          0 : class OEmptyCollection : public sdbcx::OCollection
      64                 :            : {
      65                 :            : protected:
      66                 :            :     virtual void impl_refresh() throw(RuntimeException);
      67                 :            :     virtual connectivity::sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
      68                 :            : public:
      69         [ #  # ]:          0 :     OEmptyCollection(::cppu::OWeakObject& _rParent,::osl::Mutex& _rMutex) : OCollection(_rParent,sal_True,_rMutex,::std::vector< ::rtl::OUString>()){}
      70                 :            : };
      71                 :            : 
      72                 :          0 : void OEmptyCollection::impl_refresh() throw(RuntimeException)
      73                 :            : {
      74                 :          0 : }
      75                 :            : 
      76                 :          0 : connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const ::rtl::OUString& /*_rName*/)
      77                 :            : {
      78                 :          0 :     return connectivity::sdbcx::ObjectType();
      79                 :            : }
      80                 :            : 
      81                 :            : // =========================================================================
      82                 :            : // = ORowSetBase
      83                 :            : // =========================================================================
      84                 :            : DBG_NAME(ORowSetBase)
      85                 :            : 
      86                 :        308 : ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex )
      87                 :            :     :OPropertyStateContainer(_rBHelper)
      88                 :            :     ,m_pMutex(_pMutex)
      89                 :            :     ,m_pCache(NULL)
      90                 :            :     ,m_pColumns(NULL)
      91                 :            :     ,m_rBHelper(_rBHelper)
      92                 :            :     ,m_pEmptyCollection( NULL )
      93                 :            :     ,m_aContext( _rContext )
      94                 :            :     ,m_aErrors( _rContext )
      95                 :            :     ,m_nLastColumnIndex(-1)
      96                 :            :     ,m_nDeletedPosition(-1)
      97                 :            :     ,m_nResultSetType( ResultSetType::FORWARD_ONLY )
      98                 :            :     ,m_nResultSetConcurrency( ResultSetConcurrency::READ_ONLY )
      99                 :            :     ,m_bClone(sal_False)
     100                 :            :     ,m_bIgnoreResult(sal_False)
     101                 :            :     ,m_bBeforeFirst(sal_True) // changed from sal_False
     102                 :            :     ,m_bAfterLast(sal_False)
     103 [ +  - ][ +  - ]:        308 :     ,m_bIsInsertRow(sal_False)
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     104                 :            : {
     105                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::ORowSetBase" );
     106                 :            :     DBG_CTOR(ORowSetBase,NULL);
     107                 :            : 
     108                 :        308 :     sal_Int32 nRBT  = PropertyAttribute::READONLY   | PropertyAttribute::BOUND      | PropertyAttribute::TRANSIENT;
     109                 :            : 
     110                 :        308 :     sal_Int32 nInitialRowCountValue = 0;
     111                 :        308 :     sal_Bool bInitialRowCountFinalValue( sal_False );
     112 [ +  - ][ +  - ]:        308 :     registerPropertyNoMember( PROPERTY_ROWCOUNT,        PROPERTY_ID_ROWCOUNT,        nRBT, ::getCppuType( &nInitialRowCountValue ), &nInitialRowCountValue );
                 [ +  - ]
     113 [ +  - ][ +  - ]:        308 :     registerPropertyNoMember( PROPERTY_ISROWCOUNTFINAL, PROPERTY_ID_ISROWCOUNTFINAL, nRBT, ::getBooleanCppuType(),                  &bInitialRowCountFinalValue );
                 [ +  - ]
     114                 :        308 : }
     115                 :            : 
     116 [ +  - ][ +  - ]:        301 : ORowSetBase::~ORowSetBase()
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     117                 :            : {
     118         [ +  + ]:        301 :     if(m_pColumns)
     119                 :            :     {
     120         [ +  - ]:         32 :         TDataColumns().swap(m_aDataColumns);
     121                 :         32 :         m_pColumns->acquire();
     122         [ +  - ]:         32 :         m_pColumns->disposing();
     123 [ +  - ][ +  - ]:         32 :         delete m_pColumns;
     124                 :         32 :         m_pColumns = NULL;
     125                 :            :     }
     126                 :            : 
     127         [ -  + ]:        301 :     if ( m_pEmptyCollection )
     128 [ #  # ][ #  # ]:          0 :         delete m_pEmptyCollection;
     129                 :            : 
     130                 :            :     DBG_DTOR(ORowSetBase,NULL);
     131         [ -  + ]:        301 : }
     132                 :            : 
     133                 :            : // com::sun::star::lang::XTypeProvider
     134                 :          2 : Sequence< Type > ORowSetBase::getTypes() throw (RuntimeException)
     135                 :            : {
     136                 :            :     //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTypes" );
     137 [ +  - ][ +  - ]:          2 :     return ::comphelper::concatSequences(ORowSetBase_BASE::getTypes(),OPropertyStateContainer::getTypes());
                 [ +  - ]
     138                 :            : }
     139                 :            : 
     140                 :            : // com::sun::star::uno::XInterface
     141                 :       5714 : Any ORowSetBase::queryInterface( const Type & rType ) throw (RuntimeException)
     142                 :            : {
     143                 :            :     //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::queryInterface" );
     144                 :       5714 :     Any aRet = ORowSetBase_BASE::queryInterface(rType);
     145         [ +  + ]:       5714 :     if(!aRet.hasValue())
     146         [ +  - ]:       4310 :         aRet = OPropertyStateContainer::queryInterface(rType);
     147                 :       5714 :     return aRet;
     148                 :            : }
     149                 :            : 
     150                 :       1122 : void SAL_CALL ORowSetBase::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
     151                 :            : {
     152                 :            :     //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getFastPropertyValue" );
     153         [ +  + ]:       1122 :     if(m_pCache)
     154                 :            :     {
     155      [ +  +  + ]:        642 :         switch(nHandle)
     156                 :            :         {
     157                 :            :         case PROPERTY_ID_ROWCOUNT:
     158         [ +  - ]:         49 :             rValue <<= impl_getRowCount();
     159                 :         49 :             break;
     160                 :            :         case PROPERTY_ID_ISROWCOUNTFINAL:
     161                 :          8 :             rValue.setValue(&m_pCache->m_bRowCountFinal,::getCppuBooleanType());
     162                 :          8 :             break;
     163                 :            :         default:
     164                 :        642 :             OPropertyStateContainer::getFastPropertyValue(rValue,nHandle);
     165                 :            :         };
     166                 :            :     }
     167                 :            :     else
     168                 :        480 :         OPropertyStateContainer::getFastPropertyValue(rValue,nHandle);
     169                 :       1122 : }
     170                 :            : 
     171                 :            : // OComponentHelper
     172                 :        304 : void SAL_CALL ORowSetBase::disposing(void)
     173                 :            : {
     174                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::disposing" );
     175         [ +  - ]:        304 :     MutexGuard aGuard(*m_pMutex);
     176                 :            : 
     177         [ +  + ]:        304 :     if ( m_pColumns )
     178                 :            :     {
     179         [ +  - ]:         32 :         TDataColumns().swap(m_aDataColumns);
     180         [ +  - ]:         32 :         m_pColumns->disposing();
     181                 :            :     }
     182         [ +  + ]:        304 :     if ( m_pCache )
     183                 :            :     {
     184         [ +  - ]:          4 :         m_pCache->deregisterOldRow(m_aOldRow);
     185         [ +  - ]:          4 :         m_pCache->deleteIterator(this);
     186                 :            :     }
     187         [ +  - ]:        304 :     m_pCache = NULL;
     188                 :        304 : }
     189                 :            : 
     190                 :            : // comphelper::OPropertyArrayUsageHelper
     191                 :          0 : ::cppu::IPropertyArrayHelper* ORowSetBase::createArrayHelper( ) const
     192                 :            : {
     193                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::createArrayHelper" );
     194         [ #  # ]:          0 :     Sequence< Property > aProps;
     195         [ #  # ]:          0 :     describeProperties(aProps);
     196 [ #  # ][ #  # ]:          0 :     return new ::cppu::OPropertyArrayHelper(aProps);
     197                 :            : }
     198                 :            : 
     199                 :            : // cppu::OPropertySetHelper
     200                 :          0 : ::cppu::IPropertyArrayHelper& SAL_CALL ORowSetBase::getInfoHelper()
     201                 :            : {
     202                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getInfoHelper" );
     203                 :          0 :     return *const_cast<ORowSetBase*>(this)->getArrayHelper();
     204                 :            : }
     205                 :            : 
     206                 :            : // XRow
     207                 :       1054 : sal_Bool SAL_CALL ORowSetBase::wasNull(  ) throw(SQLException, RuntimeException)
     208                 :            : {
     209                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::wasNull" );
     210         [ +  - ]:       1054 :     ::osl::MutexGuard aGuard( *m_pMutex );
     211         [ +  - ]:       1054 :     checkCache();
     212 [ +  - ][ +  - ]:       1054 :     return impl_wasNull();
     213                 :            : }
     214                 :            : 
     215                 :       1054 : sal_Bool ORowSetBase::impl_wasNull()
     216                 :            : {
     217                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_wasNull" );
     218 [ +  - ][ +  - ]:       1054 :     return ((m_nLastColumnIndex != -1) && !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is()) ? ((*m_aCurrentRow)->get())[m_nLastColumnIndex].isNull() : sal_True;
         [ +  - ][ +  - ]
     219                 :            : }
     220                 :            : 
     221                 :       1594 : const ORowSetValue& ORowSetBase::getValue(sal_Int32 columnIndex)
     222                 :            : {
     223                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getValue" );
     224                 :       1594 :     checkCache();
     225                 :       1594 :     return impl_getValue(columnIndex);
     226                 :            : }
     227                 :            : 
     228                 :       1594 : const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
     229                 :            : {
     230                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getValue" );
     231 [ +  - ][ -  + ]:       1594 :     if ( m_bBeforeFirst || m_bAfterLast )
     232                 :            :     {
     233                 :            :         OSL_FAIL("ORowSetBase::getValue: Illegal call here (we're before first or after last)!");
     234 [ #  # ][ #  # ]:          0 :         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf );
     235                 :            :     }
     236                 :            : 
     237         [ -  + ]:       1594 :     if ( impl_rowDeleted() )
     238                 :            :     {
     239                 :          0 :         return m_aEmptyValue;
     240                 :            :     }
     241                 :            : 
     242 [ +  - ][ +  - ]:       1594 :     bool bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() );
                 [ +  - ]
     243         [ -  + ]:       1594 :     if ( !bValidCurrentRow )
     244                 :            :     {
     245                 :            :         // currentrow is null when the clone moves the window
     246                 :          0 :         positionCache( MOVE_NONE_REFRESH_ONLY );
     247                 :          0 :         m_aCurrentRow   = m_pCache->m_aMatrixIter;
     248                 :          0 :         m_bIsInsertRow  = sal_False;
     249                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getValue: we don't stand on a valid row! Row is null.");
     250                 :            : 
     251 [ #  # ][ #  # ]:          0 :         bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() );
                 [ #  # ]
     252                 :            :     }
     253                 :            : 
     254         [ +  - ]:       1594 :     if ( bValidCurrentRow )
     255                 :            :     {
     256                 :            : #if OSL_DEBUG_LEVEL > 0
     257                 :            :         ORowSetMatrix::iterator aCacheEnd;
     258                 :            :         ORowSetMatrix::iterator aCurrentRow;
     259                 :            :         aCacheEnd = m_pCache->getEnd();
     260                 :            :         aCurrentRow = m_aCurrentRow;
     261                 :            :         ORowSetCacheMap::iterator aCacheIter = m_aCurrentRow.getIter();
     262                 :            :         ORowSetCacheIterator_Helper aHelper = aCacheIter->second;
     263                 :            :         ORowSetMatrix::iterator k = aHelper.aIterator;
     264                 :            :         for (; k != m_pCache->getEnd(); ++k)
     265                 :            :         {
     266                 :            :             ORowSetValueVector* pTemp = k->get();
     267                 :            :             OSL_ENSURE( pTemp != (void*)0xfeeefeee,"HALT!" );
     268                 :            :         }
     269                 :            : #endif
     270                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!");
     271                 :            : #if OSL_DEBUG_LEVEL > 0
     272                 :            :         ORowSetRow rRow = (*m_aCurrentRow);
     273                 :            :         OSL_ENSURE(rRow.is() && static_cast<sal_uInt16>(columnIndex) < (rRow->get()).size(),"Invalid size of vector!");
     274                 :            : #endif
     275                 :       1594 :         return ((*m_aCurrentRow)->get())[m_nLastColumnIndex = columnIndex];
     276                 :            :     }
     277                 :            : 
     278                 :            :     // we should normally never reach this
     279                 :       1594 :     return m_aEmptyValue;
     280                 :            : }
     281                 :            : 
     282                 :        140 : ::rtl::OUString SAL_CALL ORowSetBase::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     283                 :            : {
     284                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getString" );
     285         [ +  - ]:        140 :     ::osl::MutexGuard aGuard( *m_pMutex );
     286 [ +  - ][ +  - ]:        140 :     return getValue(columnIndex);
                 [ +  - ]
     287                 :            : }
     288                 :            : 
     289                 :          0 : sal_Bool SAL_CALL ORowSetBase::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     290                 :            : {
     291                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBoolean" );
     292         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     293 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     294                 :            : }
     295                 :            : 
     296                 :          0 : sal_Int8 SAL_CALL ORowSetBase::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     297                 :            : {
     298                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getByte" );
     299         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     300 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     301                 :            : }
     302                 :            : 
     303                 :          0 : sal_Int16 SAL_CALL ORowSetBase::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     304                 :            : {
     305                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getShort" );
     306         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     307 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     308                 :            : }
     309                 :            : 
     310                 :          0 : sal_Int32 SAL_CALL ORowSetBase::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     311                 :            : {
     312                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getInt" );
     313         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     314 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     315                 :            : }
     316                 :            : 
     317                 :          0 : sal_Int64 SAL_CALL ORowSetBase::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     318                 :            : {
     319                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getLong" );
     320         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     321 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     322                 :            : }
     323                 :            : 
     324                 :          0 : float SAL_CALL ORowSetBase::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     325                 :            : {
     326                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getFloat" );
     327         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     328 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     329                 :            : }
     330                 :            : 
     331                 :          0 : double SAL_CALL ORowSetBase::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     332                 :            : {
     333                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getDouble" );
     334         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     335 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     336                 :            : }
     337                 :            : 
     338                 :          0 : Sequence< sal_Int8 > SAL_CALL ORowSetBase::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     339                 :            : {
     340                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBytes" );
     341         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     342 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     343                 :            : }
     344                 :            : 
     345                 :          0 : ::com::sun::star::util::Date SAL_CALL ORowSetBase::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     346                 :            : {
     347                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getDate" );
     348         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     349 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     350                 :            : }
     351                 :            : 
     352                 :          0 : ::com::sun::star::util::Time SAL_CALL ORowSetBase::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     353                 :            : {
     354                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTime" );
     355         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     356 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     357                 :            : }
     358                 :            : 
     359                 :          0 : ::com::sun::star::util::DateTime SAL_CALL ORowSetBase::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     360                 :            : {
     361                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getTimestamp" );
     362         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     363 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex);
                 [ #  # ]
     364                 :            : }
     365                 :            : 
     366                 :          0 : Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     367                 :            : {
     368                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBinaryStream" );
     369         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     370         [ #  # ]:          0 :     checkCache();
     371                 :            : 
     372 [ #  # ][ #  # ]:          0 :     if ( m_bBeforeFirst || m_bAfterLast )
     373                 :            :     {
     374                 :            :         OSL_FAIL("ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!");
     375 [ #  # ][ #  # ]:          0 :         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf );
                 [ #  # ]
     376                 :            :     }
     377                 :            : 
     378         [ #  # ]:          0 :     if ( impl_rowDeleted() )
     379                 :            :     {
     380         [ #  # ]:          0 :         return NULL;
     381                 :            :     }
     382                 :            : 
     383 [ #  # ][ #  # ]:          0 :     bool bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     384         [ #  # ]:          0 :     if ( !bValidCurrentRow )
     385                 :            :     {
     386         [ #  # ]:          0 :         positionCache( MOVE_NONE_REFRESH_ONLY );
     387         [ #  # ]:          0 :         m_aCurrentRow   = m_pCache->m_aMatrixIter;
     388                 :          0 :         m_bIsInsertRow  = sal_False;
     389                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getBinaryStream: we don't stand on a valid row! Row is null.");
     390                 :            : 
     391 [ #  # ][ #  # ]:          0 :         bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     392                 :            :     }
     393                 :            : 
     394         [ #  # ]:          0 :     if ( bValidCurrentRow )
     395 [ #  # ][ #  # ]:          0 :         return new ::comphelper::SequenceInputStream(((*m_aCurrentRow)->get())[m_nLastColumnIndex = columnIndex].getSequence());
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     396                 :            : 
     397                 :            :     // we should normally never reach this
     398         [ #  # ]:          0 :     return Reference< ::com::sun::star::io::XInputStream >();
     399                 :            : }
     400                 :            : 
     401                 :          0 : Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     402                 :            : {
     403                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getCharacterStream" );
     404                 :          0 :     return getBinaryStream(columnIndex);
     405                 :            : }
     406                 :            : 
     407                 :          0 : Any SAL_CALL ORowSetBase::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException)
     408                 :            : {
     409                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getObject" );
     410         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
     411         [ #  # ]:          0 :     checkCache();
     412                 :            : 
     413 [ #  # ][ #  # ]:          0 :     return getValue(columnIndex).makeAny();
                 [ #  # ]
     414                 :            : }
     415                 :            : 
     416                 :          0 : Reference< XRef > SAL_CALL ORowSetBase::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
     417                 :            : {
     418                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getRef" );
     419         [ #  # ]:          0 :     ::dbtools::throwFeatureNotImplementedException( "XRow::getRef", *m_pMySelf );
     420                 :          0 :     return NULL;
     421                 :            : }
     422                 :            : 
     423                 :          0 : Reference< XBlob > SAL_CALL ORowSetBase::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     424                 :            : {
     425                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBlob" );
     426         [ #  # ]:          0 :     return Reference< XBlob >(getValue(columnIndex).makeAny(),UNO_QUERY);
     427                 :            : }
     428                 :            : 
     429                 :          0 : Reference< XClob > SAL_CALL ORowSetBase::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
     430                 :            : {
     431                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getClob" );
     432         [ #  # ]:          0 :     return Reference< XClob >(getValue(columnIndex).makeAny(),UNO_QUERY);
     433                 :            : }
     434                 :            : 
     435                 :          0 : Reference< XArray > SAL_CALL ORowSetBase::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)
     436                 :            : {
     437                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getArray" );
     438         [ #  # ]:          0 :     ::dbtools::throwFeatureNotImplementedException( "XRow::getArray", *m_pMySelf );
     439                 :          0 :     return NULL;
     440                 :            : }
     441                 :            : 
     442                 :            : // ::com::sun::star::sdbcx::XRowLocate
     443                 :         28 : Any SAL_CALL ORowSetBase::getBookmark(  ) throw(SQLException, RuntimeException)
     444                 :            : {
     445                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBookmark" );
     446                 :            :     OSL_TRACE("DBACCESS ORowSetBase::getBookmark() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     447         [ +  - ]:         28 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     448         [ +  - ]:         28 :     ::osl::MutexGuard aGuard( *m_pMutex );
     449         [ +  - ]:         28 :     checkCache();
     450                 :            : 
     451 [ +  - ][ -  + ]:         28 :     if ( m_bBeforeFirst || m_bAfterLast )
     452 [ #  # ][ #  # ]:          0 :         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf );
                 [ #  # ]
     453                 :            : 
     454         [ -  + ]:         28 :     if ( impl_rowDeleted() )
     455 [ #  # ][ #  # ]:          0 :         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_BOOKMARK_DELETED ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf );
                 [ #  # ]
     456                 :            : 
     457                 :            :     OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::getBookmark: bookmark has no value!" );
     458         [ +  - ]:         28 :     return m_aBookmark;
     459                 :            : }
     460                 :            : 
     461                 :          4 : sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
     462                 :            : {
     463                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveToBookmark" );
     464                 :            :     OSL_TRACE("DBACCESS ORowSetBase::moveToBookmark(Any) Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     465                 :            :     OSL_ENSURE(bookmark.hasValue(),"ORowSetBase::moveToBookmark bookmark has no value!");
     466         [ +  - ]:          4 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     467                 :            : 
     468 [ +  - ][ -  + ]:          4 :     if(!bookmark.hasValue() || m_nResultSetType == ResultSetType::FORWARD_ONLY)
                 [ -  + ]
     469                 :            :     {
     470                 :          0 :         if(bookmark.hasValue())
     471                 :            :             OSL_FAIL("MoveToBookmark is not possible when we are only forward");
     472                 :            :         else
     473                 :            :             OSL_FAIL("Bookmark is not valid");
     474 [ #  # ][ #  # ]:          0 :         throwFunctionSequenceException(*m_pMySelf);
     475                 :            :     }
     476                 :            : 
     477                 :            : 
     478         [ +  - ]:          4 :     checkCache();
     479                 :            : 
     480         [ +  - ]:          4 :     sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) );
     481         [ +  - ]:          4 :     if ( bRet )
     482                 :            :     {
     483                 :            :         // check if we are inserting a row
     484 [ +  - ][ -  + ]:          4 :         sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
     485                 :            : 
     486         [ +  - ]:          4 :         ORowSetNotifier aNotifier( this );
     487                 :            :             // this will call cancelRowModification on the cache if necessary
     488                 :            : 
     489         [ +  - ]:          4 :         ORowSetRow aOldValues = getOldRow(bWasNew);
     490                 :            : 
     491         [ +  - ]:          4 :         bRet = m_pCache->moveToBookmark(bookmark);
     492         [ +  - ]:          4 :         doCancelModification( );
     493         [ +  - ]:          4 :         if(bRet)
     494                 :            :         {
     495                 :            :             // notification order
     496                 :            :             // - column values
     497                 :            :             // - cursorMoved
     498         [ +  - ]:          4 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
     499                 :            :         }
     500                 :            :         else
     501                 :            :         {
     502         [ #  # ]:          0 :             movementFailed();
     503                 :            :         }
     504                 :            : 
     505                 :            :         // - IsModified
     506                 :            :         // - IsNew
     507 [ +  - ][ +  - ]:          4 :         aNotifier.fire( );
                 [ +  - ]
     508                 :            :     }
     509                 :            :     OSL_TRACE("DBACCESS ORowSetBase::moveToBookmark(Any) = %i Clone = %i",bRet,m_bClone);
     510         [ +  - ]:          4 :     return bRet;
     511                 :            : }
     512                 :            : 
     513                 :          2 : sal_Bool SAL_CALL ORowSetBase::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException)
     514                 :            : {
     515                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveRelativeToBookmark" );
     516                 :            :     OSL_TRACE("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) Clone = %i",rows,m_bClone);
     517         [ +  - ]:          2 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     518                 :            : 
     519         [ +  - ]:          2 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     520                 :            : 
     521         [ +  - ]:          2 :     checkPositioningAllowed();
     522                 :            : 
     523         [ +  - ]:          2 :     sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) );
     524         [ +  - ]:          2 :     if ( bRet )
     525                 :            :     {
     526                 :            :         // check if we are inserting a row
     527 [ +  - ][ +  - ]:          2 :         sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted();
                 [ -  + ]
     528                 :            : 
     529         [ +  - ]:          2 :         ORowSetNotifier aNotifier( this );
     530                 :            :             // this will call cancelRowModification on the cache if necessary
     531                 :            : 
     532         [ +  - ]:          2 :         ORowSetRow aOldValues = getOldRow(bWasNew);
     533                 :            : 
     534         [ +  - ]:          2 :         bRet = m_pCache->moveRelativeToBookmark(bookmark,rows);
     535         [ +  - ]:          2 :         doCancelModification( );
     536         [ +  - ]:          2 :         if(bRet)
     537                 :            :         {
     538                 :            :             // notification order
     539                 :            :             // - column values
     540                 :            :             // - cursorMoved
     541         [ +  - ]:          2 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
     542                 :            :         }
     543                 :            :         else
     544         [ #  # ]:          0 :             movementFailed();
     545                 :            : 
     546                 :            :         // - IsModified
     547                 :            :         // - IsNew
     548         [ +  - ]:          2 :         aNotifier.fire( );
     549                 :            : 
     550                 :            :         // RowCount/IsRowCountFinal
     551 [ +  - ][ +  - ]:          2 :         fireRowcount();
                 [ +  - ]
     552                 :            :     }
     553                 :            :     OSL_TRACE("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) = %i Clone = %i",rows,bRet,m_bClone);
     554         [ +  - ]:          2 :     return bRet;
     555                 :            : }
     556                 :            : 
     557                 :         10 : sal_Int32 SAL_CALL ORowSetBase::compareBookmarks( const Any& _first, const Any& _second ) throw(SQLException, RuntimeException)
     558                 :            : {
     559                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::compareBookmarks" );
     560         [ +  - ]:         10 :     ::osl::MutexGuard aGuard( *m_pMutex );
     561         [ +  - ]:         10 :     checkCache();
     562 [ +  - ][ +  - ]:         10 :     return m_pCache->compareBookmarks(_first,_second);
     563                 :            : }
     564                 :            : 
     565                 :          2 : sal_Bool SAL_CALL ORowSetBase::hasOrderedBookmarks(  ) throw(SQLException, RuntimeException)
     566                 :            : {
     567                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::hasOrderedBookmarks" );
     568         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
     569         [ +  - ]:          2 :     checkCache();
     570 [ +  - ][ +  - ]:          2 :     return m_pCache->hasOrderedBookmarks();
     571                 :            : }
     572                 :            : 
     573                 :          4 : sal_Int32 SAL_CALL ORowSetBase::hashBookmark( const Any& bookmark ) throw(SQLException, RuntimeException)
     574                 :            : {
     575                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::hashBookmark" );
     576         [ +  - ]:          4 :     ::osl::MutexGuard aGuard( *m_pMutex );
     577         [ +  - ]:          4 :     checkCache();
     578 [ +  - ][ +  - ]:          4 :     return m_pCache->hashBookmark(bookmark);
     579                 :            : }
     580                 :            : 
     581                 :            : // XResultSetMetaDataSupplier
     582                 :        572 : Reference< XResultSetMetaData > SAL_CALL ORowSetBase::getMetaData(  ) throw(SQLException, RuntimeException)
     583                 :            : {
     584                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getMetaData" );
     585                 :        572 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     586                 :            : 
     587                 :        572 :     Reference< XResultSetMetaData > xMeta;
     588         [ +  - ]:        572 :     if(m_pCache)
     589 [ +  - ][ +  - ]:        572 :         xMeta = m_pCache->getMetaData();
     590                 :            : 
     591                 :        572 :     return xMeta;
     592                 :            : }
     593                 :            : 
     594                 :            : // XColumnLocate
     595                 :          2 : sal_Int32 SAL_CALL ORowSetBase::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
     596                 :            : {
     597                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::findColumn" );
     598         [ +  - ]:          2 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     599                 :            : 
     600         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( m_aColumnsMutex );
     601                 :            :     // it is possible to save some time here when we remember the names - position relation in a map
     602 [ +  - ][ +  - ]:          2 :     return m_pColumns ? m_pColumns->findColumn(columnName) : sal_Int32(0);
                 [ +  - ]
     603                 :            : }
     604                 :            : 
     605                 :            : // ::com::sun::star::sdbcx::XColumnsSupplier
     606                 :        337 : Reference< XNameAccess > SAL_CALL ORowSetBase::getColumns(  ) throw(RuntimeException)
     607                 :            : {
     608                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getColumns" );
     609         [ +  - ]:        337 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     610                 :            : 
     611         [ +  - ]:        337 :     ::osl::MutexGuard aGuard( m_aColumnsMutex );
     612         [ -  + ]:        337 :     if(!m_pColumns)
     613                 :            :     {
     614         [ #  # ]:          0 :         if (!m_pEmptyCollection)
     615 [ #  # ][ #  # ]:          0 :             m_pEmptyCollection = new OEmptyCollection(*m_pMySelf,m_aColumnsMutex);
     616 [ #  # ][ #  # ]:          0 :         return m_pEmptyCollection;
     617                 :            :     }
     618                 :            : 
     619 [ +  - ][ +  - ]:        337 :     return m_pColumns;
                 [ +  - ]
     620                 :            : }
     621                 :            : 
     622                 :            : // XResultSet
     623                 :        132 : sal_Bool SAL_CALL ORowSetBase::next(  ) throw(SQLException, RuntimeException)
     624                 :            : {
     625                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::next" );
     626                 :            :     OSL_TRACE("DBACCESS ORowSetBase::next() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     627         [ +  - ]:        132 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     628         [ +  - ]:        132 :     checkCache();
     629                 :            : 
     630         [ +  - ]:        132 :     sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) );
     631         [ +  - ]:        132 :     if ( bRet )
     632                 :            :     {
     633                 :            :         // check if we are inserting a row
     634 [ +  - ][ +  + ]:        132 :         sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
     635                 :            : 
     636         [ +  - ]:        132 :         ORowSetNotifier aNotifier( this );
     637                 :            :             // this will call cancelRowModification on the cache if necessary
     638                 :            : 
     639         [ +  - ]:        132 :         ORowSetRow aOldValues = getOldRow(bWasNew);
     640                 :            : 
     641         [ +  - ]:        132 :         positionCache( MOVE_FORWARD );
     642         [ +  - ]:        132 :         sal_Bool bAfterLast = m_pCache->isAfterLast();
     643         [ +  - ]:        132 :         bRet = m_pCache->next();
     644         [ +  - ]:        132 :         doCancelModification( );
     645                 :            : 
     646 [ +  + ][ +  - ]:        132 :         if ( bRet || bAfterLast != m_pCache->isAfterLast() )
         [ +  - ][ +  - ]
     647                 :            :         {
     648                 :            :             // notification order
     649                 :            :             // - column values
     650                 :            :             // - cursorMoved
     651         [ +  - ]:        132 :             setCurrentRow( bRet, sal_True, aOldValues, aGuard );
     652                 :            :             OSL_ENSURE(!m_bBeforeFirst,"BeforeFirst is true. I don't know why?");
     653                 :            :         }
     654                 :            :         else
     655                 :            :         {
     656                 :            :             // moved after the last row
     657         [ #  # ]:          0 :             movementFailed();
     658                 :            :             OSL_ENSURE(m_bAfterLast,"AfterLast is false. I don't know why?");
     659                 :            :         }
     660                 :            : 
     661                 :            :         // - IsModified
     662                 :            :         // - IsNew
     663         [ +  - ]:        132 :         aNotifier.fire();
     664                 :            : 
     665                 :            :         // - RowCount/IsRowCountFinal
     666 [ +  - ][ +  - ]:        132 :         fireRowcount();
                 [ +  - ]
     667                 :            :     }
     668                 :            :     OSL_TRACE("DBACCESS ORowSetBase::next() = %i Clone = %i ID = %i",bRet,m_bClone,osl_getThreadIdentifier(NULL));
     669         [ +  - ]:        132 :     return bRet;
     670                 :            : }
     671                 :            : 
     672                 :        360 : sal_Bool SAL_CALL ORowSetBase::isBeforeFirst(  ) throw(SQLException, RuntimeException)
     673                 :            : {
     674                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isBeforeFirst" );
     675         [ +  - ]:        360 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     676         [ +  - ]:        360 :     ::osl::MutexGuard aGuard( *m_pMutex );
     677         [ +  - ]:        360 :     checkCache();
     678                 :            : 
     679                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isBeforeFirst() = %i Clone = %i",m_bBeforeFirst,m_bClone);
     680                 :            : 
     681         [ +  - ]:        360 :     return m_bBeforeFirst;
     682                 :            : }
     683                 :            : 
     684                 :        362 : sal_Bool SAL_CALL ORowSetBase::isAfterLast(  ) throw(SQLException, RuntimeException)
     685                 :            : {
     686                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isAfterLast" );
     687         [ +  - ]:        362 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     688         [ +  - ]:        362 :     ::osl::MutexGuard aGuard( *m_pMutex );
     689         [ +  - ]:        362 :     checkCache();
     690                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isAfterLast() = %i Clone = %i",m_bAfterLast,m_bClone);
     691                 :            : 
     692         [ +  - ]:        362 :     return m_bAfterLast;
     693                 :            : }
     694                 :            : 
     695                 :         50 : sal_Bool ORowSetBase::isOnFirst()
     696                 :            : {
     697                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isOnFirst" );
     698                 :         50 :     return isFirst();
     699                 :            : }
     700                 :            : 
     701                 :         52 : sal_Bool SAL_CALL ORowSetBase::isFirst(  ) throw(SQLException, RuntimeException)
     702                 :            : {
     703                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isFirst" );
     704                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isFirst() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     705                 :            : 
     706         [ +  - ]:         52 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     707         [ +  - ]:         52 :     ::osl::MutexGuard aGuard( *m_pMutex );
     708         [ +  - ]:         52 :     checkCache();
     709                 :            : 
     710 [ +  + ][ +  + ]:         52 :     if ( m_bBeforeFirst || m_bAfterLast )
     711                 :         34 :         return sal_False;
     712                 :            : 
     713         [ -  + ]:         18 :     if ( impl_rowDeleted() )
     714                 :          0 :         return ( m_nDeletedPosition == 1 );
     715                 :            : 
     716         [ +  - ]:         18 :     positionCache( MOVE_NONE_REFRESH_ONLY );
     717         [ +  - ]:         18 :     sal_Bool bIsFirst = m_pCache->isFirst();
     718                 :            : 
     719                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isFirst() = %i Clone = %i",bIsFirst,m_bClone);
     720         [ +  - ]:         52 :     return bIsFirst;
     721                 :            : }
     722                 :            : 
     723                 :          4 : sal_Bool ORowSetBase::isOnLast()
     724                 :            : {
     725                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isOnLast" );
     726                 :          4 :     return isLast();
     727                 :            : }
     728                 :            : 
     729                 :          6 : sal_Bool SAL_CALL ORowSetBase::isLast(  ) throw(SQLException, RuntimeException)
     730                 :            : {
     731                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isLast" );
     732                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isLast() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     733         [ +  - ]:          6 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     734         [ +  - ]:          6 :     ::osl::MutexGuard aGuard( *m_pMutex );
     735         [ +  - ]:          6 :     checkCache();
     736                 :            : 
     737 [ +  - ][ +  + ]:          6 :     if ( m_bBeforeFirst || m_bAfterLast )
     738                 :          2 :         return sal_False;
     739                 :            : 
     740         [ -  + ]:          4 :     if ( impl_rowDeleted() )
     741                 :            :     {
     742         [ #  # ]:          0 :         if ( !m_pCache->m_bRowCountFinal )
     743                 :          0 :             return sal_False;
     744                 :            :         else
     745         [ #  # ]:          0 :             return ( m_nDeletedPosition == impl_getRowCount() );
     746                 :            :     }
     747                 :            : 
     748         [ +  - ]:          4 :     positionCache( MOVE_NONE_REFRESH_ONLY );
     749         [ +  - ]:          4 :     sal_Bool bIsLast = m_pCache->isLast();
     750                 :            : 
     751                 :            :     OSL_TRACE("DBACCESS ORowSetBase::isLast() = %i Clone = %i",bIsLast,m_bClone);
     752         [ +  - ]:          6 :     return bIsLast;
     753                 :            : }
     754                 :            : 
     755                 :         16 : void SAL_CALL ORowSetBase::beforeFirst(  ) throw(SQLException, RuntimeException)
     756                 :            : {
     757                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::beforeFirst" );
     758                 :            :     OSL_TRACE("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     759         [ +  - ]:         16 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     760         [ +  - ]:         16 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     761                 :            : 
     762         [ +  - ]:         16 :     checkPositioningAllowed();
     763                 :            : 
     764                 :            :     // check if we are inserting a row
     765 [ +  - ][ -  + ]:         16 :     sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
     766                 :            : 
     767 [ +  - ][ +  + ]:         16 :     if((bWasNew || !m_bBeforeFirst) && notifyAllListenersCursorBeforeMove(aGuard) )
         [ +  - ][ +  - ]
                 [ +  + ]
     768                 :            :     {
     769         [ +  - ]:          8 :         ORowSetNotifier aNotifier( this );
     770                 :            :             // this will call cancelRowModification on the cache if necessary
     771                 :            : 
     772         [ +  - ]:          8 :         if ( !m_bBeforeFirst )
     773                 :            :         {
     774         [ +  - ]:          8 :             ORowSetRow aOldValues = getOldRow(bWasNew);
     775         [ +  - ]:          8 :             m_pCache->beforeFirst();
     776         [ +  - ]:          8 :             doCancelModification( );
     777                 :            : 
     778                 :            :             // notification order
     779                 :            :             // - column values
     780                 :            :             // - cursorMoved
     781         [ +  - ]:          8 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
     782                 :            : 
     783                 :            :             // - IsModified
     784                 :            :             // - Isnew
     785         [ +  - ]:          8 :             aNotifier.fire();
     786                 :            : 
     787                 :            :             // - RowCount/IsRowCountFinal
     788 [ +  - ][ +  - ]:          8 :             fireRowcount();
     789                 :            :         }
     790                 :            : 
     791                 :            :         // to be done _after_ the notifications!
     792 [ +  - ][ +  - ]:          8 :         m_aOldRow->clearRow();
     793                 :            :     }
     794         [ +  - ]:         16 :     OSL_TRACE("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     795                 :         16 : }
     796                 :            : 
     797                 :         10 : void SAL_CALL ORowSetBase::afterLast(  ) throw(SQLException, RuntimeException)
     798                 :            : {
     799                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::afterLast" );
     800                 :            :     OSL_TRACE("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     801         [ +  - ]:         10 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     802                 :            : 
     803         [ +  - ]:         10 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     804         [ +  - ]:         10 :     checkPositioningAllowed();
     805                 :            : 
     806 [ +  - ][ -  + ]:         10 :     sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
     807                 :            : 
     808 [ +  - ][ +  - ]:         10 :     if((bWasNew || !m_bAfterLast) && notifyAllListenersCursorBeforeMove(aGuard) )
         [ +  - ][ +  - ]
                 [ +  - ]
     809                 :            :     {
     810                 :            :         // check if we are inserting a row
     811         [ +  - ]:         10 :         ORowSetNotifier aNotifier( this );
     812                 :            :             // this will call cancelRowModification on the cache if necessary
     813                 :            : 
     814         [ +  - ]:         10 :         if(!m_bAfterLast)
     815                 :            :         {
     816         [ +  - ]:         10 :             ORowSetRow aOldValues = getOldRow(bWasNew);
     817                 :            : 
     818         [ +  - ]:         10 :             m_pCache->afterLast();
     819         [ +  - ]:         10 :             doCancelModification( );
     820                 :            : 
     821                 :            :             // notification order
     822                 :            :             // - column values
     823                 :            :             // - cursorMoved
     824         [ +  - ]:         10 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
     825                 :            : 
     826                 :            :             // - IsModified
     827                 :            :             // - Isnew
     828         [ +  - ]:         10 :             aNotifier.fire();
     829                 :            : 
     830                 :            :             // - RowCount/IsRowCountFinal
     831 [ +  - ][ +  - ]:         10 :             fireRowcount();
     832         [ +  - ]:         10 :         }
     833                 :            :     }
     834         [ +  - ]:         10 :     OSL_TRACE("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     835                 :         10 : }
     836                 :            : 
     837                 :         56 : sal_Bool SAL_CALL ORowSetBase::move(    ::std::mem_fun_t<sal_Bool,ORowSetBase>& _aCheckFunctor,
     838                 :            :                                         ::std::mem_fun_t<sal_Bool,ORowSetCache>& _aMovementFunctor)
     839                 :            : {
     840                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::move" );
     841                 :            :     OSL_TRACE("DBACCESS ORowSetBase::move() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     842         [ +  - ]:         56 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     843         [ +  - ]:         56 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     844         [ +  + ]:         56 :     checkPositioningAllowed();
     845                 :            : 
     846         [ +  - ]:         54 :     sal_Bool bRet( notifyAllListenersCursorBeforeMove( aGuard ) );
     847         [ +  - ]:         54 :     if( bRet )
     848                 :            :     {
     849                 :            :         // check if we are inserting a row
     850 [ +  - ][ +  - ]:         54 :         sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted();
                 [ -  + ]
     851                 :            : 
     852         [ +  - ]:         54 :         ORowSetNotifier aNotifier( this );
     853                 :            :             // this will call cancelRowModification on the cache if necessary
     854                 :            : 
     855         [ +  - ]:         54 :         ORowSetRow aOldValues = getOldRow(bWasNew);
     856                 :            : 
     857 [ +  - ][ +  - ]:         54 :         sal_Bool bMoved = ( bWasNew || !_aCheckFunctor(this) );
                 [ +  + ]
     858                 :            : 
     859         [ +  - ]:         54 :         bRet = _aMovementFunctor(m_pCache);
     860         [ +  - ]:         54 :         doCancelModification( );
     861                 :            : 
     862         [ +  + ]:         54 :         if ( bRet )
     863                 :            :         {
     864                 :            :             // notification order
     865                 :            :             // - column values
     866                 :            :             // - cursorMoved
     867         [ +  - ]:         50 :             setCurrentRow( bMoved, sal_True, aOldValues, aGuard );
     868                 :            :         }
     869                 :            :         else
     870                 :            :         {   // first goes wrong so there is no row
     871         [ +  - ]:          4 :             movementFailed();
     872                 :            :         }
     873                 :            : 
     874                 :            :         // - IsModified
     875                 :            :         // - IsNew
     876         [ +  - ]:         54 :         aNotifier.fire();
     877                 :            : 
     878                 :            :         // - RowCount/IsRowCountFinal
     879 [ +  - ][ +  - ]:         54 :         fireRowcount();
                 [ +  - ]
     880                 :            :     }
     881                 :            :     OSL_TRACE("DBACCESS ORowSetBase::move() = %i Clone = %i",bRet,m_bClone);
     882         [ +  - ]:         56 :     return bRet;
     883                 :            : }
     884                 :            : 
     885                 :         52 : sal_Bool SAL_CALL ORowSetBase::first(  ) throw(SQLException, RuntimeException)
     886                 :            : {
     887                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::first" );
     888                 :            :     OSL_TRACE("DBACCESS ORowSetBase::first() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     889                 :         52 :     ::std::mem_fun_t<sal_Bool,ORowSetBase> ioF_tmp(&ORowSetBase::isOnFirst);
     890                 :         52 :     ::std::mem_fun_t<sal_Bool,ORowSetCache> F_tmp(&ORowSetCache::first);
     891         [ +  + ]:         52 :     return move(ioF_tmp,F_tmp);
     892                 :            : }
     893                 :            : 
     894                 :          4 : sal_Bool SAL_CALL ORowSetBase::last(  ) throw(SQLException, RuntimeException)
     895                 :            : {
     896                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::last" );
     897                 :            :     OSL_TRACE("DBACCESS ORowSetBase::last() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     898                 :          4 :     ::std::mem_fun_t<sal_Bool,ORowSetBase> ioL_tmp(&ORowSetBase::isOnLast);
     899                 :          4 :     ::std::mem_fun_t<sal_Bool,ORowSetCache> L_tmp(&ORowSetCache::last);
     900         [ +  - ]:          4 :     return move(ioL_tmp,L_tmp);
     901                 :            : }
     902                 :            : 
     903                 :         58 : sal_Int32 SAL_CALL ORowSetBase::getRow(  ) throw(SQLException, RuntimeException)
     904                 :            : {
     905                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getRow" );
     906                 :            :     OSL_TRACE("DBACCESS ORowSetBase::getRow() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
     907         [ +  - ]:         58 :     ::osl::MutexGuard aGuard( *m_pMutex );
     908                 :            : 
     909         [ +  - ]:         58 :     checkCache();
     910 [ +  - ][ +  - ]:         58 :     return impl_getRow();
     911                 :            : }
     912                 :            : 
     913                 :         58 : sal_Int32 ORowSetBase::impl_getRow()
     914                 :            : {
     915                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getRow" );
     916                 :         58 :     sal_Int32  nPos = 0;
     917         [ -  + ]:         58 :     if ( m_bBeforeFirst )
     918                 :          0 :         nPos = 0;
     919         [ -  + ]:         58 :     else if ( m_bAfterLast )
     920                 :          0 :         nPos = impl_getRowCount() + 1;
     921         [ -  + ]:         58 :     else if ( impl_rowDeleted() )
     922                 :          0 :         nPos = m_nDeletedPosition;
     923 [ +  + ][ -  + ]:         58 :     else if ( !m_bClone && m_pCache->m_bNew )
     924                 :          0 :         nPos = 0;
     925                 :            :     else
     926                 :            :     {
     927 [ +  - ][ +  - ]:        232 :         if  (   m_pCache->isAfterLast()
         [ +  - ][ -  + ]
                 [ -  + ]
     928         [ +  - ]:         58 :             ||  m_pCache->isBeforeFirst()
     929 [ +  - ][ +  - ]:        116 :             ||  ( m_pCache->compareBookmarks( m_aBookmark, m_pCache->getBookmark() ) != CompareBookmark::EQUAL )
         [ +  - ][ #  # ]
     930                 :            :             )
     931                 :            :         {
     932                 :          0 :             positionCache( MOVE_NONE_REFRESH_ONLY );
     933                 :            :         }
     934                 :         58 :         nPos = m_pCache->getRow();
     935                 :            :     }
     936                 :            :     OSL_TRACE("DBACCESS ORowSetBase::impl_getRow() = %i Clone = %i ID = %i",nPos,m_bClone,osl_getThreadIdentifier(NULL));
     937                 :         58 :     return nPos;
     938                 :            : }
     939                 :            : 
     940                 :          4 : sal_Bool SAL_CALL ORowSetBase::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
     941                 :            : {
     942                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::absolute" );
     943                 :            :     OSL_TRACE("DBACCESS ORowSetBase::absolute(%i) Clone = %i",row,m_bClone);
     944         [ +  - ]:          4 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     945         [ +  - ]:          4 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     946         [ +  - ]:          4 :     checkPositioningAllowed();
     947                 :            : 
     948                 :            :     sal_Bool bRet = ( row > 0 )
     949 [ +  - ][ +  - ]:          4 :                 &&  notifyAllListenersCursorBeforeMove( aGuard );
                 [ +  - ]
     950         [ +  - ]:          4 :     if ( bRet )
     951                 :            :     {
     952                 :            :         // check if we are inserting a row
     953 [ +  - ][ +  - ]:          4 :         sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted();
                 [ -  + ]
     954                 :            : 
     955         [ +  - ]:          4 :         ORowSetNotifier aNotifier( this );
     956                 :            :             // this will call cancelRowModification on the cache if necessary
     957                 :            : 
     958         [ +  - ]:          4 :         ORowSetRow aOldValues = getOldRow(bWasNew);
     959                 :            : 
     960         [ +  - ]:          4 :         bRet = m_pCache->absolute(row);
     961         [ +  - ]:          4 :         doCancelModification( );
     962                 :            : 
     963         [ +  - ]:          4 :         if(bRet)
     964                 :            :         {
     965                 :            :             // notification order
     966                 :            :             // - column values
     967                 :            :             // - cursorMoved
     968         [ +  - ]:          4 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
     969                 :            :         }
     970                 :            :         else
     971                 :            :         { // absolute movement goes wrong we stand left or right side of the rows
     972         [ #  # ]:          0 :             movementFailed();
     973                 :            :         }
     974                 :            : 
     975                 :            :         // - IsModified
     976                 :            :         // - IsNew
     977         [ +  - ]:          4 :         aNotifier.fire();
     978                 :            : 
     979                 :            :         // - RowCount/IsRowCountFinal
     980 [ +  - ][ +  - ]:          4 :         fireRowcount();
                 [ +  - ]
     981                 :            :     }
     982                 :            :     OSL_TRACE("DBACCESS ORowSetBase::absolute(%i) = %i Clone = %i",row,bRet,m_bClone);
     983         [ +  - ]:          4 :     return bRet;
     984                 :            : }
     985                 :            : 
     986                 :         16 : sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) throw(SQLException, RuntimeException)
     987                 :            : {
     988                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::relative" );
     989                 :            :     OSL_TRACE("DBACCESS ORowSetBase::relative(%i) Clone = %i",rows,m_bClone);
     990         [ +  - ]:         16 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
     991                 :            : 
     992         [ +  - ]:         16 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
     993                 :            : 
     994         [ -  + ]:         16 :     if(!rows)
     995                 :          0 :         return sal_True; // in this case do nothing
     996                 :            : 
     997         [ +  - ]:         16 :     checkPositioningAllowed();
     998                 :            : 
     999                 :            :     sal_Bool bRet =
    1000                 :         16 :             (  ( !m_bAfterLast || rows <= 0 )
    1001                 :         16 :             && ( !m_bBeforeFirst || rows >= 0 )
    1002         [ +  - ]:         16 :             && notifyAllListenersCursorBeforeMove( aGuard )
    1003 [ -  + ][ #  # ]:         32 :             );
         [ -  + ][ #  # ]
                 [ +  - ]
    1004                 :            : 
    1005         [ +  - ]:         16 :     if ( bRet )
    1006                 :            :     {
    1007                 :            :         // check if we are inserting a row
    1008 [ +  - ][ +  - ]:         16 :         sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted();
                 [ -  + ]
    1009                 :            : 
    1010         [ +  - ]:         16 :         ORowSetNotifier aNotifier( this );
    1011                 :            :             // this will call cancelRowModification on the cache if necessary
    1012                 :            : 
    1013         [ +  - ]:         16 :         ORowSetRow aOldValues = getOldRow(bWasNew);
    1014                 :            : 
    1015         [ +  - ]:         16 :         positionCache( rows > 0 ? MOVE_FORWARD : MOVE_BACKWARD );
    1016         [ +  - ]:         16 :         bRet = m_pCache->relative(rows);
    1017         [ +  - ]:         16 :         doCancelModification( );
    1018                 :            : 
    1019         [ +  - ]:         16 :         if(bRet)
    1020                 :            :         {
    1021                 :            :             // notification order
    1022                 :            :             // - column values
    1023                 :            :             // - cursorMoved
    1024         [ +  - ]:         16 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
    1025                 :            :         }
    1026                 :            :         else
    1027                 :            :         {
    1028         [ #  # ]:          0 :             movementFailed();
    1029                 :            :         }
    1030                 :            : 
    1031                 :            :         // - IsModified
    1032                 :            :         // - IsNew
    1033         [ +  - ]:         16 :         aNotifier.fire();
    1034                 :            : 
    1035                 :            :         // - RowCount/IsRowCountFinal
    1036 [ +  - ][ +  - ]:         16 :         fireRowcount();
                 [ +  - ]
    1037                 :            :     }
    1038                 :            :     OSL_TRACE("DBACCESS ORowSetBase::relative(%i) = %i Clone = %i",rows,bRet,m_bClone);
    1039         [ +  - ]:         16 :     return bRet;
    1040                 :            : }
    1041                 :            : 
    1042                 :          2 : sal_Bool SAL_CALL ORowSetBase::previous(  ) throw(SQLException, RuntimeException)
    1043                 :            : {
    1044                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::previous" );
    1045                 :            :     OSL_TRACE("DBACCESS ORowSetBase::previous() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1046         [ +  - ]:          2 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
    1047         [ +  - ]:          2 :     ::osl::ResettableMutexGuard aGuard( *m_pMutex );
    1048                 :            : 
    1049         [ +  - ]:          2 :     checkPositioningAllowed();
    1050                 :            : 
    1051                 :          2 :     sal_Bool bRet = !m_bBeforeFirst
    1052 [ +  - ][ +  - ]:          2 :                 &&  notifyAllListenersCursorBeforeMove(aGuard);
                 [ +  - ]
    1053                 :            : 
    1054         [ +  - ]:          2 :     if ( bRet )
    1055                 :            :     {
    1056                 :            :         // check if we are inserting a row
    1057 [ +  - ][ +  - ]:          2 :         sal_Bool bWasNew = m_pCache->m_bNew || rowDeleted();
                 [ -  + ]
    1058                 :            : 
    1059         [ +  - ]:          2 :         ORowSetNotifier aNotifier( this );
    1060                 :            :             // this will call cancelRowModification on the cache if necessary
    1061                 :            : 
    1062         [ +  - ]:          2 :         ORowSetRow aOldValues = getOldRow(bWasNew);
    1063                 :            : 
    1064         [ +  - ]:          2 :         positionCache( MOVE_BACKWARD );
    1065         [ +  - ]:          2 :         bRet = m_pCache->previous();
    1066         [ +  - ]:          2 :         doCancelModification( );
    1067                 :            : 
    1068                 :            :         // if m_bBeforeFirst is false and bRet is false than we stood on the first row
    1069 [ -  + ][ #  # ]:          2 :         if(!m_bBeforeFirst || bRet)
    1070                 :            :         {
    1071                 :            :             // notification order
    1072                 :            :             // - column values
    1073                 :            :             // - cursorMoved
    1074         [ +  - ]:          2 :             setCurrentRow( sal_True, sal_True, aOldValues, aGuard );
    1075                 :            :         }
    1076                 :            :         else
    1077                 :            :         {
    1078                 :            :             OSL_FAIL( "ORowSetBase::previous: inconsistency!" );
    1079                 :            :                 // we should never reach this place, as we should not get into this whole branch if m_bBeforeFirst
    1080                 :            :                 // was |true| from the beginning
    1081         [ #  # ]:          0 :             movementFailed();
    1082                 :            :         }
    1083                 :            : 
    1084                 :            :         // - IsModified
    1085                 :            :         // - IsNew
    1086         [ +  - ]:          2 :         aNotifier.fire();
    1087                 :            : 
    1088                 :            :         // - RowCount/IsRowCountFinal
    1089 [ +  - ][ +  - ]:          2 :         fireRowcount();
                 [ +  - ]
    1090                 :            :     }
    1091                 :            :     OSL_TRACE("DBACCESS ORowSetBase::previous() = %i Clone = %i",bRet,m_bClone);
    1092         [ +  - ]:          2 :     return bRet;
    1093                 :            : }
    1094                 :            : 
    1095                 :        230 : void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const ORowSetRow& _rOldValues, ::osl::ResettableMutexGuard& _rGuard )
    1096                 :            : {
    1097                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::setCurrentRow" );
    1098                 :            :     OSL_TRACE("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1099                 :        230 :     m_bBeforeFirst  = m_pCache->isBeforeFirst();
    1100                 :        230 :     m_bAfterLast    = m_pCache->isAfterLast();
    1101                 :            : 
    1102 [ +  + ][ +  + ]:        230 :     if(!(m_bBeforeFirst || m_bAfterLast))
    1103                 :            :     {
    1104                 :        204 :         m_aBookmark     = m_pCache->getBookmark();
    1105                 :            :         OSL_ENSURE(m_aBookmark.hasValue(),"Bookmark has no value!");
    1106                 :        204 :         m_aCurrentRow   = m_pCache->m_aMatrixIter;
    1107                 :        204 :         m_bIsInsertRow  = sal_False;
    1108                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is null!");
    1109                 :        204 :         m_aCurrentRow.setBookmark(m_aBookmark);
    1110                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd(),"Position of matrix iterator isn't valid!");
    1111                 :            :         OSL_ENSURE(m_aCurrentRow->is(),"Currentrow isn't valid");
    1112                 :            :         OSL_ENSURE(m_aBookmark.hasValue(),"Bookmark has no value!");
    1113                 :            : 
    1114                 :            : #if OSL_DEBUG_LEVEL > 0
    1115                 :            :         sal_Int32 nOldRow = m_pCache->getRow();
    1116                 :            : #endif
    1117                 :        204 :         positionCache( MOVE_NONE_REFRESH_ONLY );
    1118                 :            : #if OSL_DEBUG_LEVEL > 0
    1119                 :            :         sal_Int32 nNewRow = m_pCache->getRow();
    1120                 :            :         OSL_ENSURE(nOldRow == nNewRow,"Old position is not equal to new postion");
    1121                 :            : #endif
    1122                 :        204 :         m_aCurrentRow   = m_pCache->m_aMatrixIter;
    1123                 :        204 :         m_bIsInsertRow  = sal_False;
    1124                 :            :         OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is nul after positionCache!");
    1125                 :            : #if OSL_DEBUG_LEVEL > 0
    1126                 :            :         ORowSetRow rRow = (*m_aCurrentRow);
    1127                 :            :         OSL_ENSURE(rRow.is() ,"Invalid size of vector!");
    1128                 :            : #endif
    1129                 :            :         // the cache could repositioned so we need to adjust the cache
    1130 [ -  + ][ -  + ]:        204 :         if ( _bMoved && m_aCurrentRow.isNull() )
                 [ +  + ]
    1131                 :            :         {
    1132                 :          0 :             positionCache( MOVE_NONE_REFRESH_ONLY );
    1133                 :          0 :             m_aCurrentRow   = m_pCache->m_aMatrixIter;
    1134                 :          0 :             m_bIsInsertRow  = sal_False;
    1135                 :            :             OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is nul after positionCache!");
    1136                 :            :         }
    1137                 :            :     }
    1138                 :            :     else
    1139                 :            :     {
    1140                 :         26 :         m_aOldRow->clearRow();
    1141                 :         26 :         m_aCurrentRow   = m_pCache->getEnd();
    1142                 :         26 :         m_aBookmark     = Any();
    1143                 :         26 :         m_aCurrentRow.setBookmark(m_aBookmark);
    1144                 :            :     }
    1145                 :            : 
    1146                 :            :     // notification order
    1147                 :            :     // - column values
    1148         [ +  - ]:        230 :     if ( _bDoNotify )
    1149                 :        230 :         firePropertyChange(_rOldValues);
    1150                 :            : 
    1151                 :            :     // TODO: can this be done before the notifications?
    1152 [ +  + ][ +  + ]:        230 :     if(!(m_bBeforeFirst || m_bAfterLast) && !m_aCurrentRow.isNull() && m_aCurrentRow->is() && m_aCurrentRow != m_pCache->getEnd())
         [ +  - ][ +  - ]
         [ +  - ][ +  + ]
    1153 [ +  - ][ +  - ]:        204 :         m_aOldRow->setRow(new ORowSetValueVector( *(*m_aCurrentRow) ));
    1154                 :            : 
    1155 [ +  + ][ +  - ]:        230 :     if ( _bMoved && _bDoNotify )
    1156                 :            :         // - cursorMoved
    1157                 :        210 :         notifyAllListenersCursorMoved( _rGuard );
    1158                 :            : 
    1159                 :            :     OSL_TRACE("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1160                 :        230 : }
    1161                 :            : 
    1162                 :        110 : void ORowSetBase::checkPositioningAllowed() throw( SQLException, RuntimeException )
    1163                 :            : {
    1164                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::checkPositioningAllowed" );
    1165 [ +  + ][ -  + ]:        110 :     if(!m_pCache || m_nResultSetType == ResultSetType::FORWARD_ONLY)
    1166 [ +  - ][ -  + ]:          2 :         throwFunctionSequenceException(*m_pMySelf);
    1167                 :        108 : }
    1168                 :            : 
    1169                 :          2 : Reference< XInterface >  ORowSetBase::getStatement(void) throw( SQLException, RuntimeException )
    1170                 :            : {
    1171                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getStatement" );
    1172                 :          2 :     return NULL;
    1173                 :            : }
    1174                 :            : 
    1175                 :          2 : void SAL_CALL ORowSetBase::refreshRow(  ) throw(SQLException, RuntimeException)
    1176                 :            : {
    1177                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::refreshRow" );
    1178         [ +  - ]:          2 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
    1179         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1180         [ +  - ]:          2 :     checkCache();
    1181         [ -  + ]:          2 :     if ( impl_rowDeleted() )
    1182 [ #  # ][ #  # ]:          0 :         throwSQLException( "The current row is deleted", SQL_INVALID_CURSOR_STATE, Reference< XRowSet >( this ) );
    1183                 :            : 
    1184 [ +  - ][ +  - ]:          2 :     if(!(m_bBeforeFirst || m_bAfterLast))
    1185                 :            :     {
    1186 [ +  - ][ -  + ]:          2 :         sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
    1187         [ +  - ]:          2 :         ORowSetRow aOldValues = getOldRow(bWasNew);
    1188         [ +  - ]:          2 :         positionCache( MOVE_NONE_REFRESH_ONLY );
    1189         [ +  - ]:          2 :         m_pCache->refreshRow();
    1190 [ +  - ][ +  - ]:          2 :         firePropertyChange(aOldValues);
    1191         [ +  - ]:          2 :     }
    1192                 :          2 : }
    1193                 :            : 
    1194                 :          2 : sal_Bool SAL_CALL ORowSetBase::rowUpdated(  ) throw(SQLException, RuntimeException)
    1195                 :            : {
    1196                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowUpdated" );
    1197         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1198         [ +  - ]:          2 :     checkCache();
    1199                 :            : 
    1200         [ -  + ]:          2 :     if ( impl_rowDeleted() )
    1201                 :          0 :         return sal_False;
    1202                 :            : 
    1203 [ +  - ][ +  - ]:          2 :     return m_pCache->rowUpdated();
    1204                 :            : }
    1205                 :            : 
    1206                 :          2 : sal_Bool SAL_CALL ORowSetBase::rowInserted(  ) throw(SQLException, RuntimeException)
    1207                 :            : {
    1208                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowInserted" );
    1209         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1210                 :            : 
    1211         [ +  - ]:          2 :     checkCache();
    1212                 :            : 
    1213         [ -  + ]:          2 :     if ( impl_rowDeleted() )
    1214                 :          0 :         return sal_False;
    1215                 :            : 
    1216 [ +  - ][ +  - ]:          2 :     return m_pCache->rowInserted();
    1217                 :            : }
    1218                 :            : 
    1219                 :        438 : sal_Bool SAL_CALL ORowSetBase::rowDeleted(  ) throw(SQLException, RuntimeException)
    1220                 :            : {
    1221                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::rowDeleted" );
    1222         [ +  - ]:        438 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1223         [ +  - ]:        438 :     checkCache();
    1224         [ +  - ]:        438 :     return impl_rowDeleted();
    1225                 :            : }
    1226                 :            : 
    1227                 :       2310 : sal_Bool ORowSetBase::impl_rowDeleted(  )
    1228                 :            : {
    1229 [ +  + ][ +  + ]:       2310 :     return !m_aBookmark.hasValue() && !m_bBeforeFirst && !m_bAfterLast;
                 [ +  + ]
    1230                 :            : }
    1231                 :            : 
    1232                 :            : // XWarningsSupplier
    1233                 :          0 : Any SAL_CALL ORowSetBase::getWarnings(  ) throw(SQLException, RuntimeException)
    1234                 :            : {
    1235                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getWarnings" );
    1236         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1237                 :            : 
    1238         [ #  # ]:          0 :     if ( m_pCache )
    1239                 :            :     {
    1240 [ #  # ][ #  # ]:          0 :         Reference< XWarningsSupplier > xWarnings( m_pCache->m_xSet.get(), UNO_QUERY );
    1241         [ #  # ]:          0 :         if ( xWarnings.is() )
    1242 [ #  # ][ #  # ]:          0 :             return xWarnings->getWarnings();
                 [ #  # ]
    1243                 :            :     }
    1244                 :            : 
    1245         [ #  # ]:          0 :     return Any();
    1246                 :            : }
    1247                 :            : 
    1248                 :          0 : void SAL_CALL ORowSetBase::clearWarnings(  ) throw(SQLException, RuntimeException)
    1249                 :            : {
    1250                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::clearWarnings" );
    1251         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1252                 :            : 
    1253         [ #  # ]:          0 :     if ( m_pCache )
    1254                 :            :     {
    1255 [ #  # ][ #  # ]:          0 :         Reference< XWarningsSupplier > xWarnings( m_pCache->m_xSet.get(), UNO_QUERY );
    1256         [ #  # ]:          0 :         if ( xWarnings.is() )
    1257 [ #  # ][ #  # ]:          0 :             xWarnings->clearWarnings();
    1258         [ #  # ]:          0 :     }
    1259                 :          0 : }
    1260                 :            : 
    1261                 :        242 : void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow)
    1262                 :            : {
    1263         [ -  + ]:        242 :     if (!isPropertyChangeNotificationEnabled())
    1264                 :        242 :         return;
    1265                 :            : 
    1266                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::firePropertyChange" );
    1267                 :            :     OSL_TRACE("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1268                 :            :     OSL_ENSURE(m_pColumns,"Columns can not be NULL here!");
    1269                 :        242 :     sal_Int32 i=0;
    1270                 :            :     try
    1271                 :            :     {
    1272                 :        242 :         TDataColumns::iterator aEnd = m_aDataColumns.end();
    1273 [ +  - ][ +  + ]:       3244 :         for(TDataColumns::iterator aIter = m_aDataColumns.begin();aIter != aEnd;++aIter,++i)
    1274 [ +  + ][ +  - ]:       3002 :             (*aIter)->fireValueChange(_rOldRow.is() ? (_rOldRow->get())[i+1] : ::connectivity::ORowSetValue());
         [ +  - ][ +  - ]
           [ +  -  #  # ]
    1275                 :            :     }
    1276                 :          0 :     catch (const Exception&)
    1277                 :            :     {
    1278                 :            :         OSL_FAIL("firePropertyChange: Exception");
    1279                 :            :     }
    1280                 :            :     OSL_TRACE("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1281                 :            : }
    1282                 :            : 
    1283                 :         12 : void ORowSetBase::firePropertyChange(sal_Int32 _nPos,const ::connectivity::ORowSetValue& _rOldValue)
    1284                 :            : {
    1285                 :            :     OSL_ENSURE(_nPos < (sal_Int32)m_aDataColumns.size(),"nPos is invalid!");
    1286                 :         12 :     m_aDataColumns[_nPos]->fireValueChange(_rOldValue);
    1287                 :         12 : }
    1288                 :            : 
    1289                 :         16 : void ORowSetBase::fireRowcount()
    1290                 :            : {
    1291                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::fireRowcount" );
    1292                 :         16 : }
    1293                 :            : 
    1294                 :         16 : sal_Bool ORowSetBase::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& /*_rGuard*/)
    1295                 :            : {
    1296                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListenersCursorBeforeMove" );
    1297                 :         16 :     return sal_True;
    1298                 :            : }
    1299                 :            : 
    1300                 :         16 : void ORowSetBase::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& /*_rGuard*/)
    1301                 :            : {
    1302                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListenersCursorMoved" );
    1303                 :         16 : }
    1304                 :            : 
    1305                 :          0 : void ORowSetBase::notifyAllListeners(::osl::ResettableMutexGuard& /*_rGuard*/)
    1306                 :            : {
    1307                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::notifyAllListeners" );
    1308                 :          0 : }
    1309                 :            : 
    1310                 :         16 : sal_Bool ORowSetBase::isPropertyChangeNotificationEnabled() const
    1311                 :            : {
    1312                 :         16 :     return sal_True;
    1313                 :            : }
    1314                 :            : 
    1315                 :         28 : void ORowSetBase::fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld )
    1316                 :            : {
    1317                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::fireProperty" );
    1318         [ +  - ]:         28 :     Any aNew = bool2any( _bNew );
    1319         [ +  - ]:         28 :     Any aOld = bool2any( _bOld );
    1320         [ +  - ]:         28 :     fire( &_nProperty, &aNew, &aOld, 1, sal_False );
    1321                 :         28 : }
    1322                 :            : 
    1323                 :        386 : void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection )
    1324                 :            : {
    1325                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::positionCache" );
    1326                 :            :     OSL_TRACE("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1327                 :            : 
    1328                 :        386 :     sal_Bool bSuccess = sal_False;
    1329         [ +  + ]:        386 :     if ( m_aBookmark.hasValue() )
    1330                 :            :     {
    1331                 :        374 :         bSuccess = m_pCache->moveToBookmark( m_aBookmark );
    1332                 :            :     }
    1333                 :            :     else
    1334                 :            :     {
    1335         [ +  + ]:         12 :         if ( m_bBeforeFirst )
    1336                 :            :         {
    1337                 :         10 :             bSuccess = m_pCache->beforeFirst();
    1338                 :            :         }
    1339         [ -  + ]:          2 :         else if ( m_bAfterLast )
    1340                 :            :         {
    1341                 :          0 :             bSuccess = m_pCache->afterLast();
    1342                 :            :         }
    1343                 :            :         else
    1344                 :            :         {
    1345                 :            :             OSL_ENSURE( m_nDeletedPosition >= 1, "ORowSetBase::positionCache: no bookmark, and no valid 'deleted position'!" );
    1346   [ +  -  -  - ]:          2 :             switch ( _ePrepareForDirection )
    1347                 :            :             {
    1348                 :            :             case MOVE_FORWARD:
    1349         [ +  - ]:          2 :                 if ( m_nDeletedPosition > 1 )
    1350                 :          2 :                     bSuccess = m_pCache->absolute( m_nDeletedPosition - 1 );
    1351                 :            :                 else
    1352                 :            :                 {
    1353                 :          0 :                     m_pCache->beforeFirst();
    1354                 :          0 :                     bSuccess = sal_True;
    1355                 :            :                 }
    1356                 :          2 :                 break;
    1357                 :            : 
    1358                 :            :             case MOVE_BACKWARD:
    1359 [ #  # ][ #  # ]:          0 :                 if ( m_pCache->m_bRowCountFinal && ( m_nDeletedPosition == impl_getRowCount() ) )
                 [ #  # ]
    1360                 :            :                 {
    1361                 :          0 :                     m_pCache->afterLast();
    1362                 :          0 :                     bSuccess = sal_True;
    1363                 :            :                 }
    1364                 :            :                 else
    1365                 :          0 :                     bSuccess = m_pCache->absolute( m_nDeletedPosition );
    1366                 :          0 :                 break;
    1367                 :            : 
    1368                 :            :             case MOVE_NONE_REFRESH_ONLY:
    1369                 :          0 :                 bSuccess = sal_False;   // will be asserted below
    1370                 :          0 :                 break;
    1371                 :            :             }
    1372                 :            :         }
    1373                 :            :     }
    1374                 :            :     OSL_ENSURE( bSuccess, "ORowSetBase::positionCache: failed!" );
    1375                 :            :     (void)bSuccess;
    1376                 :            : 
    1377                 :            :     OSL_TRACE("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1378                 :        386 : }
    1379                 :            : 
    1380                 :       6642 : void ORowSetBase::checkCache()
    1381                 :            : {
    1382                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::checkCache" );
    1383                 :       6642 :     ::connectivity::checkDisposed(m_rBHelper.bDisposed);
    1384         [ -  + ]:       6642 :     if(!m_pCache)
    1385 [ #  # ][ #  # ]:          0 :         throwFunctionSequenceException(*m_pMySelf);
    1386                 :       6642 : }
    1387                 :            : 
    1388                 :          4 : void ORowSetBase::movementFailed()
    1389                 :            : {
    1390                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::movementFailed" );
    1391                 :            :     OSL_TRACE("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1392                 :          4 :     m_aOldRow->clearRow();
    1393                 :          4 :     m_aCurrentRow   = m_pCache->getEnd();
    1394                 :          4 :     m_bBeforeFirst  = m_pCache->isBeforeFirst();
    1395                 :          4 :     m_bAfterLast    = m_pCache->isAfterLast();
    1396                 :          4 :     m_aBookmark     = Any();
    1397                 :          4 :     m_aCurrentRow.setBookmark(m_aBookmark);
    1398                 :            :     OSL_ENSURE(m_bBeforeFirst || m_bAfterLast,"BeforeFirst or AfterLast is wrong!");
    1399                 :            :     OSL_TRACE("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i",m_bClone,osl_getThreadIdentifier(NULL));
    1400                 :          4 : }
    1401                 :            : 
    1402                 :        234 : ORowSetRow ORowSetBase::getOldRow(sal_Bool _bWasNew)
    1403                 :            : {
    1404                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getOldRow" );
    1405                 :            :     OSL_ENSURE(m_aOldRow.is(),"RowSetRowHElper isn't valid!");
    1406                 :        234 :     ORowSetRow aOldValues;
    1407 [ +  - ][ +  + ]:        234 :     if ( !_bWasNew && m_aOldRow->getRow().is() )
         [ +  + ][ +  - ]
           [ +  +  #  # ]
                 [ +  + ]
    1408 [ +  - ][ +  - ]:        176 :         aOldValues = new ORowSetValueVector( *(m_aOldRow->getRow()));    // remember the old values
         [ +  - ][ +  - ]
    1409                 :        234 :     return aOldValues;
    1410                 :            : }
    1411                 :            : 
    1412                 :          0 : void ORowSetBase::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const
    1413                 :            : {
    1414                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getPropertyDefaultByHandle" );
    1415                 :          0 :     _rDefault.clear();
    1416                 :          0 : }
    1417                 :            : 
    1418                 :          2 : void ORowSetBase::onDeleteRow( const Any& _rBookmark )
    1419                 :            : {
    1420                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::onDeleteRow" );
    1421 [ +  - ][ +  - ]:          2 :     if ( rowDeleted() )
    1422                 :            :         // not interested in
    1423                 :          2 :         return;
    1424                 :            : 
    1425         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1426                 :            :     //OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::onDeleteRow: Bookmark isn't valid!" );
    1427 [ +  - ][ +  - ]:          2 :     if ( compareBookmarks( _rBookmark, m_aBookmark ) == 0 )
    1428                 :            :     {
    1429         [ +  - ]:          2 :         positionCache( MOVE_NONE_REFRESH_ONLY );
    1430         [ +  - ]:          2 :         m_nDeletedPosition = m_pCache->getRow();
    1431         [ +  - ]:          2 :     }
    1432                 :            : }
    1433                 :            : 
    1434                 :          2 : void ORowSetBase::onDeletedRow( const Any& _rBookmark, sal_Int32 _nPos )
    1435                 :            : {
    1436                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::onDeletedRow" );
    1437 [ +  - ][ -  + ]:          2 :     if ( rowDeleted() )
    1438                 :            :     {
    1439                 :            :         // if we're a clone, and on a deleted row, and the main RowSet deleted another
    1440                 :            :         // row (only the main RowSet can, clones can't), which is *before* our
    1441                 :            :         // deleted position, then we have to adjust this position
    1442 [ #  # ][ #  # ]:          0 :         if ( m_bClone && ( _nPos < m_nDeletedPosition ) )
    1443                 :          0 :             --m_nDeletedPosition;
    1444                 :          2 :         return;
    1445                 :            :     }
    1446                 :            : 
    1447         [ +  - ]:          2 :     ::osl::MutexGuard aGuard( *m_pMutex );
    1448 [ +  - ][ +  - ]:          2 :     if ( compareBookmarks( _rBookmark, m_aBookmark ) == 0 )
    1449                 :            :     {
    1450         [ +  - ]:          2 :         m_aOldRow->clearRow();
    1451         [ +  - ]:          2 :         m_aCurrentRow   = m_pCache->getEnd();
    1452                 :          2 :         m_aBookmark     = Any();
    1453         [ +  - ]:          2 :         m_aCurrentRow.setBookmark( m_aBookmark );
    1454         [ +  - ]:          2 :     }
    1455                 :            : }
    1456                 :            : 
    1457                 :        281 : sal_Int32 ORowSetBase::impl_getRowCount() const
    1458                 :            : {
    1459                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getRowCount" );
    1460                 :        281 :     sal_Int32 nRowCount( m_pCache->m_nRowCount );
    1461 [ +  + ][ +  - ]:        281 :     if ( const_cast< ORowSetBase* >( this )->rowDeleted() && !m_pCache->m_bNew )
                 [ +  + ]
    1462                 :          4 :         ++nRowCount;
    1463                 :        281 :     return nRowCount;
    1464                 :            : }
    1465                 :            : // =============================================================================
    1466 [ +  - ][ +  - ]:         24 : struct ORowSetNotifierImpl
    1467                 :            : {
    1468                 :            :     ::std::vector<sal_Int32>    aChangedColumns;
    1469                 :            :     ::std::vector<Any>          aChangedBookmarks;
    1470                 :            :     ORowSetValueVector::Vector  aRow;
    1471                 :            : 
    1472                 :            : };
    1473                 :            : DBG_NAME(ORowSetNotifier)
    1474                 :            : 
    1475                 :        236 : ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet )
    1476                 :            :     :m_pRowSet( _pRowSet )
    1477                 :            :     ,m_bWasNew( sal_False )
    1478                 :        236 :     ,m_bWasModified( sal_False )
    1479                 :            : #ifdef DBG_UTIL
    1480                 :            :     ,m_bNotifyCalled( sal_False )
    1481                 :            : #endif
    1482                 :            : {
    1483                 :            :     DBG_CTOR(ORowSetNotifier,NULL);
    1484                 :            : 
    1485                 :            :     OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This wil crash." );
    1486                 :            : 
    1487                 :            :     // remember the "inserted" and "modified" state for later firing
    1488         [ +  - ]:        236 :     m_bWasNew       = m_pRowSet->isNew( ORowSetBase::GrantNotifierAccess() );
    1489         [ +  - ]:        236 :     m_bWasModified  = m_pRowSet->isModified( ORowSetBase::GrantNotifierAccess() );
    1490                 :            : 
    1491                 :            :     // if the row set is on the insert row, then we need to cancel this
    1492 [ +  - ][ -  + ]:        236 :     if ( m_pRowSet->isModification( ORowSetBase::GrantNotifierAccess() ) )
    1493         [ #  # ]:          0 :         m_pRowSet->doCancelModification( ORowSetBase::GrantNotifierAccess() );
    1494                 :        236 : }
    1495                 :            : 
    1496                 :         12 : ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet,const ORowSetValueVector::Vector& i_aRow )
    1497         [ +  - ]:         12 :     :m_pImpl(new ORowSetNotifierImpl)
    1498                 :            :     ,m_pRowSet( _pRowSet )
    1499                 :            :     ,m_bWasNew( sal_False )
    1500                 :         24 :     ,m_bWasModified( sal_False )
    1501                 :            : #ifdef DBG_UTIL
    1502                 :            :     ,m_bNotifyCalled( sal_False )
    1503                 :            : #endif
    1504                 :            : {
    1505                 :            :     DBG_CTOR(ORowSetNotifier,NULL);
    1506                 :            : 
    1507                 :            :     OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This wil crash." );
    1508         [ +  - ]:         12 :     m_pImpl->aRow = i_aRow; // yes, create a copy to store the old values
    1509                 :         12 : }
    1510                 :            : 
    1511                 :        248 : ORowSetNotifier::~ORowSetNotifier( )
    1512                 :            : {
    1513                 :            :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetNotifier::~ORowSetNotifier" );
    1514                 :            :     DBG_DTOR(ORowSetNotifier,NULL);
    1515                 :        248 : }
    1516                 :            : 
    1517                 :        236 : void ORowSetNotifier::fire()
    1518                 :            : {
    1519                 :            :     // we're not interested in firing changes FALSE->TRUE, only TRUE->FALSE.
    1520                 :            :     // (the former would be quite pathological, e.g. after a failed movement)
    1521                 :            : 
    1522 [ +  + ][ +  - ]:        474 :     if  (   m_bWasModified
                 [ +  + ]
    1523 [ +  - ][ +  + ]:        238 :         &&  ( m_bWasModified != m_pRowSet->isModified( ORowSetBase::GrantNotifierAccess() ) )
                 [ #  # ]
    1524                 :            :         )
    1525         [ +  - ]:          2 :         m_pRowSet->fireProperty( PROPERTY_ID_ISMODIFIED, sal_False, sal_True, ORowSetBase::GrantNotifierAccess() );
    1526                 :            : 
    1527 [ -  + ][ #  # ]:        472 :     if  (   m_bWasNew
                 [ -  + ]
    1528 [ #  # ][ -  + ]:        236 :         &&  ( m_bWasNew != m_pRowSet->isNew( ORowSetBase::GrantNotifierAccess() ) )
                 [ #  # ]
    1529                 :            :         )
    1530         [ #  # ]:          0 :         m_pRowSet->fireProperty( PROPERTY_ID_ISNEW, sal_False, sal_True, ORowSetBase::GrantNotifierAccess() );
    1531                 :            : 
    1532                 :            : #ifdef DBG_UTIL
    1533                 :            :     m_bNotifyCalled = sal_True;
    1534                 :            : #endif
    1535                 :        236 : }
    1536                 :            : 
    1537                 :         24 : ::std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const
    1538                 :            : {
    1539                 :            :     OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!");
    1540                 :         24 :     return m_pImpl->aChangedColumns;
    1541                 :            : }
    1542                 :            : 
    1543                 :         12 : void ORowSetNotifier::firePropertyChange()
    1544                 :            : {
    1545                 :            :     OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!");
    1546         [ +  - ]:         12 :     if( m_pImpl.get() )
    1547                 :            :     {
    1548                 :         12 :         ::std::vector<sal_Int32>::iterator aIter = m_pImpl->aChangedColumns.begin();
    1549 [ +  - ][ +  - ]:         24 :         for(;aIter != m_pImpl->aChangedColumns.end();++aIter)
                 [ +  + ]
    1550                 :            :         {
    1551 [ +  - ][ +  - ]:         12 :             m_pRowSet->firePropertyChange((*aIter)-1 ,m_pImpl->aRow[(*aIter)-1], ORowSetBase::GrantNotifierAccess());
         [ +  - ][ +  - ]
    1552                 :            :         }
    1553         [ +  - ]:         12 :         if ( !m_pImpl->aChangedColumns.empty() )
    1554         [ +  - ]:         12 :             m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,sal_True,sal_False, ORowSetBase::GrantNotifierAccess());
    1555                 :            :     }
    1556                 :         12 : }
    1557                 :            : }   // namespace dbaccess
    1558                 :            : 
    1559                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10