diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-13 20:14:27 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-18 08:31:55 -0500 |
commit | 192f6a41444b62feae03185975c120f770e2938f (patch) | |
tree | b85e6c19a1465f0da8ab329dd6839978519cbec4 /sc/inc | |
parent | e969c131a2d8ca21d32e5caaa302ee904021a1e5 (diff) |
Reduce duplicate broadcasting done when pasting a range of cells from clip.
We do pasting from clip in 2 steps: 1) delete the destination range, then
2) paste the content onto the destination range. The old code would broadcast
both during 1) and 2). This change consolidates them and do broadcasting
only once at the end, and also avoids broadcasting the same cell twice,
which the old code sometimes did.
Change-Id: Ic524c2b70888ce158619d99cbfb55dea85870497
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 10 | ||||
-rw-r--r-- | sc/inc/document.hxx | 15 | ||||
-rw-r--r-- | sc/inc/table.hxx | 9 |
3 files changed, 23 insertions, 11 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index d9b208c34453..57f42df4d4d6 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -230,8 +230,11 @@ public: bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const; void InsertRow( SCROW nStartRow, SCSIZE nSize ); void DeleteRow( SCROW nStartRow, SCSIZE nSize ); + void DeleteArea( - SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag, bool bBroadcast = true ); + SCROW nStartRow, SCROW nEndRow, InsertDeleteFlags nDelFlag, + bool bBroadcast = true, sc::ColumnSpanSet* pBroadcastSpans = NULL ); + void DeleteRanges( const std::vector<sc::RowSpan>& rRanges, InsertDeleteFlags nDelFlag, bool bBroadcast ); void CopyToClip( @@ -345,7 +348,8 @@ public: bool IsFormulaDirty( SCROW nRow ) const; void SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt ); - void SetDirty( SCROW nRow1, SCROW nRow2 ); + void BroadcastInArea( SCROW nRow1, SCROW nRow2, sc::ColumnSpanSet& rBroadcastSpans ); + void SetDirty( SCROW nRow1, SCROW nRow2 ); void SetDirtyVar(); void SetDirtyAfterLoad(); void SetTableOpDirty( const ScRange& ); @@ -642,7 +646,7 @@ private: void DeleteCells( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, InsertDeleteFlags nDelFlag, - std::vector<SCROW>& rDeleted ); + std::vector<SCROW>& rDeleted, sc::ColumnSpanSet* pDeletedSpans = NULL ); /** * Get all non-grouped formula cells and formula cell groups in the whole diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 598b0241c443..3124a4cc9826 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1205,8 +1205,11 @@ public: const ScMarkData& rMark ); void DeleteObjectsInSelection( const ScMarkData& rMark ); - void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScMarkData& rMark, InsertDeleteFlags nDelFlag); + void DeleteArea( + SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark, + InsertDeleteFlags nDelFlag, bool bBroadcast = true, + sc::ColumnSpanSet* pBroadcastSpans = NULL ); + SC_DLLPUBLIC void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, InsertDeleteFlags nDelFlag); void DeleteAreaTab(const ScRange& rRange, InsertDeleteFlags nDelFlag); @@ -1254,9 +1257,11 @@ public: void StartListeningFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark, InsertDeleteFlags nInsFlag ); - void BroadcastFromClip( SCCOL nCol1, SCROW nRow1, - SCCOL nCol2, SCROW nRow2, - const ScMarkData& rMark, InsertDeleteFlags nInsFlag ); + + void BroadcastFromClip( + SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark, + InsertDeleteFlags nInsFlag, sc::ColumnSpanSet& rBroadcastSpans ); + /** If pDestRanges is given it overrides rDestRange, rDestRange in this case is the overall encompassing range. */ void CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMark, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 0b5adfa246ed..5a6f015c6280 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -411,7 +411,10 @@ public: void DeleteCol( const sc::ColumnSet& rRegroupCols, SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize, bool* pUndoOutline = NULL ); - void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nDelFlag); + void DeleteArea( + SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nDelFlag, + bool bBroadcast = true, sc::ColumnSpanSet* pBroadcastSpans = NULL ); + void CopyToClip( sc::CopyToClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable ); void CopyToClip( sc::CopyToClipContext& rCxt, const ScRangeList& rRanges, ScTable* pTable ); @@ -435,8 +438,8 @@ public: void StartListeningInArea( sc::StartListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); - void BroadcastInArea( SCCOL nCol1, SCROW nRow1, - SCCOL nCol2, SCROW nRow2 ); + void BroadcastInArea( + SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sc::ColumnSpanSet& rBroadcastSpans ); void CopyToTable( sc::CopyToDocContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, |