summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbawindow.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-07-05 06:01:06 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-07-05 06:01:06 +0200
commit2b88f6d32f572792597ccbb15276b9db52db7d10 (patch)
tree5bf2c3492f5ee2e81e9ea300e3852db7725763f0 /sc/source/ui/vba/vbawindow.cxx
parent75f0c33a051cb7a0f7665010c4bb8ff015211a3b (diff)
change remaining manual loops to ScMarkData::iterator
Diffstat (limited to 'sc/source/ui/vba/vbawindow.cxx')
-rw-r--r--sc/source/ui/vba/vbawindow.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 42c21cc953ce..8bbf74ffc02b 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -126,15 +126,13 @@ public:
sheets.reserve( nTabCount );
uno::Reference <sheet::XSpreadsheetDocument> xSpreadSheet( m_xModel, uno::UNO_QUERY_THROW );
uno::Reference <container::XIndexAccess> xIndex( xSpreadSheet->getSheets(), uno::UNO_QUERY_THROW );
- for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
+ ScMarkData::iterator itr = rMarkData.begin(), itrEnd = rMarkData.end();
+ for (; itr != itrEnd && *itr < nTabCount; ++itr)
{
- if ( rMarkData.GetTableSelect(nTab) )
- {
- uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex( nTab ), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW );
- sheets.push_back( xSheet );
- namesToIndices[ xNamed->getName() ] = nIndex++;
- }
+ uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex( *itr ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW );
+ sheets.push_back( xSheet );
+ namesToIndices[ xNamed->getName() ] = nIndex++;
}
}