sw/source/writerfilter/dmapper/PropertyMap.cxx |   27 +++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 819e84398888f2841bebb7e079412f6904316b71
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Nov 18 10:01:25 2024 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Nov 18 14:00:32 2024 +0100

    crashtesting: crash on import of rtf exported from forum-en-32886.odt
    
    see: git diff -w
    Change-Id: Id50e45e53b7b433d6c468038a7de14441f4ee560
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176707
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176711
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx 
b/sw/source/writerfilter/dmapper/PropertyMap.cxx
index a9270da6617b..fba05c5e3431 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx
@@ -1209,18 +1209,25 @@ void 
SectionPropertyMap::HandleMarginsHeaderFooter(DomainMapper_Impl& rDM_Impl)
     {
         uno::Reference<beans::XPropertySet> xDefaultPageStyle(
                     rDM_Impl.GetPageStyles()->getByName(u"Standard"_ustr), 
uno::UNO_QUERY_THROW);
-        for (const beans::Property& rProp : 
m_aPageStyle->getPropertySetInfo()->getProperties())
+        if (!m_aPageStyle)
         {
-            if (!rProp.Name.startsWith("Fill")) // only copy XATTR_FILL 
properties
-                continue;
-            try
-            {
-                const uno::Any aFillValue = 
xDefaultPageStyle->getPropertyValue(rProp.Name);
-                m_aPageStyle->setPropertyValue(rProp.Name, aFillValue);
-            }
-            catch (uno::Exception&)
+            SAL_WARN( "writerfilter", "No Page Style!" );
+        }
+        else
+        {
+            for (const beans::Property& rProp : 
m_aPageStyle->getPropertySetInfo()->getProperties())
             {
-                DBG_UNHANDLED_EXCEPTION("writerfilter", "Exception setting 
page background fill");
+                if (!rProp.Name.startsWith("Fill")) // only copy XATTR_FILL 
properties
+                    continue;
+                try
+                {
+                    const uno::Any aFillValue = 
xDefaultPageStyle->getPropertyValue(rProp.Name);
+                    m_aPageStyle->setPropertyValue(rProp.Name, aFillValue);
+                }
+                catch (uno::Exception&)
+                {
+                    DBG_UNHANDLED_EXCEPTION("writerfilter", "Exception setting 
page background fill");
+                }
             }
         }
     }

Reply via email to