diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-03-10 22:59:38 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-03-10 23:59:31 +0100 |
commit | ab9f13a659e73e3bb15f995f8d78fb439b73ae59 (patch) | |
tree | f0eeac6db6b7b06f60a5575677f53eb4274c76ab /sw | |
parent | a0eb29631f7c071ab3b51e7a51238ecdb1a84bd5 (diff) |
DocumentStatisticsManager: SwIterator no more ...
Change-Id: I179db8fe1762a4931a4752c9c865f8c1e1b4fc4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90309
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentStatisticsManager.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index e8bef7ca9d25..75e605a4f83d 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -134,15 +134,12 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF // #i93174#: notes contain paragraphs that are not nodes { SwFieldType * const pPostits( m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit) ); - SwIterator<SwFormatField,SwFieldType> aIter( *pPostits ); - for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) + std::vector<SwFormatField*> vFields; + pPostits->GatherFields(vFields); + for(auto pFormatField : vFields) { - if (pFormatField->IsFieldInDoc()) - { - SwPostItField const * const pField( - static_cast<SwPostItField const*>(pFormatField->GetField())); - mpDocStat->nAllPara += pField->GetNumberOfParagraphs(); - } + const auto pField = static_cast<SwPostItField const*>(pFormatField->GetField()); + mpDocStat->nAllPara += pField->GetNumberOfParagraphs(); } } |