summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-18 11:34:21 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-18 11:36:07 -0500
commit7dcfafc7d2f7ce8357c1570ea7547b5879f54172 (patch)
tree3dcc974434d602e0954d969da210992d9eb65321 /sc/source/core/data
parentcb3992630ce2452d1eb599ff1268efb4a1b99e04 (diff)
Let's not re-use the same iterator esp when it's still iterating.
Change-Id: I1752857bc036f8d389b4b71d570cf83a76ef29ea
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column4.cxx6
-rw-r--r--sc/source/core/data/columnspanset.cxx9
2 files changed, 10 insertions, 5 deletions
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)
{