xmloff/source/text/txtparae.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit d2c02a9aba3c05e4b3072596d2b3871b7fe67864 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue May 30 13:25:24 2023 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue May 30 15:58:49 2023 +0200 Fix wrong check It was introduced in commit 286ba5b6ca60c7f67106059ea56721b86c36925b (#79947#: Improve performance, 2001-11-01), and there the size of xPropStates did not change when incrementing nIgnoreProps. But later commit 8195d7061ed52ebb98f46d35fe5929762c71e4b3 (INTEGRATION: CWS swautomatic01 (1.126.4); FILE MERGED, 2006-12-01) started to remove the ignored items from xPropStates. Change-Id: Ida864a83c32dec2884beba9ad68943e936655fc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152326 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index e5344665b5e6..2b3af03b93dd 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -691,7 +691,6 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, Reference< XPropertySetInfo > xPropSetInfo(rPropSet->getPropertySetInfo()); OUString sParent, sCondParent; - sal_uInt16 nIgnoreProps = 0; switch( nFamily ) { case XmlStyleFamily::TEXT_PARAGRAPH: @@ -744,6 +743,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, { // Get parent and remove hyperlinks (they aren't of interest) rtl::Reference< XMLPropertySetMapper > xPM(xPropMapper->getPropertySetMapper()); + sal_uInt16 nIgnoreProps = 0; for( ::std::vector< XMLPropertyState >::iterator i(aPropStates.begin()); nIgnoreProps < 2 && i != aPropStates.end(); ) { @@ -780,7 +780,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, break; default: break; } - if (aPropStates.size() - nIgnoreProps) + if (aPropStates.size()) // could change after the previous check { GetAutoStylePool().Add( nFamily, sParent, std::vector(aPropStates), bDontSeek ); if( !sCondParent.isEmpty() && sParent != sCondParent )