writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit 0308c3a0a7fa8dcc3693434590fa9418528f8d48 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Oct 22 17:01:56 2024 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Oct 24 10:42:32 2024 +0200 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.vajng...@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.gran...@collabora.co.uk> (cherry picked from commit 100e0a0163482645b50da21320bb67aeb2dc21fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175436 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175517 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index f6165736f3d3..91775484fe57 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1031,7 +1031,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("Graphic", uno::Any(xGraphic)); + // try..catch is for tdf#161359 + try + { + xPropertySet->setPropertyValue("Graphic", 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)