diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
commit | b6693080a17418cf79b55f77add3bf7a84f00060 (patch) | |
tree | 2f2609e3549481a37d47fbf869224be6e0642b34 /dbaccess/source/ui/browser/sbagrid.cxx | |
parent | 52cc8fded55d1761c6913a3704a03a7c137a7f3d (diff) | |
parent | fd8c2dd9780e8b3f4e9d26783f477452ff62a17c (diff) |
dba33f: merge with m76-branch
Diffstat (limited to 'dbaccess/source/ui/browser/sbagrid.cxx')
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 60bed33b48ae..bb0784c0ce53 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1440,39 +1440,30 @@ void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) // ----------------------------------------------------------------------- void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { - Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); - DBG_ASSERT(xDataSource.is(), "SbaGridControl::implTransferSelectedRows : invalid data source !"); + Reference< XPropertySet > xForm( getDataSource(), UNO_QUERY ); + DBG_ASSERT( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); // build the sequence of numbers of selected rows Sequence< Any > aSelectedRows; + sal_Bool bSelectionBookmarks = sal_True; // collect the affected rows if ((GetSelectRowCount() == 0) && (nRowPos >= 0)) { - aSelectedRows.realloc(1); + aSelectedRows.realloc( 1 ); aSelectedRows[0] <<= (sal_Int32)(nRowPos + 1); + bSelectionBookmarks = sal_False; } else if ( !IsAllSelected() && GetSelectRowCount() ) { - aSelectedRows.realloc(GetSelectRowCount()); - Any* pSelectedRows = aSelectedRows.getArray(); - - for (long nIdx = FirstSelectedRow(); - nIdx >= 0; - nIdx = NextSelectedRow(), ++pSelectedRows) - { - (*pSelectedRows) <<= (sal_Int32)(nIdx + 1); - } + aSelectedRows = getSelectionBookmarks(); + bSelectionBookmarks = sal_True; } Reference< XResultSet> xRowSetClone; try { - Reference< XResultSetAccess > xResultSetAccess(xDataSource,UNO_QUERY); - if ( xResultSetAccess.is() ) - xRowSetClone = xResultSetAccess->createResultSet(); - - ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone, getServiceManager()); + ODataClipboard* pTransfer = new ODataClipboard( xForm, aSelectedRows, bSelectionBookmarks, getServiceManager() ); Reference< XTransferable > xEnsureDelete = pTransfer; if ( _bTrueIfClipboardFalseIfDrag ) |