dbaccess/source/core/api/RowSetCache.cxx |    1 -
 1 file changed, 1 deletion(-)

New commits:
commit eab92ae8dbc65ef528452db829472fcc4205153a
Author:     prrvchr <prrv...@gmail.com>
AuthorDate: Thu Aug 28 12:43:15 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Sep 28 13:47:02 2025 +0200

    tdf#167434 Don't call cancelRowUpdates when cursor not positioned
    
    What has been done in:
    https://gerrit.libreoffice.org/c/core/+/187567
    only solves part of the problem.
    
    Since cancelRowUpdate() is now indeed called when the ResultSet is no 
longer on the insert row, but it is still called even though the cursor is not 
positioned, in fact, at this point the cursor must be beforeFirstRow() and 
therefore cancelRowUpdate() should not be called until the cursor is positioned 
on a valid row.
    
    These three instructions (ie: moveToInsertRow(), moveToCurrentRow() and 
cancelRowUpdate()) are apparently only there to ensure that the resultSet is 
modifiable, so I consider that if we only perform moveToInsertRow() and 
moveToCurrentRow() this is sufficient to ensure that the ResultSet is 
modifiable.
    
    Moreover, this first correction introduces a nice regression because now, 
as cancelRowUpdate() is no longer called while the ResultSet is on its insert 
row, it becomes difficult to manage such a case.
    
    Change-Id: I5924376d1b483451a439db97580b81fa8e4546c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190322
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/dbaccess/source/core/api/RowSetCache.cxx 
b/dbaccess/source/core/api/RowSetCache.cxx
index 46c01a27207b..324398a60c19 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -109,7 +109,6 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& 
_xRs,
         {
             xUp->moveToInsertRow();
             xUp->moveToCurrentRow();
-            xUp->cancelRowUpdates();
             _xRs->beforeFirst();
             m_nPrivileges = 
Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
             m_xCacheSet = new WrappedResultSet(i_nMaxRows);

Reply via email to