diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-28 15:17:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-29 18:59:53 +0100 |
commit | c3d5c9a08df77f9c0d0fd2493cf299dbad1a9dff (patch) | |
tree | f448517b6031741ab182685f3cf8ee332deac2f4 /cui/source | |
parent | 58c849a94234f18eac020be66117aa2378487e2f (diff) |
used TypedWhichId in the constructor of various svx *Item classes
to act as an extra check that we have the association of Item and
TypedWhichId annotations correct.
(*) requires that I add an upcasting constructor to TypedWhichId
(*) Make the field dialog stuff in writer use a new item id
FN_FIELD_DIALOG_DOC_PROPS instead of abusing the
existing SID_DOCINFO
Change-Id: Ica4aea930c80124609a063768c9af5a189df1c27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129098
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 20 | ||||
-rw-r--r-- | cui/source/tabpages/align.cxx | 12 |
2 files changed, 16 insertions, 16 deletions
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index fb64eecdfd97..77d335f109c2 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -322,8 +322,8 @@ void SvxHyperlinkTabPageBase::DisableClose(bool _bDisable) // Click on imagebutton : Script IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, weld::Button&, void) { - SvxHyperlinkItem *pHyperlinkItem = const_cast<SvxHyperlinkItem*>(static_cast<const SvxHyperlinkItem *>( - GetItemSet().GetItem (SID_HYPERLINK_GETLINK))); + SvxHyperlinkItem *pHyperlinkItem = const_cast<SvxHyperlinkItem*>( + GetItemSet().GetItem (SID_HYPERLINK_GETLINK)); if (!pHyperlinkItem || pHyperlinkItem->GetMacroEvents() == HyperDialogEvent::NONE) return; @@ -371,16 +371,16 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, weld::Button&, voi // Get Macro-Infos HyperDialogEvent SvxHyperlinkTabPageBase::GetMacroEvents() const { - const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>( - GetItemSet().GetItem (SID_HYPERLINK_GETLINK)); + const SvxHyperlinkItem *pHyperlinkItem = + GetItemSet().GetItem (SID_HYPERLINK_GETLINK); return pHyperlinkItem ? pHyperlinkItem->GetMacroEvents() : HyperDialogEvent(); } SvxMacroTableDtor* SvxHyperlinkTabPageBase::GetMacroTable() { - const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>( - GetItemSet().GetItem (SID_HYPERLINK_GETLINK)); + const SvxHyperlinkItem *pHyperlinkItem = + GetItemSet().GetItem (SID_HYPERLINK_GETLINK); return const_cast<SvxMacroTableDtor*>(pHyperlinkItem->GetMacroTable()); } @@ -445,8 +445,8 @@ void SvxHyperlinkTabPageBase::Reset( const SfxItemSet& rItemSet) // Set dialog-fields from create-itemset maStrInitURL.clear(); - const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>( - rItemSet.GetItem (SID_HYPERLINK_GETLINK)); + const SvxHyperlinkItem *pHyperlinkItem = + rItemSet.GetItem (SID_HYPERLINK_GETLINK); if ( pHyperlinkItem ) { @@ -486,8 +486,8 @@ void SvxHyperlinkTabPageBase::ActivatePage( const SfxItemSet& rItemSet ) { // Set dialog-fields from input-itemset - const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>( - rItemSet.GetItem (SID_HYPERLINK_GETLINK)); + const SvxHyperlinkItem *pHyperlinkItem = + rItemSet.GetItem (SID_HYPERLINK_GETLINK); if ( pHyperlinkItem ) { diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 3db4e5c20ca5..837566e29d22 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -273,19 +273,19 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) rSet->InvalidateItem(nWhich); - nWhich = GetWhich(SID_ATTR_ALIGN_LOCKPOS); + TypedWhichId<SvxRotateModeItem> nWhichLockPos(GetWhich(SID_ATTR_ALIGN_LOCKPOS)); if (m_aVsRefEdge.IsValueChangedFromSaved()) { switch (m_aVsRefEdge.GetSelectedItemId()) { case IID_CELLLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_STANDARD, nWhich)); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_STANDARD, nWhichLockPos)); break; case IID_TOPLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_TOP, nWhich)); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_TOP, nWhichLockPos)); break; case IID_BOTTOMLOCK: - rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_BOTTOM, nWhich)); + rSet->Put(SvxRotateModeItem(SvxRotateMode::SVX_ROTATE_MODE_BOTTOM, nWhichLockPos)); break; default: m_aVsRefEdge.SetNoSelection(); @@ -293,8 +293,8 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) } bChanged = true; } - else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false)) - rSet->InvalidateItem(nWhich); + else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhichLockPos, false)) + rSet->InvalidateItem(nWhichLockPos); nWhich = GetWhich(SID_ATTR_ALIGN_STACKED); if (m_xCbStacked->get_state_changed_from_saved()) |