writerfilter/source/rtftok/rtfdocumentimpl.cxx | 33 ++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-)
New commits: commit 59f3227a3e980382eec1d572ac288e0cb4ad71c6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Oct 31 11:26:35 2019 +0000 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Fri Nov 1 13:30:17 2019 +0100 Resolves: rhbz#1766990 starmath might not be available Change-Id: If2e02d8da85a2af576d9563c455487ac3463c935 Reviewed-on: https://gerrit.libreoffice.org/81838 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 43463dabc152..c321d3c264b6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2855,20 +2855,25 @@ RTFError RTFDocumentImpl::popState() OUString aName; uno::Reference<embed::XEmbeddedObject> xObject = aContainer.CreateEmbeddedObject(aGlobalName.GetByteSequence(), aName); - uno::Reference<util::XCloseable> xComponent(xObject->getComponent(), - uno::UNO_SET_THROW); - // gcc4.4 (and 4.3 and possibly older) have a problem with dynamic_cast directly to the target class, - // so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated - // to RTLD_GLOBAL, so most probably a gcc bug. - auto& rImport - = dynamic_cast<oox::FormulaImportBase&>(dynamic_cast<SfxBaseModel&>(*xComponent)); - rImport.readFormulaOoxml(m_aMathBuffer); - auto pValue = new RTFValue(xObject); - RTFSprms aMathAttributes; - aMathAttributes.set(NS_ooxml::LN_starmath, pValue); - writerfilter::Reference<Properties>::Pointer_t pProperties - = new RTFReferenceProperties(aMathAttributes); - Mapper().props(pProperties); + if (xObject) // rhbz#1766990 starmath might not be available + { + uno::Reference<util::XCloseable> xComponent(xObject->getComponent(), + uno::UNO_SET_THROW); + // gcc4.4 (and 4.3 and possibly older) have a problem with dynamic_cast directly to the target class, + // so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated + // to RTLD_GLOBAL, so most probably a gcc bug. + auto& rImport = dynamic_cast<oox::FormulaImportBase&>( + dynamic_cast<SfxBaseModel&>(*xComponent)); + rImport.readFormulaOoxml(m_aMathBuffer); + + auto pValue = new RTFValue(xObject); + RTFSprms aMathAttributes; + aMathAttributes.set(NS_ooxml::LN_starmath, pValue); + writerfilter::Reference<Properties>::Pointer_t pProperties + = new RTFReferenceProperties(aMathAttributes); + Mapper().props(pProperties); + } + m_aMathBuffer = oox::formulaimport::XmlStreamBuilder(); } break; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits