summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-04-29 19:15:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-30 07:40:28 +0200
commitdab8e9f7a8f70a72040e2df9bb69361c3e355e6b (patch)
tree931327a6620ec5d92251ddd1067148bb4be4ef8f /writerperfect
parent2c366aae9263dc4115b054fe74b90cabea61fa0b (diff)
no need to use strlen here
since librevenge's string class already has the length Change-Id: I194ae49596dacc1205bdfb10d0a6a1833914f884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/common/DocumentHandler.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx
index 869955aead67..35aa49181313 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -136,8 +136,7 @@ void DocumentHandler::startElement(const char* psName,
{
size_t keyLength = strlen(i.key());
OUString sName(i.key(), keyLength, RTL_TEXTENCODING_UTF8);
- OUString sValue(i()->getStr().cstr(), strlen(i()->getStr().cstr()),
- RTL_TEXTENCODING_UTF8);
+ OUString sValue(i()->getStr().cstr(), i()->getStr().len(), RTL_TEXTENCODING_UTF8);
// libodfgen xml-encodes some attribute's value, so check if the value is encoded or not
for (int j = 0; j < 9; ++j)
@@ -153,10 +152,9 @@ void DocumentHandler::startElement(const char* psName,
{
librevenge::RVNGString decodedValue("");
unescapeXML(i()->getStr().cstr(),
- static_cast<unsigned long>(strlen(i()->getStr().cstr())),
- decodedValue);
- sValue = OUString(decodedValue.cstr(), strlen(decodedValue.cstr()),
- RTL_TEXTENCODING_UTF8);
+ static_cast<unsigned long>(i()->getStr().len()), decodedValue);
+ sValue
+ = OUString(decodedValue.cstr(), decodedValue.len(), RTL_TEXTENCODING_UTF8);
break;
}
}