diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-07-03 21:00:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-04 09:10:32 +0200 |
commit | 965639aec1407c25bed1716a1f2c3ee19923ec1a (patch) | |
tree | f7205172826682caf7dff5910a4a4ee26a728577 /oox | |
parent | 2cc8ec691cc37b07e4f134bf379164f375b8a481 (diff) |
tdf#143175 - Join elements including a delimiter using a standard iterator
Otherwise, the document's keywords will be duplicated since the first
keyword is written twice. Regression from I19eba57bc6058c317473d0746f06699a09ba2830.
Change-Id: I4c6f840b6e095ca9eaf5ffb53af07280b901e28d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118358
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 307949ae4076..b2184e7a97d8 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/xml/dom/DocumentBuilder.hpp> #include <comphelper/processfactory.hxx> #include <oox/core/filterdetect.hxx> +#include <comphelper/stl_types.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/sequence.hxx> #include <comphelper/ofopxmlhelper.hxx> @@ -598,12 +599,9 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const Sequence< OU return; OUStringBuffer sRep; - sRep.append( aItems[ 0 ] ); - - for( const OUString& rItem : aItems ) - { - sRep.append( " " + rItem ); - } + // tdf#143175 - join elements including a delimiter using a standard iterator + ::comphelper::intersperse(aItems.begin(), aItems.end(), + ::comphelper::OUStringBufferAppender(sRep), OUString(" ")); writeElement( pDoc, nXmlElement, sRep.makeStringAndClear() ); } |