diff --git a/HtmlRenderer/src/HTMLRendererText.cpp b/HtmlRenderer/src/HTMLRendererText.cpp index a6d92efb24..ddc9b69af0 100644 --- a/HtmlRenderer/src/HTMLRendererText.cpp +++ b/HtmlRenderer/src/HTMLRendererText.cpp @@ -235,6 +235,8 @@ namespace NSHtmlRenderer m_pInternal->m_oPage.WriteLONG(m_pInternal->m_oSmartText.m_lCountSpaces); // seek to end m_pInternal->m_oPage.Seek(lPos); + + m_pInternal->m_oSmartText.ClearStatistics(); return m_pInternal->m_oPage.GetData(); } diff --git a/HtmlRenderer/src/Text.h b/HtmlRenderer/src/Text.h index 68d46cfda1..a6e7522b57 100644 --- a/HtmlRenderer/src/Text.h +++ b/HtmlRenderer/src/Text.h @@ -504,6 +504,14 @@ namespace NSHtmlRenderer m_oFontManager.Init(pApplicationFonts, nCacheSize); } + void ClearStatistics() + { + m_lCountParagraphs = 0; + m_lCountWords = 0; + m_lCountSymbols = 0; + m_lCountSpaces = 0; + } + template void SetParams(T writer) {