xmloff/source/style/XMLThemeContext.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit e4ed2f1b835f23d4691c693e1deaae49426adab5 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Jun 15 02:55:48 2025 +0500 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jun 16 14:46:06 2025 +0200 tdf#167018: throwing out of a dtor is fatal The exception was thrown with this stack: comphelper.dll!com::sun::star::lang::IllegalArgumentException::IllegalArgumentException(const rtl::OUString & Message_, const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> & Context_, const short & ArgumentPosition_, std::source_location location) Line 39 comphelper.dll!comphelper::SequenceAsHashMap::operator<<(const com::sun::star::uno::Any & aSource) Line 151 comphelper.dll!comphelper::SequenceAsHashMap::SequenceAsHashMap(const com::sun::star::uno::Any & aSource) Line 109 docmodello.dll!model::Theme::FromAny(const com::sun::star::uno::Any & rVal) Line 86 sdlo.dll!SdXImpressDocument::setPropertyValue(const rtl::OUString & aPropertyName, const com::sun::star::uno::Any & aValue) Line 2879 xolo.dll!XMLThemeContext::~XMLThemeContext() Line 57 xolo.dll!XMLThemeContext::`scalar deleting destructor'(unsigned int) xolo.dll!SvXMLImportContext::release() Line 106 xolo.dll!rtl::Reference<SvXMLImportContext>::~Reference<SvXMLImportContext>() Line 126 xolo.dll!SvXMLImport::endFastElement(long Element) Line 889 saxlo.dll!`anonymous namespace'::Entity::endElement() Line 515 saxlo.dll!sax_fastparser::FastSaxParserImpl::consume(`anonymous-namespace'::EventList & rEventList) Line 1021 saxlo.dll!sax_fastparser::FastSaxParserImpl::parseStream(const com::sun::star::xml::sax::InputSource & rStructSource) Line 860 saxlo.dll!sax_fastparser::FastSaxParser::parseStream(const com::sun::star::xml::sax::InputSource & aInputSource) Line 1479 xolo.dll!SvXMLImport::parseStream(const com::sun::star::xml::sax::InputSource & aInputSource) Line 528 sdlo.dll!`anonymous namespace'::ReadThroughComponent(const com::sun::star::uno::Reference<com::sun::star::io::XInputStream> & xInputStream, const com::sun::star::uno::Reference<com::sun::star::lang::XComponent> & xModelComponent, const rtl::OUString & rStreamName, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & rxContext, const char * pFilterName, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rFilterArguments, const rtl::OUString & rName, bool bMustBeSuccessful, bool bEncrypted) Line 226 sdlo.dll!`anonymous namespace'::ReadThroughComponent(const com::sun::star::uno::Reference<com::sun::star::embed::XStorage> & xStorage, const com::sun::star::uno::Reference<com::sun::star::lang::XComponent> & xModelComponent, const char * pStreamName, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & rxContext, const char * pFilterName, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rFilterArguments, const rtl::OUString & rName, bool bMustBeSuccessful) Line 369 sdlo.dll!SdXMLFilter::Import(ErrCode & nError) Line 615 sdlo.dll!sd::DrawDocShell::Load(SfxMedium & rMedium) Line 295 sfxlo.dll!SfxObjectShell::LoadOwnFormat(SfxMedium & rMedium) Line 3611 sfxlo.dll!SfxObjectShell::DoLoad(SfxMedium * pMed) Line 712 sdlo.dll!sd::slidesorter::controller::Clipboard::PasteSlidesFromSystemClipboard() Line 965 sdlo.dll!sd::View::InsertData(const TransferableDataHelper & rDataHelper, const Point & rPos, char & rDnDAction, bool bDrag, SotClipboardFormatId nFormat, unsigned short nPage, o3tl::strong_int<short,SdrLayerIDTag> nLayer) Line 711 sdlo.dll!sd::View::DoPaste(sd::Window * pWindow, bool __formal) Line 329 Change-Id: I5eca1088c75aafd0151d778c4fc16becb1e579dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186507 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186547 diff --git a/xmloff/source/style/XMLThemeContext.cxx b/xmloff/source/style/XMLThemeContext.cxx index 5d0f516faafb..36d5e9a2ccfb 100644 --- a/xmloff/source/style/XMLThemeContext.cxx +++ b/xmloff/source/style/XMLThemeContext.cxx @@ -17,6 +17,7 @@ #include <sax/tools/converter.hxx> +#include <comphelper/diagnose_ex.hxx> #include <docmodel/uno/UnoTheme.hxx> #include <docmodel/theme/Theme.hxx> @@ -51,7 +52,14 @@ XMLThemeContext::~XMLThemeContext() uno::Reference<beans::XPropertySet> xPropertySet(m_xObjectWithThemeProperty, uno::UNO_QUERY); auto xTheme = model::theme::createXTheme(mpTheme); - xPropertySet->setPropertyValue(u"Theme"_ustr, uno::Any(xTheme)); + try + { + xPropertySet->setPropertyValue(u"Theme"_ustr, uno::Any(xTheme)); + } + catch (uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("xmloff"); + } } }