summaryrefslogtreecommitdiff
path: root/sc
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:49:28 -0500
commit283483ae5b78c06a6b8b6a9521500be500d43354 (patch)
treee37dc089552a4fe1b6251ed365b2ef7856f759c7 /sc
parent756d4765104dfab1a49dde07d5425774feda54ed (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.hxx3
-rw-r--r--sc/source/core/data/column4.cxx6
-rw-r--r--sc/source/core/data/columnspanset.cxx9
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)
{