diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-01-27 15:04:06 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-01-27 19:02:54 +0100 |
commit | 4790ef5cb574650c418591566eeb0babc69db59e (patch) | |
tree | bdca4156b1da8bb3efc06cebcee77fa541866ca7 /cui | |
parent | d2d8f8bf82558d9aa548fb9f13bed410e0baf79b (diff) |
ITEM: Cleanup some Pool stuff with Defaults
Sorted out some methods at ItemPool which process
Defaults to make more clear what is going on and
what which method is doing.
Change-Id: I2568d3e03d0a56a14b6fe4e04521e1a8e22c000b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162643
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/TextColumnsPage.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/connect.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/measure.cxx | 12 | ||||
-rw-r--r-- | cui/source/tabpages/textanim.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/textattr.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/tpshadow.cxx | 4 |
6 files changed, 25 insertions, 25 deletions
diff --git a/cui/source/tabpages/TextColumnsPage.cxx b/cui/source/tabpages/TextColumnsPage.cxx index 5bfd3b47a69e..2e39995083f3 100644 --- a/cui/source/tabpages/TextColumnsPage.cxx +++ b/cui/source/tabpages/TextColumnsPage.cxx @@ -39,7 +39,7 @@ void SvxTextColumnsPage::Reset(const SfxItemSet* rAttrs) { auto pItem = GetItem(*rAttrs, SDRATTR_TEXTCOLUMNS_NUMBER); if (!pItem) - pItem = &pPool->GetDefaultItem(SDRATTR_TEXTCOLUMNS_NUMBER); + pItem = &pPool->GetUserOrPoolDefaultItem(SDRATTR_TEXTCOLUMNS_NUMBER); m_xColumnsNumber->set_value(pItem->GetValue()); m_xColumnsNumber->save_value(); } @@ -48,7 +48,7 @@ void SvxTextColumnsPage::Reset(const SfxItemSet* rAttrs) MapUnit eUnit = pPool->GetMetric(SDRATTR_TEXTCOLUMNS_SPACING); auto pItem = GetItem(*rAttrs, SDRATTR_TEXTCOLUMNS_SPACING); if (!pItem) - pItem = &pPool->GetDefaultItem(SDRATTR_TEXTCOLUMNS_SPACING); + pItem = &pPool->GetUserOrPoolDefaultItem(SDRATTR_TEXTCOLUMNS_SPACING); SetMetricValue(*m_xColumnsSpacing, pItem->GetValue(), eUnit); m_xColumnsSpacing->save_value(); } diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index b69f17b55113..b3d036d991f9 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -124,7 +124,7 @@ void SvxConnectionPage::SetMetricValueAndSave(const SfxItemSet* rAttrs, weld::Me const SfxPoolItem* pItem = GetItem( *rAttrs, nWhich); const SfxItemPool* pPool = rAttrs->GetPool(); if( !pItem ) - pItem = &pPool->GetDefaultItem( nWhich ); + pItem = &pPool->GetUserOrPoolDefaultItem( nWhich ); SetMetricValue(rField, pItem->StaticWhichCast(nWhich).GetValue(), eUnit); rField.save_value(); } @@ -164,7 +164,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs ) // SdrEdgeLineDeltaAnzItem pItem = GetItem( *rAttrs, SDRATTR_EDGELINEDELTACOUNT ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTACOUNT ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_EDGELINEDELTACOUNT ); switch (pItem->StaticWhichCast(SDRATTR_EDGELINEDELTACOUNT).GetValue()) { case 0: @@ -187,7 +187,7 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs ) // SdrEdgeKindItem pItem = GetItem( *rAttrs, SDRATTR_EDGEKIND ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_EDGEKIND ); m_xLbType->set_active( sal::static_int_cast<sal_uInt16>(pItem->StaticWhichCast(SDRATTR_EDGEKIND).GetValue())); m_xLbType->save_value(); @@ -374,7 +374,7 @@ void SvxConnectionPage::FillTypeLB() const SfxItemPool* pPool = rOutAttrs.GetPool(); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_EDGEKIND ); const SdrEdgeKindItem* pEdgeKindItem = &pItem->StaticWhichCast(SDRATTR_EDGEKIND); const sal_uInt16 nCount = pEdgeKindItem->GetValueCount(); for (sal_uInt16 i = 0; i < nCount; i++) diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index fe61ed53abff..3e53891e21e2 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -149,14 +149,14 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureLineDistItem if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASURELINEDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASURELINEDIST ); SetMetricValue(*m_xMtrFldLineDist, static_cast<const SdrMetricItem*>(pItem)->GetValue(), eUnit); m_xMtrFldLineDist->save_value(); // SdrMeasureHelplineOverhangItem pItem = GetItem( *rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG ); if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG ); SetMetricValue(*m_xMtrFldHelplineOverhang, static_cast<const SdrMetricItem*>(pItem)->GetValue(), eUnit); m_xMtrFldHelplineOverhang->save_value(); @@ -164,7 +164,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureHelplineDistItem pItem = GetItem( *rAttrs, SDRATTR_MEASUREHELPLINEDIST ); if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASUREHELPLINEDIST ); SetMetricValue(*m_xMtrFldHelplineDist, static_cast<const SdrMetricItem*>(pItem)->GetValue(), eUnit); m_xMtrFldHelplineDist->save_value(); @@ -172,7 +172,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureHelpline1LenItem pItem = GetItem( *rAttrs, SDRATTR_MEASUREHELPLINE1LEN ); if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE1LEN ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASUREHELPLINE1LEN ); SetMetricValue(*m_xMtrFldHelpline1Len, static_cast<const SdrMetricItem*>(pItem)->GetValue(), eUnit); m_xMtrFldHelpline1Len->save_value(); @@ -180,7 +180,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureHelpline2LenItem pItem = GetItem( *rAttrs, SDRATTR_MEASUREHELPLINE2LEN ); if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE2LEN ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASUREHELPLINE2LEN ); SetMetricValue(*m_xMtrFldHelpline2Len, static_cast<const SdrMetricItem*>(pItem)->GetValue(), eUnit); m_xMtrFldHelpline2Len->save_value(); @@ -200,7 +200,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureDecimalPlacesItem pItem = GetItem( *rAttrs, SDRATTR_MEASUREDECIMALPLACES ); if( pItem == nullptr ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREDECIMALPLACES ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_MEASUREDECIMALPLACES ); m_xMtrFldDecimalPlaces->set_value( static_cast<const SdrMeasureDecimalPlacesItem*>(pItem)->GetValue()); m_xMtrFldDecimalPlaces->save_value(); diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index b5ba3d90ce62..f0964e4957d6 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -140,7 +140,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) const SfxPoolItem* pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANIKIND ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANIKIND ); eAniKind = static_cast<const SdrTextAniKindItem*>(pItem)->GetValue(); m_xLbEffect->set_active(sal::static_int_cast<sal_Int32>(eAniKind)); @@ -149,7 +149,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // animation direction pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANIDIRECTION ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANIDIRECTION ); SelectDirection(static_cast<const SdrTextAniDirectionItem*>(pItem)->GetValue()); m_aUpState = m_xBtnUp->get_state(); @@ -160,7 +160,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // Start inside pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANISTARTINSIDE ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE ); if (static_cast<const SdrTextAniStartInsideItem*>(pItem)->GetValue()) m_xTsbStartInside->set_state(TRISTATE_TRUE); @@ -171,7 +171,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // Stop inside pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANISTOPINSIDE ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE ); if (static_cast<const SdrTextAniStopInsideItem*>(pItem)->GetValue()) m_xTsbStopInside->set_state(TRISTATE_TRUE); @@ -182,7 +182,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // quantity pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANICOUNT ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANICOUNT ); tools::Long nValue = static_cast<tools::Long>(static_cast<const SdrTextAniCountItem*>(pItem)->GetValue()); m_xNumFldCount->set_value(nValue); @@ -207,7 +207,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // delay pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANIDELAY ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANIDELAY ); nValue = static_cast<tools::Long>(static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue()); m_xMtrFldDelay->set_value(nValue, FieldUnit::NONE); @@ -224,7 +224,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) // step size pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANIAMOUNT ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_ANIAMOUNT ); nValue = static_cast<tools::Long>(static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue()); if (nValue <= 0) diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index f773be6b8cb1..d97937f53542 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -109,28 +109,28 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs ) const SdrMetricItem* pItem = GetItem(*rAttrs, SDRATTR_TEXT_LEFTDIST); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LEFTDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_LEFTDIST ); SetMetricValue(*m_xMtrFldLeft, pItem->GetValue(), eUnit); m_xMtrFldLeft->save_value(); pItem = GetItem( *rAttrs, SDRATTR_TEXT_RIGHTDIST ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_RIGHTDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_RIGHTDIST ); SetMetricValue(*m_xMtrFldRight, pItem->GetValue(), eUnit); m_xMtrFldRight->save_value(); pItem = GetItem( *rAttrs, SDRATTR_TEXT_UPPERDIST ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_UPPERDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_UPPERDIST ); SetMetricValue(*m_xMtrFldTop, pItem->GetValue(), eUnit); m_xMtrFldTop->save_value(); pItem = GetItem( *rAttrs, SDRATTR_TEXT_LOWERDIST ); if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LOWERDIST ); + pItem = &pPool->GetUserOrPoolDefaultItem( SDRATTR_TEXT_LOWERDIST ); SetMetricValue(*m_xMtrFldBottom, pItem->GetValue(), eUnit); m_xMtrFldBottom->save_value(); diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 795a57f13dde..0f2df7b821ec 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -381,9 +381,9 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs ) // determine default-distance SfxItemPool* pPool = m_rOutAttrs.GetPool(); { - sal_Int32 n = pPool->GetDefaultItem(SDRATTR_SHADOWXDIST).GetValue(); + sal_Int32 n = pPool->GetUserOrPoolDefaultItem(SDRATTR_SHADOWXDIST).GetValue(); if (n == 0) - n = pPool->GetDefaultItem(SDRATTR_SHADOWYDIST).GetValue(); + n = pPool->GetUserOrPoolDefaultItem(SDRATTR_SHADOWYDIST).GetValue(); SetMetricValue(*m_xMtrDistance, std::abs(n), m_ePoolUnit); } |