[Libreoffice-commits] core.git: cui/source

Armin Le Grand (Allotropia) (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 10 09:12:10 UTC 2021


 cui/source/tabpages/paragrph.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit a292fb847dade1912d281adc44c92a9ba3e8b61d
Author:     Armin Le Grand (Allotropia) <armin.le.grand at me.com>
AuthorDate: Wed Jun 9 19:53:24 2021 +0200
Commit:     Armin Le Grand <Armin.Le.Grand at me.com>
CommitDate: Thu Jun 10 11:11:26 2021 +0200

    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 <Armin.Le.Grand at me.com>

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<SfxTabPage> 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<const SvxLineSpacingItem*>(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<sal_uInt16>(m_xBottomDist->GetCoreValue(eUnit)));
         }
         aMargin.SetContextValue(m_xContextualCB->get_active());
-        eState = GetItemSet().GetItemState( nWhich );
 
         if ( !pOld || *static_cast<const SvxULSpaceItem*>(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<const SvxLRSpaceItem*>(pOld) != aMargin ||
-             SfxItemState::DONTCARE == eState )
+             SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) )
         {
             rOutSet->Put( aMargin );
             bModified = true;


More information about the Libreoffice-commits mailing list