tdf#171046: fix update of document statistics

Document statistics should be considered as initialized only
if the call to IncrementalDocStatCalculate() came to an end.

Change-Id: I3d83e99fb8b1cfa6c63ca0ee120275fe80c00e47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202041
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Jenkins
This commit is contained in:
Oliver Specht
2026-03-20 13:39:13 +01:00
parent e9bf6ad2f5
commit 4c957e514c
@@ -103,7 +103,6 @@ void DocumentStatisticsManager::UpdateDocStat( bool bCompleteAsync, bool bFields
// returns true while there is more to do
bool DocumentStatisticsManager::IncrementalDocStatCalculate(tools::Long nChars, bool bFields)
{
mbInitialized = true;
mpDocStat->Reset();
mpDocStat->nPara = 0; // default is 1!
@@ -196,7 +195,7 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(tools::Long nChars,
SwFieldType *pType = m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocStat);
pType->UpdateFields();
}
mbInitialized = nChars > 0;
return nChars < 0;
}