From a292fb847dade1912d281adc44c92a9ba3e8b61d Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Allotropia)" Date: Wed, 9 Jun 2021 19:53:24 +0200 Subject: tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWN In this case, avoid single, re-used local variable. It gets newly processed at locations used anyways. Change-Id: I89463736cbc28925adc304adb4624ab2740bdfbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116936 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- cui/source/tabpages/paragrph.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cui') diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index cb59cc8c8010..83613a78938a 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -214,7 +214,6 @@ std::unique_ptr SvxStdParagraphTabPage::Create( weld::Container* pPa bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) { - SfxItemState eState = SfxItemState::UNKNOWN; const SfxPoolItem* pOld = nullptr; SfxItemPool* pPool = rOutSet->GetPool(); DBG_ASSERT( pPool, "Where is the pool?" ); @@ -260,12 +259,11 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) OSL_FAIL( "unknown LineDist entry" ); break; } - eState = GetItemSet().GetItemState( nWhich ); pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_LINESPACE ); if ( m_bLineDistToggled || !pOld || !( *static_cast(pOld) == aSpacing ) || - SfxItemState::DONTCARE == eState ) + SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) ) { rOutSet->Put( aSpacing ); bModified = true; @@ -306,10 +304,9 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) aMargin.SetLower(static_cast(m_xBottomDist->GetCoreValue(eUnit))); } aMargin.SetContextValue(m_xContextualCB->get_active()); - eState = GetItemSet().GetItemState( nWhich ); if ( !pOld || *static_cast(pOld) != aMargin || - SfxItemState::DONTCARE == eState ) + SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) ) { rOutSet->Put( aMargin ); bModified = true; @@ -361,10 +358,9 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) aMargin.SetAutoFirst(m_xAutoCB->get_active()); if ( aMargin.GetTextFirstLineOffset() < 0 ) bNullTab = true; - eState = GetItemSet().GetItemState( nWhich ); if ( !pOld || *static_cast(pOld) != aMargin || - SfxItemState::DONTCARE == eState ) + SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) ) { rOutSet->Put( aMargin ); bModified = true; -- cgit