diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 20:54:13 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:26 -0400 |
commit | a9a7f2501228e0f47085d937fc3727f1a452249f (patch) | |
tree | 41e05808f2e7722c376f68a9a00df5e9f9bedf5e /sc/source/core/data/documen3.cxx | |
parent | 0872a719ab85a497ea1d71920e298fd9f1d66766 (diff) |
More on ScCellIterator usage conversion... Still not done.
Change-Id: I5023a57f3a089f1af7cd7fe53f57f82c60eb2b65
Diffstat (limited to 'sc/source/core/data/documen3.cxx')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index f2fc8199d746..3196b2e446d3 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -742,13 +742,13 @@ bool ScDocument::DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam ) bool ScDocument::HasSubTotalCells( const ScRange& rRange ) { ScCellIterator aIter( this, rRange ); - ScBaseCell* pCell = aIter.GetFirst(); - while (pCell) + for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) { - if ( pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->IsSubTotal() ) - return true; + if (aIter.getType() != CELLTYPE_FORMULA) + continue; - pCell = aIter.GetNext(); + if (aIter.getFormulaCell()->IsSubTotal()) + return true; } return false; // none found } @@ -1576,19 +1576,23 @@ bool ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings ) for (sal_uInt16 nListNo=0; nListNo<2; nListNo++) { ScRangePairList* pList = pLists[ nListNo ]; - if (pList) - for ( size_t i = 0, nPairs = pList->size(); i < nPairs; ++i ) + if (!pList) + continue; + + for ( size_t i = 0, nPairs = pList->size(); i < nPairs; ++i ) + { + ScRangePair* pPair = (*pList)[i]; + ScRange aRange = pPair->GetRange(0); + ScCellIterator aIter( this, aRange ); + for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) { - ScRangePair* pPair = (*pList)[i]; - ScRange aRange = pPair->GetRange(0); - ScCellIterator aIter( this, aRange ); - for ( ScBaseCell* pCell = aIter.GetFirst(); pCell; pCell = aIter.GetNext() ) - if ( pCell->HasStringData() ) - { - OUString aStr = pCell->GetStringData(); - rStrings.insert(ScTypedStrData(aStr, 0.0, ScTypedStrData::Header)); - } + if (!aIter.hasString()) + continue; + + OUString aStr = aIter.getString(); + rStrings.insert(ScTypedStrData(aStr, 0.0, ScTypedStrData::Header)); } + } } return true; |