diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-21 20:50:59 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-21 20:55:53 -0500 |
commit | 5432e2a5ef7a3e131d2496e19bd0c6a86955319f (patch) | |
tree | cf7a7139a56e88795274de6d53f2cc2362454887 /sc/inc | |
parent | 5dd60299c668cd36cc5cc5e8bd5b162e1fc9ef13 (diff) |
Use group area listeners when deleting rows.
Change-Id: I9ceb1cabf448349e087e4d5c4c2b1a75af91dd75
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 12 | ||||
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/inc/sharedformula.hxx | 12 | ||||
-rw-r--r-- | sc/inc/table.hxx | 4 |
4 files changed, 23 insertions, 6 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 7c6b2cd0d3b8..102af126fc78 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -229,7 +229,14 @@ public: bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const; bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const; void InsertRow( SCROW nStartRow, SCSIZE nSize ); - void DeleteRow( SCROW nStartRow, SCSIZE nSize ); + + /** + * @param nStartRow top row position + * @param nSize size of the segment to delete. + * @param pGroupPos when non-NULL, stores the top position of formula + * group that's been merged as a result of row deletion. + */ + void DeleteRow( SCROW nStartRow, SCSIZE nSize, std::vector<ScAddress>* pGroupPos = NULL ); void DeleteArea( SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag, @@ -592,7 +599,7 @@ public: /** * Regroup formula cells for the entire column. */ - void RegroupFormulaCells(); + void RegroupFormulaCells( std::vector<ScAddress>* pGroupPos = NULL ); /** * Reset column position of formula cells within specified row range. @@ -669,6 +676,7 @@ private: void EndListeningIntersectedGroups( sc::EndListeningContext& rCxt, SCROW nRow1, SCROW nRow2, std::vector<ScAddress>* pGroupPos = NULL ); + void EndListeningGroup( sc::EndListeningContext& rCxt, SCROW nRow ); void SetNeedsListeningGroup( SCROW nRow ); }; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 3dcdf08c0082..554ee3a9afc1 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2183,6 +2183,7 @@ private: void EndListeningIntersectedGroups( sc::EndListeningContext& rCxt, const ScRange& rRange, std::vector<ScAddress>* pGroupPos = NULL ); + void EndListeningGroups( const std::vector<ScAddress>& rPosArray ); void SetNeedsListeningGroups( const std::vector<ScAddress>& rPosArray ); }; diff --git a/sc/inc/sharedformula.hxx b/sc/inc/sharedformula.hxx index e1799bf70e0b..d94d8fe39e08 100644 --- a/sc/inc/sharedformula.hxx +++ b/sc/inc/sharedformula.hxx @@ -82,17 +82,23 @@ public: * @param rPos position object of the first cell * @param rCell1 first cell * @param rCell2 second cell located immediately below the first cell. + * + * @return true if the cells are merged, false otherwise. If the two + * cells already belong to the same group, it returns false. */ - static void joinFormulaCells( - const CellStoreType::position_type& rPos, ScFormulaCell& rCell1, ScFormulaCell& rCell2); + static bool joinFormulaCells( + const CellStoreType::position_type& rPos, ScFormulaCell& rCell1, ScFormulaCell& rCell2 ); /** * Merge with an existing formula group (if any) located immediately above * if the cell at specified position is a formula cell, and its formula * tokens are identical to that of the above formula group. * * @param aPos position of cell to examine. + * + * @return true if the cells are merged, false otherwise. If the two + * cells already belong to the same group, it returns false. */ - static void joinFormulaCellAbove(const CellStoreType::position_type& aPos); + static bool joinFormulaCellAbove( const CellStoreType::position_type& aPos ); /** * Turn a shared formula cell into a non-shared one, and split it off from diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 56af84199250..0d0a5c43a9c0 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -403,7 +403,8 @@ public: bool TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize ) const; void InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize ); void DeleteRow( - const sc::ColumnSet& rRegroupCols, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize, bool* pUndoOutline = NULL ); + const sc::ColumnSet& rRegroupCols, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize, + bool* pUndoOutline = NULL, std::vector<ScAddress>* pGroupPos = NULL ); bool TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) const; void InsertCol( @@ -1113,6 +1114,7 @@ private: sc::EndListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, std::vector<ScAddress>* pGroupPos = NULL ); + void EndListeningGroup( sc::EndListeningContext& rCxt, SCCOL nCol, SCROW nRow ); void SetNeedsListeningGroup( SCCOL nCol, SCROW nRow ); /** |