diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-04 18:34:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-05 13:16:19 +0200 |
commit | 96ccf745fb212f85a81afb4b9d17fa0f7667b935 (patch) | |
tree | a58e13f979eeb9c07629d7c4813b529a3710e29a /sd | |
parent | b0b8851021cee26412182b51ed28fe574632a4d6 (diff) |
Convert some SID in sd to SfxUInt16Item
Some, like SID_NAVIGATOR_PAGE were incorrectly using
SfxAllEnumItem, and others did not need to use SfxAllEnumItem.
Change-Id: I0f61dcdda8bbc021667db3cf78141778f7b85087
Reviewed-on: https://gerrit.libreoffice.org/80252
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/dialogs-test.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgsnap.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/func/fuoaprms.cxx | 33 | ||||
-rw-r--r-- | sd/source/ui/func/fusnapln.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsd.cxx | 2 |
6 files changed, 27 insertions, 25 deletions
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index 102d6f8af58e..231870815657 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -501,8 +501,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) CPPUNIT_ASSERT(pDrawDoc); SfxItemSet aSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>{}); aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false)); - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); aSet.InvalidateItem(ATTR_ANIMATION_SPEED); aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, false)); aSet.Put(SvxColorItem(COL_LIGHTGRAY, ATTR_ANIMATION_COLOR)); @@ -510,9 +510,9 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, false)); aSet.InvalidateItem(ATTR_ANIMATION_SOUNDFILE); aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, false)); - aSet.Put(SfxAllEnumItem(ATTR_ACTION, sal_uInt16(presentation::ClickAction_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ACTION, sal_uInt16(presentation::ClickAction_NONE))); aSet.InvalidateItem(ATTR_ACTION_FILENAME); - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ACTION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); aSet.InvalidateItem(ATTR_ACTION_EFFECTSPEED); aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, false)); aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false)); diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index db5328edb471..c07fa83552e4 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -126,7 +126,7 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs) nXValue = sal_Int32(GetCoreValue(*m_xMtrFldX, MapUnit::Map100thMM) * aUIScale); nYValue = sal_Int32(GetCoreValue(*m_xMtrFldY, MapUnit::Map100thMM) * aUIScale); - rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, static_cast<sal_uInt16>(eKind))); + rOutAttrs.Put(SfxUInt16Item(ATTR_SNAPLINE_KIND, static_cast<sal_uInt16>(eKind))); rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_X, nXValue)); rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_Y, nYValue)); } diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 6fc4c2b8e998..a908348123b8 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -42,6 +42,7 @@ #include <sfx2/docfile.hxx> #include <svx/xtable.hxx> #include <vcl/mnemonic.hxx> +#include <svl/intitem.hxx> #include <svl/urihelper.hxx> #include <sfx2/filedlghelper.hxx> #include <svx/drawitem.hxx> @@ -249,7 +250,7 @@ bool SdTPAction::FillItemSet( SfxItemSet* rAttrs ) if( m_xLbAction->get_value_changed_from_saved() ) { - rAttrs->Put( SfxAllEnumItem( ATTR_ACTION, static_cast<sal_uInt16>(eCA) ) ); + rAttrs->Put( SfxUInt16Item( ATTR_ACTION, static_cast<sal_uInt16>(eCA) ) ); bModified = true; } else @@ -290,7 +291,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) // m_xLbAction if( rAttrs->GetItemState( ATTR_ACTION ) != SfxItemState::DONTCARE ) { - eCA = static_cast<presentation::ClickAction>(static_cast<const SfxAllEnumItem&>( rAttrs-> + eCA = static_cast<presentation::ClickAction>(static_cast<const SfxUInt16Item&>( rAttrs-> Get( ATTR_ACTION ) ).GetValue()); SetActualClickAction( eCA ); } diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 7f8b9302f23e..38bb2b032d82 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -27,6 +27,7 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/sfxdlg.hxx> #include <svl/aeitem.hxx> +#include <svl/intitem.hxx> #include <svl/stritem.hxx> #include <svx/svdopath.hxx> #include <tools/debug.hxx> @@ -347,21 +348,21 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false)); if (nEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, static_cast<sal_uInt16>(eEffect))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_EFFECT, static_cast<sal_uInt16>(eEffect))); else if (nEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ANIMATION_EFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nTextEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, static_cast<sal_uInt16>(eTextEffect))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_TEXTEFFECT, static_cast<sal_uInt16>(eTextEffect))); else if (nTextEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ANIMATION_TEXTEFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nSpeedSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_SPEED, static_cast<sal_uInt16>(eSpeed))); + aSet.Put(SfxUInt16Item(ATTR_ANIMATION_SPEED, static_cast<sal_uInt16>(eSpeed))); else aSet.InvalidateItem(ATTR_ANIMATION_SPEED); @@ -406,11 +407,11 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, false)); if (nClickActionSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION, static_cast<sal_uInt16>(eClickAction))); + aSet.Put(SfxUInt16Item(ATTR_ACTION, static_cast<sal_uInt16>(eClickAction))); else if (nClickActionSet == ATTR_MIXED) aSet.InvalidateItem(ATTR_ACTION); else - aSet.Put(SfxAllEnumItem(ATTR_ACTION, sal_uInt16(presentation::ClickAction_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ACTION, sal_uInt16(presentation::ClickAction_NONE))); if (nBookmarkSet == ATTR_SET) aSet.Put(SfxStringItem(ATTR_ACTION_FILENAME, aBookmark)); @@ -418,14 +419,14 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) aSet.InvalidateItem(ATTR_ACTION_FILENAME); if (nSecondEffectSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, static_cast<sal_uInt16>(eSecondEffect))); + aSet.Put(SfxUInt16Item(ATTR_ACTION_EFFECT, static_cast<sal_uInt16>(eSecondEffect))); else if (nSecondEffectSet == ATTR_MIXED) aSet.InvalidateItem( ATTR_ACTION_EFFECT ); else - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); + aSet.Put(SfxUInt16Item(ATTR_ACTION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE))); if (nSecondSpeedSet == ATTR_SET) - aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECTSPEED, static_cast<sal_uInt16>(eSecondSpeed))); + aSet.Put(SfxUInt16Item(ATTR_ACTION_EFFECTSPEED, static_cast<sal_uInt16>(eSecondSpeed))); else aSet.InvalidateItem(ATTR_ACTION_EFFECTSPEED); @@ -466,7 +467,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_EFFECT) == SfxItemState::SET) { - eEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + eEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxUInt16Item&>( pArgs-> Get(ATTR_ANIMATION_EFFECT)).GetValue()); nEffectSet = ATTR_SET; } @@ -475,7 +476,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_TEXTEFFECT) == SfxItemState::SET) { - eTextEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + eTextEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxUInt16Item&>( pArgs-> Get(ATTR_ANIMATION_TEXTEFFECT)).GetValue()); nTextEffectSet = ATTR_SET; } @@ -484,7 +485,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_SPEED) == SfxItemState::SET) { - eSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxAllEnumItem&>( pArgs-> + eSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxUInt16Item&>( pArgs-> Get(ATTR_ANIMATION_SPEED)).GetValue()); nSpeedSet = ATTR_SET; } @@ -541,7 +542,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION) == SfxItemState::SET) { - eClickAction = static_cast<presentation::ClickAction>(static_cast<const SfxAllEnumItem&>(pArgs-> + eClickAction = static_cast<presentation::ClickAction>(static_cast<const SfxUInt16Item&>(pArgs-> Get(ATTR_ACTION)).GetValue()); nClickActionSet = ATTR_SET; } @@ -559,7 +560,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECT) == SfxItemState::SET) { - eSecondEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxAllEnumItem&>( pArgs-> + eSecondEffect = static_cast<presentation::AnimationEffect>(static_cast<const SfxUInt16Item&>( pArgs-> Get(ATTR_ACTION_EFFECT)).GetValue()); nSecondEffectSet = ATTR_SET; } @@ -568,7 +569,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECTSPEED) == SfxItemState::SET) { - eSecondSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxAllEnumItem&>( pArgs-> + eSecondSpeed = static_cast<presentation::AnimationSpeed>(static_cast<const SfxUInt16Item&>( pArgs-> Get(ATTR_ACTION_EFFECTSPEED)).GetValue()); nSecondSpeedSet = ATTR_SET; } diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index 5e11089d84ff..bbad6ce82ef7 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -169,7 +169,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) pPV = mpView->GetSdrPageView(); - switch ( static_cast<SnapKind>(static_cast<const SfxAllEnumItem&>( + switch ( static_cast<SnapKind>(static_cast<const SfxUInt16Item&>( pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue()) ) { case SK_HORIZONTAL : eKind = SdrHelpLineKind::Horizontal; break; diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index 0858e554ad64..2fe6691d64ee 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -74,7 +74,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) mpDrawView->SdrEndTextEdit(); const SfxItemSet* pArgs = rReq.GetArgs(); - PageJump eJump = static_cast<PageJump>(static_cast<const SfxAllEnumItem&>( pArgs-> + PageJump eJump = static_cast<PageJump>(static_cast<const SfxUInt16Item&>( pArgs-> Get(SID_NAVIGATOR_PAGE)).GetValue()); switch (eJump) |