summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewutil.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-07-05 00:41:08 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-07-05 00:44:41 +0200
commit4551eb2197ed39375978def0e1b881bd183342b9 (patch)
treee1fd2cb151ccbf34c4e248e2ae1b6297cbc18bc1 /sc/source/ui/view/viewutil.cxx
parent1fed62c9e3f875c077b98e0282f8cf566e5b0cc8 (diff)
change from manual loop to ScMarkData::iterator
in most situations it's much faster to use the iterator instead of the manual loop + ScMarkData::GetTableSelect
Diffstat (limited to 'sc/source/ui/view/viewutil.cxx')
-rw-r--r--sc/source/ui/view/viewutil.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index a7cd41fc4578..482b6743a675 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -259,24 +259,24 @@ void ScViewUtil::UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc )
SCROW nEndRow = aMultiArea.aEnd.Row();
bool bChanged = false;
- SCTAB nTabCount = pDoc->GetTableCount();
- for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- if ( rMark.GetTableSelect(nTab ) )
+ ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ SCTAB nTab = *itr;
+ for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
{
- for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
+ SCROW nLastRow = nRow;
+ if (pDoc->RowFiltered(nRow, nTab, NULL, &nLastRow))
{
- SCROW nLastRow = nRow;
- if (pDoc->RowFiltered(nRow, nTab, NULL, &nLastRow))
- {
- // use nStartCol/nEndCol, so the multi mark area isn't extended to all columns
- // (visible in repaint for indentation)
- rMark.SetMultiMarkArea(
- ScRange(nStartCol, nRow, nTab, nEndCol, nLastRow, nTab), false);
- bChanged = true;
- nRow = nLastRow;
- }
+ // use nStartCol/nEndCol, so the multi mark area isn't extended to all columns
+ // (visible in repaint for indentation)
+ rMark.SetMultiMarkArea(
+ ScRange(nStartCol, nRow, nTab, nEndCol, nLastRow, nTab), false);
+ bChanged = true;
+ nRow = nLastRow;
}
}
+ }
if ( bChanged && !rMark.HasAnyMultiMarks() )
rMark.ResetMark();