sw/source/filter/ww8/docxattributeoutput.cxx | 3 +-- sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx | 10 +++++++++- 2 files changed, 10 insertions(+), 3 deletions(-)
New commits: commit 100e0a0163482645b50da21320bb67aeb2dc21fa Author: Noel Grandin <[email protected]> AuthorDate: Tue Oct 22 17:01:56 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Wed Oct 23 09:26:02 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 <[email protected]> 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 <[email protected]> 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) commit 28d7ea2509eaabf17b78ebf156833d7a967814a9 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Oct 23 01:11:28 2024 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Oct 23 09:25:58 2024 +0200 tdf#163486: PVS: Expression is always true Expression 'pChangesSet' is always true. Change-Id: Ib1f654b0b30d0e8e73121a7448a392a134be888f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175459 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 9ff7da04e015..33f20bb6cd0e 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4127,8 +4127,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) m_pSerializer->startElementNS(XML_w, XML_rPr); // Output the redline item set - if (pChangesSet) - m_rExport.OutputItemSet( *pChangesSet, false, true, i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF ); + m_rExport.OutputItemSet( *pChangesSet, false, true, i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF ); m_pSerializer->endElementNS( XML_w, XML_rPr );
