[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 27 05:05:22 UTC 2021


 sw/source/core/unocore/unocrsrhelper.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit de4d1c0d68658c086fc8d42ce6794d36f9776967
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Apr 27 05:38:32 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Apr 27 07:04:49 2021 +0200

    tdf#141924: SwFormatAutoFormat::GetStyleHandle may return nullptr
    
    Change-Id: Id1b6fe687f5b328fa0743036a287bacfefe5e5fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114685
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114688
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 0186b5f9613f..8c09a63113fa 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -312,17 +312,19 @@ static uno::Any GetParaListAutoFormat(SwTextNode const& rNode)
     {
         return uno::Any();
     }
-    SfxItemSet const& rSet(*pFormat->GetStyleHandle());
+    const auto pSet(pFormat->GetStyleHandle());
+    if (!pSet)
+        return {};
     SfxItemPropertySet const& rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_AUTO_STYLE));
     SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
     std::vector<beans::NamedValue> props;
     // have to iterate the map, not the item set?
     for (auto const& rEntry : rMap.getPropertyEntries())
     {
-        if (rPropSet.getPropertyState(rEntry, rSet) == PropertyState_DIRECT_VALUE)
+        if (rPropSet.getPropertyState(rEntry, *pSet) == PropertyState_DIRECT_VALUE)
         {
             Any value;
-            rPropSet.getPropertyValue(rEntry, rSet, value);
+            rPropSet.getPropertyValue(rEntry, *pSet, value);
             props.emplace_back(rEntry.sName, value);
         }
     }


More information about the Libreoffice-commits mailing list