diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-18 11:34:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-18 11:36:07 -0500 |
commit | 7dcfafc7d2f7ce8357c1570ea7547b5879f54172 (patch) | |
tree | 3dcc974434d602e0954d969da210992d9eb65321 /sc | |
parent | cb3992630ce2452d1eb599ff1268efb4a1b99e04 (diff) |
Let's not re-use the same iterator esp when it's still iterating.
Change-Id: I1752857bc036f8d389b4b71d570cf83a76ef29ea
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/columnspanset.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/column4.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/columnspanset.cxx | 9 |
3 files changed, 13 insertions, 5 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx index 48ae7c1e65ec..63e8c9025e63 100644 --- a/sc/inc/columnspanset.hxx +++ b/sc/inc/columnspanset.hxx @@ -25,6 +25,7 @@ class ScRangeList; namespace sc { struct ColumnBlockConstPosition; +class SingleColumnSpanSet; struct RowSpan { @@ -92,6 +93,8 @@ public: void set(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, bool bVal); void set(const ScRange& rRange, bool bVal); + void set( SCTAB nTab, SCCOL nCol, const SingleColumnSpanSet& rSingleSet, bool bVal ); + /** * Scan specified range in a specified sheet and mark all non-empty cells * with specified boolean value. diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index 2316a265ee7e..b0d1d50d8d46 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -110,11 +110,7 @@ void ScColumn::DeleteBeforeCopyFromClip( { sc::SingleColumnSpanSet aDeletedRows; DeleteCells(aBlockPos, nRow1, nRow2, nDelFlag, aDeletedRows); - aDeletedRows.getSpans(aSpans); - it = aSpans.begin(); - itEnd = aSpans.end(); - for (; it != itEnd; ++it) - rBroadcastSpans.set(nTab, nCol, it->mnRow1, it->mnRow2, true); + rBroadcastSpans.set(nTab, nCol, aDeletedRows, true); } if (nDelFlag & IDF_NOTE) diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx index fe10528bc9c0..6132906db33a 100644 --- a/sc/source/core/data/columnspanset.cxx +++ b/sc/source/core/data/columnspanset.cxx @@ -120,6 +120,15 @@ void ColumnSpanSet::set(const ScRange& rRange, bool bVal) } } +void ColumnSpanSet::set( SCTAB nTab, SCCOL nCol, const SingleColumnSpanSet& rSingleSet, bool bVal ) +{ + SingleColumnSpanSet::SpansType aSpans; + rSingleSet.getSpans(aSpans); + SingleColumnSpanSet::SpansType::const_iterator it = aSpans.begin(), itEnd = aSpans.end(); + for (; it != itEnd; ++it) + set(nTab, nCol, it->mnRow1, it->mnRow2, bVal); +} + void ColumnSpanSet::scan( const ScDocument& rDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bVal) { |