diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-11 11:06:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-25 07:19:13 +0100 |
commit | b1cfdb7bee4f7af97af54e6abbc5d04aed4ba082 (patch) | |
tree | 8211ea564e36152b9eeb7be7212342d9e82800c6 /oox | |
parent | 26b81b23f0ad061b6d44fcea3e07ae4b18a63f94 (diff) |
new loplugin:unoquery
look for places we are doing code like:
Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty()
which might result in a SIGSEGV is the query fails
Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e
Reviewed-on: https://gerrit.libreoffice.org/69044
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/vbaproject.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 856aef4b3f9e..d94183a207b2 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1954,7 +1954,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) xParent->getPropertyValue("InteropGrabBag") >>= grabBag; - entryName = uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY)->getEntryName(); + entryName = uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY_THROW)->getEntryName(); } catch (uno::Exception const& e) { diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index bba778658ae5..26b037563495 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -193,7 +193,7 @@ void VbaProject::importVbaData(const uno::Reference<io::XInputStream>& xInputStr uno::Reference<io::XOutputStream> xDocStream(xDocStorage->openStreamElement("_MS_VBA_Macros_XML", nOpenMode), uno::UNO_QUERY); comphelper::OStorageHelper::CopyInputToOutput(xInputStream, xDocStream); } - uno::Reference<embed::XTransactedObject>(xDocStorage, uno::UNO_QUERY)->commit(); + uno::Reference<embed::XTransactedObject>(xDocStorage, uno::UNO_QUERY_THROW)->commit(); } void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher ) |