diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-10-11 21:56:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-12 08:17:25 +0200 |
commit | 1969094db0ebf3c6c296d5bc01184be9476c8c6c (patch) | |
tree | 7e4c5d44eaef653835bf93b618540325300f84a8 /xmloff | |
parent | 91f658c61fef351cebabbbc16faeed46719c1a09 (diff) |
Get rid of OUStringBuffer in data2string (xmloff)
Change-Id: I73d1ff799170739746e4907dae2da628bcff1749
Reviewed-on: https://gerrit.libreoffice.org/80693
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/impastpl.cxx | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 5c8e8eb8a3db..13b600c21204 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -96,67 +96,48 @@ static OUString data2string(void *data, const typelib_TypeDescriptionReference *type) { - OUStringBuffer result; - switch (type->eTypeClass) { case typelib_TypeClass_VOID: - break; + return ""; case typelib_TypeClass_BOOLEAN: - result.append(*static_cast<const sal_Bool*>(data) ? OUString("true") : OUString("false")); - break; + return *static_cast<const sal_Bool*>(data) ? OUString("true") : OUString("false"); case typelib_TypeClass_BYTE: - result.append(OUString::number((*static_cast<const sal_Int8*>(data)))); - break; + return OUString::number((*static_cast<const sal_Int8*>(data))); case typelib_TypeClass_SHORT: - result.append(OUString::number((*static_cast<const sal_Int16*>(data)))); - break; + return OUString::number((*static_cast<const sal_Int16*>(data))); case typelib_TypeClass_LONG: - result.append(OUString::number((*static_cast<const sal_Int32*>(data)))); - break; + return OUString::number((*static_cast<const sal_Int32*>(data))); case typelib_TypeClass_HYPER: - result.append(OUString::number((*static_cast<const sal_Int64*>(data)))); - break; + return OUString::number((*static_cast<const sal_Int64*>(data))); case typelib_TypeClass_UNSIGNED_SHORT: - result.append(OUString::number((*static_cast<const sal_uInt16*>(data)))); - break; + return OUString::number((*static_cast<const sal_uInt16*>(data))); case typelib_TypeClass_UNSIGNED_LONG: - result.append(OUString::number((*static_cast<const sal_uInt32*>(data)), 16)); - break; + return OUString::number((*static_cast<const sal_uInt32*>(data)), 16); case typelib_TypeClass_UNSIGNED_HYPER: - result.append(OUString::number((*static_cast<const sal_uInt64*>(data)), 16)); - break; + return OUString::number((*static_cast<const sal_uInt64*>(data)), 16); case typelib_TypeClass_FLOAT: - result.append(OUString::number(*static_cast<const float*>(data))); - break; + return OUString::number(*static_cast<const float*>(data)); case typelib_TypeClass_DOUBLE: - result.append(OUString::number(*static_cast<const double*>(data))); - break; + return OUString::number(*static_cast<const double*>(data)); case typelib_TypeClass_CHAR: - result.append("U+"); - result.append(OUString::number((*static_cast<const sal_uInt16*>(data)))); - break; + return ("U+" + OUString::number((*static_cast<const sal_uInt16*>(data)))); case typelib_TypeClass_STRING: - result.append(*static_cast<OUString*>(data)); - break; + return *static_cast<OUString*>(data); case typelib_TypeClass_TYPE: case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_INTERFACE: - result.append("wtf"); - break; + return "wtf"; case typelib_TypeClass_STRUCT: - result.append(struct2string(data, type->pType)); - break; + return struct2string(data, type->pType); case typelib_TypeClass_ENUM: - result.append(OUString::number((*static_cast<const sal_Int32*>(data)))); - break; + return OUString::number((*static_cast<const sal_Int32*>(data))); default: assert(false); // this cannot happen I hope break; } - - return result.makeStringAndClear(); + return ""; } static OUString any2string(const uno::Any& any) |