[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Mon Jul 8 07:15:50 PDT 2013


 sc/source/core/data/column3.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 6d9f0ed332aeb421d71b8cf1fb8baf9f8bededce
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Jul 8 10:15:27 2013 -0400

    Re-group formula cells in DeleteRow().
    
    Change-Id: Ic67af048baa55cf1aee118ec741f140831127a95

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f39d1f8..e363ab0 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -296,9 +296,14 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
     maCells.erase(nStartRow, nEndRow);
     maCells.resize(MAXROWCOUNT);
 
+    // Get the position again after the container change.
+    aPos = maCells.position(nStartRow);
+
     // Shift the formula cell positions below the start row.
     ShiftFormulaPosHandler aShiftFormulaFunc;
-    sc::ProcessFormula(maCells.begin(), maCells, nStartRow, MAXROW, aShiftFormulaFunc);
+    sc::ProcessFormula(aPos.first, maCells, nStartRow, MAXROW, aShiftFormulaFunc);
+
+    JoinFormulaCellAbove(aPos);
 
     // Single cell broadcasts on deleted cells.
     BroadcastCells(aDeleteRowsFunc.getNonEmptyRows());
@@ -307,7 +312,6 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
     maCellTextAttrs.erase(nStartRow, nEndRow);
     maCellTextAttrs.resize(MAXROWCOUNT);
 
-    RegroupFormulaCells(nStartRow);
     CellStorageModified();
 
     if (!bShiftCells)
@@ -598,8 +602,6 @@ void ScColumn::JoinFormulaCellAbove( const sc::CellStoreType::position_type& aPo
         // cell is not a formula cell.
         return;
 
-    SCROW nRow = aPos.first->position + aPos.second;
-
     ScFormulaCell& rPrev = *sc::formula_block::at(*aPos.first->data, aPos.second-1);
     ScFormulaCell& rCell = *sc::formula_block::at(*aPos.first->data, aPos.second);
     sc::CellStoreType::position_type aPosPrev = aPos;


More information about the Libreoffice-commits mailing list