[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - writerfilter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 1 12:30:54 UTC 2019


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   33 ++++++++++++++-----------
 1 file changed, 19 insertions(+), 14 deletions(-)

New commits:
commit 59f3227a3e980382eec1d572ac288e0cb4ad71c6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 31 11:26:35 2019 +0000
Commit:     Michael Stahl <michael.stahl at 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.stahl at 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;


More information about the Libreoffice-commits mailing list