diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-03 09:56:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-03 19:19:39 +0100 |
commit | 0a1031a9ecd1502b1841bde26dde7ad51358c638 (patch) | |
tree | 564e854741e6307d5be08afcad395bca5ce30c16 /sw/source/uibase/frmdlg/frmmgr.cxx | |
parent | c1ac79906bde5c902be5cb0ae6b530da96e52169 (diff) |
use SfxItemSet::GetItemIfSet in sw/source/uibase
Change-Id: Ic82df8d321ba2eb94957236264c71c5eb9a940a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130905
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/frmdlg/frmmgr.cxx')
-rw-r--r-- | sw/source/uibase/frmdlg/frmmgr.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 69065a7fb457..50ce75e7b7e0 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -142,10 +142,8 @@ void SwFlyFrameAttrMgr::UpdateAttrMgr() void SwFlyFrameAttrMgr::UpdateFlyFrame_() { - const SfxPoolItem* pItem = nullptr; - - if (m_aSet.GetItemState(FN_SET_FRM_NAME, false, &pItem) == SfxItemState::SET) - m_pOwnSh->SetFlyName(static_cast<const SfxStringItem *>(pItem)->GetValue()); + if (const SfxStringItem* pItem = m_aSet.GetItemIfSet(FN_SET_FRM_NAME, false)) + m_pOwnSh->SetFlyName(pItem->GetValue()); m_pOwnSh->SetModified(); @@ -166,14 +164,13 @@ void SwFlyFrameAttrMgr::UpdateFlyFrame() return; //JP 6.8.2001: set never an invalid anchor into the core. - const SfxPoolItem *pGItem, *pItem; - if( SfxItemState::SET == m_aSet.GetItemState( RES_ANCHOR, false, &pItem )) + const SwFormatAnchor *pGItem, *pItem; + if( (pItem = m_aSet.GetItemIfSet( RES_ANCHOR, false )) ) { SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aGetSet( *m_aSet.GetPool() ); if( m_pOwnSh->GetFlyFrameAttr( aGetSet ) && 1 == aGetSet.Count() && - SfxItemState::SET == aGetSet.GetItemState( RES_ANCHOR, false, &pGItem ) - && static_cast<const SwFormatAnchor*>(pGItem)->GetAnchorId() == - static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId() ) + (pGItem = aGetSet.GetItemIfSet( RES_ANCHOR, false )) + && pGItem->GetAnchorId() == pItem->GetAnchorId() ) m_aSet.ClearItem( RES_ANCHOR ); } |