diff options
author | Armin Le Grand (Allotropia) <armin.le.grand@me.com> | 2021-06-11 10:57:32 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2021-06-11 16:58:18 +0200 |
commit | 64378ded7b87fa785f13b998e006d87f44a2776d (patch) | |
tree | b0e365f2fad8f084af3517e5ddfb360a22a891d5 | |
parent | fd4bcd5f33fed46cacaa00f90a271b18b6355345 (diff) |
tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWN
Another place where SfxItemState::UNKNOWN was used as placeholder
Change-Id: Ie2757e8356bfea7010b0442d72ef7865cbb18d5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117034
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
-rw-r--r-- | sfx2/source/control/request.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 277c5745b50c..cac6ad5175a0 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -592,14 +592,17 @@ void SfxRequest::Done_Impl if ( !pImpl->pSlot->IsMode(SfxSlotMode::METHOD) ) { // get the property as SfxPoolItem - const SfxPoolItem *pItem; - sal_uInt16 nWhich = rPool.GetWhich(pImpl->pSlot->GetSlotId()); - SfxItemState eState = pSet ? pSet->GetItemState( nWhich, false, &pItem ) : SfxItemState::UNKNOWN; - SAL_WARN_IF( SfxItemState::SET != eState, "sfx", "Recording property not available: " + const SfxPoolItem *pItem(nullptr); + const sal_uInt16 nWhich(rPool.GetWhich(pImpl->pSlot->GetSlotId())); + const bool bItemStateSet(nullptr != pSet); + const SfxItemState eState(bItemStateSet ? pSet->GetItemState( nWhich, false, &pItem ) : SfxItemState::DEFAULT); + SAL_WARN_IF( !bItemStateSet || SfxItemState::SET != eState, "sfx", "Recording property not available: " << pImpl->pSlot->GetSlotId() ); uno::Sequence < beans::PropertyValue > aSeq; - if ( eState == SfxItemState::SET ) + + if ( bItemStateSet && SfxItemState::SET == eState ) TransformItems( pImpl->pSlot->GetSlotId(), *pSet, aSeq, pImpl->pSlot ); + pImpl->Record( aSeq ); } |