svl/source/items/itemprop.cxx | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
New commits: commit 4a5afc0b35ff283676805e22784646c1c9ff9730 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 28 09:32:26 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Wed Jan 28 12:17:54 2026 +0100 flatten SfxItemPropertySet::setPropertyValue a little Change-Id: I195c9c1b63d5fd780126cb9ecc3e4d77fb27119d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198275 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 01a76c637b7f..3bc8e8a01228 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -167,23 +167,18 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertyMapEntry& rEntry { // get the SfxPoolItem const SfxPoolItem* pItem = nullptr; - std::unique_ptr<SfxPoolItem> pNewItem; SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem ); if (SfxItemState::SET != eState && SfxItemPool::IsWhich(rEntry.nWID)) pItem = &rSet.GetPool()->GetUserOrPoolDefaultItem(rEntry.nWID); - if (pItem) - { - pNewItem.reset(pItem->Clone()); - } - if(pNewItem) - { - if( !pNewItem->PutValue( aVal, rEntry.nMemberId ) ) - { - throw IllegalArgumentException(); - } - // apply new item - rSet.Put( std::move(pNewItem) ); - } + if (!pItem) + return; + std::unique_ptr<SfxPoolItem> pNewItem(pItem->Clone()); + if(!pNewItem) + return; + if( !pNewItem->PutValue( aVal, rEntry.nMemberId ) ) + throw IllegalArgumentException(); + // apply new item + rSet.Put( std::move(pNewItem) ); } void SfxItemPropertySet::setPropertyValue( const OUString &rName,
