sw/source/core/draw/dcontact.cxx | 6 +++--- sw/source/core/fields/docufld.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit fa3e0b27385258c2fbd24e02b9319e86db00e7e2 Author: Xisco Fauli <[email protected]> AuthorDate: Sat Jan 18 10:21:29 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Sat Jan 18 12:28:11 2025 +0100 sw: Dereferencing NULL pointer 'pChangeHint' After commit c239b6cad271d20f443482bc8b6039b1734d18f2 Author: Noel Grandin <[email protected]> Date: Sat Jan 4 16:20:57 2025 +0200 convert RES_ATTRSET_CHG to SfxHint C:/cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win_analyze/sw/source/core/draw/dcontact.cxx(1670): error C2220: the following warning is treated as an error C: C: /cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win_analyze/sw/source/core/fields/docufld.cxx(2318): error C2220: the following warning is treated as an error C: Change-Id: I919d59d108a39dd77adb18967392a8ae8920275a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180431 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index cc0b3556bc1a..0f13027799ba 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1526,10 +1526,10 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) { // #i35443# auto pChangeHint = static_cast<const sw::AttrSetChangeHint*>(&rHint); - auto pChgSet = pChangeHint->m_pNew->GetChgSet(); - if(pChgSet->GetItemState(RES_SURROUND, false) == SfxItemState::SET || + auto pChgSet = pChangeHint->m_pNew ? pChangeHint->m_pNew->GetChgSet() : nullptr; + if(pChgSet && (pChgSet->GetItemState(RES_SURROUND, false) == SfxItemState::SET || pChgSet->GetItemState(RES_OPAQUE, false) == SfxItemState::SET || - pChgSet->GetItemState(RES_WRAP_INFLUENCE_ON_OBJPOS, false) == SfxItemState::SET) + pChgSet->GetItemState(RES_WRAP_INFLUENCE_ON_OBJPOS, false) == SfxItemState::SET)) bUpdateSortedObjsList = true; } lcl_NotifyBackgroundOfObj(*this, *GetMaster(), nullptr); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 0605bb34b0cc..7ea308f576cd 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2291,7 +2291,7 @@ void SwRefPageGetFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint // update all GetReference fields if( (pLegacy && !pLegacy->m_pNew && !pLegacy->m_pOld && HasWriterListeners()) - || (!pChangeHint->m_pNew && !pChangeHint->m_pOld && HasWriterListeners())) + || (pChangeHint && !pChangeHint->m_pNew && !pChangeHint->m_pOld && HasWriterListeners())) { SwRootFrame const* pLayout(nullptr); SwRootFrame const* pLayoutRLHidden(nullptr);
