summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-10-22 17:01:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-23 09:26:02 +0200
commit100e0a0163482645b50da21320bb67aeb2dc21fa (patch)
tree60a1fb50fce7ba25991af33cb62d0ba6b29ba37d /sw
parent28d7ea2509eaabf17b78ebf156833d7a967814a9 (diff)
tdf#161359 fix opening RTF with broken images
The try/catch block prevents an exception that looks like com.sun.star.lang.IllegalArgumentException message: "at /Users/noelgrandin/lode/dev/core/svx/source/unodraw/unoshap2.cxx:1423" which is inside SvxGraphicObject::setPropertyValueImpl Not sure where would be a better place to handle this. regression from commit 060b0fb4b93ee09770ed9398cca46e365dda5be8 Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Date: Thu Mar 8 16:37:46 2018 +0900 change RTFDocumentImpl to use Graphic instead of GraphicURL Change-Id: Iec3df20a2192df2bf595293037c8214fea151ae3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
index a8532ac4fd6d..ce391551c719 100644
--- a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
+++ b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
@@ -1015,7 +1015,15 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
if (xPropertySet.is())
- xPropertySet->setPropertyValue(u"Graphic"_ustr, uno::Any(xGraphic));
+ // try..catch is for tdf#161359
+ try
+ {
+ xPropertySet->setPropertyValue(u"Graphic"_ustr, uno::Any(xGraphic));
+ }
+ catch (const css::uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("sw");
+ }
// check if the picture is in an OLE object and if the \objdata element is used
// (see RTFKeyword::OBJECT in RTFDocumentImpl::dispatchDestination)