diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-17 16:09:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-17 16:09:42 +0200 |
commit | 6d249bec487208e56a057ea8a25c34c5d3133a23 (patch) | |
tree | e7431acec50c3921d7d86dac225981bb1606b79e | |
parent | 51d86c9e62f1b55a2ae7c2fdb2eefc7043a94226 (diff) |
UBSan: Don't force sal_Int32/float values into sal_uInt32
...overload of TagLogger::attribute. Not withstanding that function looks just
silly anyway.
Change-Id: I6cc3c5004884e564aac1397cab6eb6fae7a06f7e
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index bb50c745a5fc..9a8102e4ab1a 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -231,16 +231,22 @@ static void lcl_AnyToTag(const uno::Any & rAny) { try { sal_Int32 aInt = 0; - rAny >>= aInt; - dmapper_logger->attribute("value", aInt); + if (rAny >>= aInt) { + dmapper_logger->attribute("value", rAny); + } else { + dmapper_logger->attribute("unsignedValue", 0); + } sal_uInt32 auInt = 0; rAny >>= auInt; dmapper_logger->attribute("unsignedValue", auInt); float aFloat = 0.0f; - rAny >>= aFloat; - dmapper_logger->attribute("floatValue", aFloat); + if (rAny >>= aFloat) { + dmapper_logger->attribute("floatValue", rAny); + } else { + dmapper_logger->attribute("unsignedValue", 0); + } OUString aStr; rAny >>= aStr; |