diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-04-13 13:04:02 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-04-13 20:39:45 +0200 |
commit | 54054aaea74d524a05f899f8af27e2a65e17be52 (patch) | |
tree | 80c4a9c38a1aa8e03e0d8aebf2f14c6389f03c00 /xmloff | |
parent | dbe582ffa0cbbb2b4182e785fd3c37afc7863b97 (diff) |
tdf#79591: No need to use getStr here
7ea1bbe712cef48a97faffdf03b45f2812a93e62 had abused the C-style strings,
and relied on the names containing zero byte to be truncated on the byte.
However, that would only work for names with zero bytes, not with other
control characters. Additionally, that prevented the initial names from
correct round-trip.
This reverts the older fix, and makes sure to handle the attributes with
zeroes correctly (using memcpy instead of strncpy).
It also removes several similar unneeded uses of getStr.
Change-Id: I6c52874d99fe9eb9ccbe0c9a9b57e3b51c45a19f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114040
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index af6bf27a13c9..980891ffc175 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2189,7 +2189,7 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, else { sal_Int32 const nAttr = NAMESPACE_TOKEN(nDefaultNamespace) | nToken; - mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8).getStr()); + mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); } continue; } @@ -2211,7 +2211,7 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName, else { sal_Int32 const nAttr = NAMESPACE_TOKEN(nAttrPrefix) | nToken; - mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8).getStr()); + mxFastAttributes->add(nAttr, OUStringToOString(rAttrValue, RTL_TEXTENCODING_UTF8)); } } mrImport->startFastElement( mnElement, mxFastAttributes ); |