oox/source/helper/attributelist.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 05b714bd902ac061629dc1b95cd4df5c2937dd6d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Dec 17 20:23:59 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Dec 18 10:33:07 2022 +0000 crashtesting: assert on export of forum-mso-en4-212378.xlsx back to xlsx input xml contains: <cellStyle name="ck-In_xdc80_.." resulting in a bare low surrogate that asserts on export's OUString::toUtf8() Sanitize it at the original import Change-Id: Ib1259ed55090efb16e1c5b4b488bf3050e473324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144389 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit f52118159e1e958177aa8080d9b43962d31bbdfd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144373 diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index e950ee5ea490..49ff32a967f5 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -19,6 +19,7 @@ #include <oox/helper/attributelist.hxx> +#include <comphelper/string.hxx> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <sax/fastattribs.hxx> @@ -102,7 +103,7 @@ OUString AttributeConversion::decodeXString( const OUString& rValue ) const sal_Unicode* pcEnd = pcStr + rValue.getLength(); while( pcStr < pcEnd ) aBuffer.append( lclGetXChar( pcStr, pcEnd ) ); - return aBuffer.makeStringAndClear(); + return comphelper::string::sanitizeStringSurrogates(aBuffer.makeStringAndClear()); } sal_Int32 AttributeConversion::decodeInteger( std::u16string_view rValue )