[Libreoffice-commits] core.git: sc/inc sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Nov 18 08:37:10 PST 2014
sc/inc/columnspanset.hxx | 3 +++
sc/source/core/data/column4.cxx | 6 +-----
sc/source/core/data/columnspanset.cxx | 9 +++++++++
3 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 7dcfafc7d2f7ce8357c1570ea7547b5879f54172
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Nov 18 11:34:21 2014 -0500
Let's not re-use the same iterator esp when it's still iterating.
Change-Id: I1752857bc036f8d389b4b71d570cf83a76ef29ea
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index 48ae7c1..63e8c90 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 2316a26..b0d1d50 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 fe10528..6132906 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)
{
More information about the Libreoffice-commits
mailing list