diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 16:13:32 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 20:19:29 -0400 |
commit | 266e71c7b89234b9e8722c24dfc9ee7d4ccbd74f (patch) | |
tree | 3584ea7b927bbe88a99b81f3da5a8ef1ba2fa2d6 /sc/source | |
parent | 02304b8fc917a8af4230ddf3e26a45000550768a (diff) |
Add performance test for repeat-pasting cell to a large cell range.
Change-Id: I98dcdb1e0a72f2c3ad6f33c7b6b7d4a4bcf89096
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/column2.cxx | 12 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 9 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 8 |
3 files changed, 29 insertions, 0 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 375752c5c085..fbd0c0a26eb0 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1611,6 +1611,18 @@ void ScColumn::DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRo maBroadcasters.set_empty(rBlockPos.miBroadcasterPos, nRow1, nRow2); } +bool ScColumn::HasBroadcaster() const +{ + sc::BroadcasterStoreType::const_iterator it = maBroadcasters.begin(), itEnd = maBroadcasters.end(); + for (; it != itEnd; ++it) + { + if (it->type == sc::element_type_broadcaster) + // Having a broadcaster block automatically means there is at least one broadcaster. + return true; + } + return false; +} + sal_uInt16 ScColumn::GetTextWidth(SCROW nRow) const { return maCellTextAttrs.get<sc::CellTextAttr>(nRow).mnTextWidth; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 901476e70a6d..34ae049efc3e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2257,6 +2257,15 @@ void ScDocument::DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const S pTab->DeleteBroadcasters(rBlockPos, rTopPos.Col(), rTopPos.Row(), rTopPos.Row()+nLength-1); } +bool ScDocument::HasBroadcaster( SCTAB nTab, SCCOL nCol ) const +{ + const ScTable* pTab = FetchTable(nTab); + if (!pTab) + return false; + + return pTab->HasBroadcaster(nCol); +} + bool ScDocument::TableExists( SCTAB nTab ) const { return ValidTab(nTab) && static_cast<size_t>(nTab) < maTabs.size() && maTabs[nTab]; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 9c380c812754..c0e2c3f94e82 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2186,6 +2186,14 @@ void ScTable::DeleteBroadcasters( aCol[nCol].DeleteBroadcasters(rBlockPos, nRow1, nRow2); } +bool ScTable::HasBroadcaster( SCCOL nCol ) const +{ + if (!ValidCol(nCol)) + return false; + + return aCol[nCol].HasBroadcaster(); +} + const SvtBroadcaster* ScTable::GetBroadcaster( SCCOL nCol, SCROW nRow ) const { if (!ValidColRow(nCol, nRow)) |