Tag: cws_src680_rowsetdel
User: fs      
Date: 06/01/18 06:50:31

Modified:
 /dba/dbaccess/source/core/api/
  RowSet.cxx, RowSetBase.cxx

Log:
 #i55731# some more fine-tuning to the behaviour when deleting a row

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: RowSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.139.16.2&r2=1.139.16.3
Delta lines:  +15 -8
--------------------
--- RowSet.cxx  18 Jan 2006 13:57:33 -0000      1.139.16.2
+++ RowSet.cxx  18 Jan 2006 14:50:28 -0000      1.139.16.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSet.cxx,v $
  *
- *  $Revision: 1.139.16.2 $
+ *  $Revision: 1.139.16.3 $
  *
- *  last change: $Author: fs $ $Date: 2006/01/18 13:57:33 $
+ *  last change: $Author: fs $ $Date: 2006/01/18 14:50:28 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1273,8 +1273,8 @@
 
                if ( rowDeleted() )
         {
-                       positionCache( MOVE_BACKWARD );
-                   m_pCache->previous();
+                       positionCache( MOVE_FORWARD );
+                   m_pCache->next();
                        setCurrentRow( sal_True, sal_False, aOldValues, aGuard 
);
         }
         else
@@ -1309,8 +1309,8 @@
                if ( bNewState != m_bNew )
                        fireProperty( PROPERTY_ID_ISNEW, m_bNew, bNewState );
 
-//        // - RowCount/IsRowCountFinal
-//         fireRowcount();
+        // - RowCount/IsRowCountFinal
+           fireRowcount();
        }
 }
 // -------------------------------------------------------------------------
@@ -2495,8 +2495,15 @@
 // 
-----------------------------------------------------------------------------
 void ORowSet::checkUpdateConditions(sal_Int32 columnIndex)
 {
-       if(!m_pCache || columnIndex <= 0 || m_aCurrentRow.isNull() || 
m_aCurrentRow == m_pCache->getEnd() || m_nResultSetConcurrency == 
ResultSetConcurrency::READ_ONLY)
-               throwFunctionSequenceException(*this);
+    checkCache();
+    if ( columnIndex <= 0 )
+        throwSQLException( "Invalid column index", 
SQL_INVALID_DESCRIPTOR_INDEX, *this );
+    if ( rowDeleted() )
+        throwSQLException( "Current row is deleted", 
SQL_INVALID_CURSOR_POSITION, *this );
+       if ( m_aCurrentRow.isNull() || m_aCurrentRow == m_pCache->getEnd() )
+        throwSQLException( "Invalid cursor state", SQL_INVALID_CURSOR_STATE, 
*this );
+    if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY)
+        throwSQLException( "Result set is not writeable", SQL_GENERAL_ERROR, 
*this );
 }
 // 
-----------------------------------------------------------------------------
 void SAL_CALL ORowSet::refreshRow(  ) throw(SQLException, RuntimeException)

File [changed]: RowSetBase.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.cxx?r1=1.80.12.2&r2=1.80.12.3
Delta lines:  +9 -4
-------------------
--- RowSetBase.cxx      18 Jan 2006 13:58:39 -0000      1.80.12.2
+++ RowSetBase.cxx      18 Jan 2006 14:50:28 -0000      1.80.12.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSetBase.cxx,v $
  *
- *  $Revision: 1.80.12.2 $
+ *  $Revision: 1.80.12.3 $
  *
- *  last change: $Author: fs $ $Date: 2006/01/18 13:58:39 $
+ *  last change: $Author: fs $ $Date: 2006/01/18 14:50:28 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -891,8 +891,7 @@
        ::osl::ResettableMutexGuard aGuard( *m_pMutex );
        checkPositioningAllowed();
 
-       sal_Bool bRet = !(m_bAfterLast && row > 1); // m_bAfterLast && row > 1 
we are already behind the last row
-
+       sal_Bool bRet = row > 0;
        if ( bRet && (bRet = notifyAllListenersCursorBeforeMove(aGuard)) )
        {
                // check if we are inserting a row
@@ -1115,6 +1114,9 @@
        ::osl::MutexGuard aGuard( *m_pMutex );
        checkCache();
 
+    if ( rowDeleted() )
+        return sal_False;
+
        return m_pCache->rowUpdated();
 }
 // -------------------------------------------------------------------------
@@ -1122,6 +1124,9 @@
 {
        ::osl::MutexGuard aGuard( *m_pMutex );
        checkCache();
+
+    if ( rowDeleted() )
+        return sal_False;
 
        return m_pCache->rowInserted();
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to