summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-04-27 05:38:32 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-04-27 05:35:43 +0200
commitd08c7fecd6b38442ea7a4ac79315603cc7084208 (patch)
treee3bafa61933035cb760135780289196b8590b7cd /sw
parent09b0ddac64a29bba9d9b09d608c24f0f57bb7f08 (diff)
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@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 7536e49cce4c..32b449b97403 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 pEntry : rMap.getPropertyEntries())
{
- if (rPropSet.getPropertyState(*pEntry, rSet) == PropertyState_DIRECT_VALUE)
+ if (rPropSet.getPropertyState(*pEntry, *pSet) == PropertyState_DIRECT_VALUE)
{
Any value;
- rPropSet.getPropertyValue(*pEntry, rSet, value);
+ rPropSet.getPropertyValue(*pEntry, *pSet, value);
props.emplace_back(pEntry->aName, value);
}
}