diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-01-11 17:16:24 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-01-15 16:45:45 +0100 |
commit | a951d70609fa125def231c3d7579e72c381334f5 (patch) | |
tree | 79082142658a1c6864725d0c131218c149d083b7 /oox | |
parent | cb890ae43bacd2be24bc74fad2e2e5cce8910995 (diff) |
oox: getEntryName() could throw a WrongStateException
let's guard against that.
Change-Id: I970fb801a642592d9c23390572867f0e21f03132
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 0facbf16db3f..b4e7b137b182 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1678,15 +1678,24 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) return *this; } - uno::Reference<beans::XPropertySet> const xParent( - uno::Reference<container::XChild>(xObj, uno::UNO_QUERY)->getParent(), - uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> grabBag; - xParent->getPropertyValue("InteropGrabBag") >>= grabBag; + OUString entryName; + try + { + uno::Reference<beans::XPropertySet> const xParent( + uno::Reference<container::XChild>(xObj, uno::UNO_QUERY_THROW)->getParent(), + uno::UNO_QUERY_THROW); + + xParent->getPropertyValue("InteropGrabBag") >>= grabBag; + + entryName = uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY)->getEntryName(); + } + catch (uno::Exception const& e) + { + SAL_WARN("oox", "ShapeExport::WriteOLE2Shape: exception: " << e.Message); + return *this; + } - OUString const entryName( - uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY)->getEntryName()); OUString progID; for (auto const& it : grabBag) |