include/sfx2/request.hxx | 13 +++++++++---- include/sfx2/sfxsids.hrc | 3 ++- sc/source/ui/drawfunc/drtxtob.cxx | 4 ++-- sc/source/ui/view/editsh.cxx | 4 ++-- sc/source/ui/view/tabvwshb.cxx | 2 +- sd/source/ui/view/drtxtob.cxx | 2 +- sd/source/ui/view/drtxtob1.cxx | 2 +- sd/source/ui/view/drviews2.cxx | 5 +++-- sd/source/ui/view/drviewse.cxx | 1 + sd/source/ui/view/outlnvs2.cxx | 3 ++- sfx2/sdi/sfx.sdi | 4 ++-- sfx2/source/appl/appuno.cxx | 2 +- sw/source/uibase/shells/annotsh.cxx | 4 ++-- sw/source/uibase/shells/drwtxtex.cxx | 4 ++-- sw/source/uibase/shells/textsh1.cxx | 4 ++-- sw/source/uibase/uiview/viewdlg2.cxx | 2 +- 16 files changed, 34 insertions(+), 25 deletions(-)
New commits: commit a6eddceda5d376cd73922123a3bb3a5683307c41 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Feb 9 16:20:19 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Feb 10 11:48:22 2022 +0100 rename some SID to FN_PARAM because they are not slots, they are only being used as parameters Change-Id: I539f4832b884d1ea7dc14ce4ef6c79feec6681cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx index e6411d2d3ec1..5a97cb9e61b8 100644 --- a/include/sfx2/request.hxx +++ b/include/sfx2/request.hxx @@ -83,10 +83,15 @@ public: */ template<class T> const T* GetArg(sal_uInt16 nSlotId) const { - if (pArgs) - return pArgs->GetItem<T>(nSlotId, false); - - return nullptr; + if (!pArgs) + return nullptr; + return pArgs->GetItem<T>(nSlotId, false); + } + template<class T> const T* GetArg(TypedWhichId<T> nSlotId) const + { + if (!pArgs) + return nullptr; + return pArgs->GetItem(nSlotId, false); } void ReleaseArgs(); diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index 9b36e9c47e4b..a89fbee4c51b 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -287,7 +287,7 @@ class SvxZoomItem; #define SID_LOCK_EDITDOC TypedWhichId<SfxBoolItem>(SID_SFX_START + 1738) #define SID_REPLACEABLE TypedWhichId<SfxBoolItem>(SID_SFX_START + 1739) #define SID_ADDITIONS_DIALOG (SID_SFX_START + 1740) -#define SID_ADDITIONS_TAG (SID_SFX_START + 1741) +#define FN_PARAM_ADDITIONS_TAG TypedWhichId<SfxStringItem>(SID_SFX_START + 1741) #define SID_TOOLBAR_MODE_UI (SID_SFX_START + 1742) #define SID_TOOLBAR_LOCK (SID_SFX_START + 1743) @@ -416,6 +416,7 @@ class SvxZoomItem; // id for thesaurus entry in context menu #define SID_THES (SID_SFX_START + 698) +#define FN_PARAM_THES_WORD_REPLACE TypedWhichId<SfxStringItem>(SID_SFX_START + 699) // default-ids for editing, cursor travelling and selection #define SID_REDO (SID_SFX_START + 700) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index e3ec1fabd97b..065f08bdcdbd 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -342,7 +342,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) case SID_THES: { OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -454,7 +454,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) EditView& rEditView = pOutView->GetEditView(); bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView ); } - rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + rSet.Put( SfxStringItem( FN_PARAM_THES_WORD_REPLACE, aStatusVal ) ); // disable thesaurus main menu and context menu entry if there is nothing to look up bool bCanDoThesaurus = ScModule::HasThesaurusLanguage( nLang ); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 30df7ebea5c0..14f21eb2190a 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -197,7 +197,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_THES: { OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -819,7 +819,7 @@ void ScEditShell::GetState( SfxItemSet& rSet ) LanguageType nLang = LANGUAGE_NONE; bool bIsLookUpWord = pActiveView && GetStatusValueForThesaurusFromContext(aStatusVal, nLang, *pActiveView); - rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + rSet.Put( SfxStringItem( FN_PARAM_THES_WORD_REPLACE, aStatusVal ) ); // disable thesaurus context menu entry if there is nothing to look up bool bCanDoThesaurus = ScModule::HasThesaurusLanguage( nLang ); diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index f2ae3b56a55e..c7265cab1e3b 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -433,7 +433,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) { OUString sAdditionsTag = ""; - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(SID_ADDITIONS_TAG); + const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); if (pStringArg) sAdditionsTag = pStringArg->GetValue(); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index b10af08289fa..b3f53c7a6860 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -415,7 +415,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) OUString aStatusVal; LanguageType nLang = LANGUAGE_NONE; bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView ); - rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + rSet.Put( SfxStringItem( FN_PARAM_THES_WORD_REPLACE, aStatusVal ) ); // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 2f5a67864912..fa1f160df964 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -516,7 +516,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_THES: { OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 449321eabf63..bef73c1726d3 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -81,6 +81,7 @@ #include <svx/svxids.hrc> #include <svx/sdtfsitm.hxx> #include <svx/sdmetitm.hxx> +#include <svx/zoomslideritem.hxx> #include <svx/xflclit.hxx> #include <svx/xlnwtit.hxx> #include <svx/chrtitem.hxx> @@ -965,7 +966,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) const SfxItemSet* pArgs = rReq.GetArgs(); const SfxUInt16Item* pScale = (pArgs && pArgs->Count () == 1) ? - rReq.GetArg<SfxUInt16Item>(SID_ATTR_ZOOMSLIDER) : nullptr; + rReq.GetArg(SID_ATTR_ZOOMSLIDER) : nullptr; if (pScale && CHECK_RANGE (5, pScale->GetValue (), 3000)) { SetZoom (pScale->GetValue ()); @@ -3533,7 +3534,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { OUString sAdditionsTag = ""; - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(SID_ADDITIONS_TAG); + const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); if (pStringArg) sAdditionsTag = pStringArg->GetValue(); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index e35a042cdf61..0b7be81d1845 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -35,6 +35,7 @@ #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <svl/urlbmk.hxx> +#include <svx/clipfmtitem.hxx> #include <svx/svdpagv.hxx> #include <svx/svdopath.hxx> #include <svx/svdundo.hxx> diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index a1b2c9382663..2a890cec1b41 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -27,6 +27,7 @@ #include <sfx2/zoomitem.hxx> #include <svx/svxids.hrc> #include <svx/svdoutl.hxx> +#include <svx/zoomslideritem.hxx> #include <editeng/eeitem.hxx> #include <editeng/flditem.hxx> #include <editeng/editstat.hxx> @@ -107,7 +108,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) const SfxItemSet* pArgs = rReq.GetArgs(); const SfxUInt16Item* pScale = (pArgs && pArgs->Count () == 1) ? - rReq.GetArg<SfxUInt16Item>(SID_ATTR_ZOOMSLIDER) : nullptr; + rReq.GetArg(SID_ATTR_ZOOMSLIDER) : nullptr; if (pScale && CHECK_RANGE (5, pScale->GetValue (), 3000)) { SetZoom (pScale->GetValue ()); diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 77690bf01e24..8ef53ebaedc5 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5650,7 +5650,7 @@ SfxVoidItem PasteUnformatted SID_PASTE_UNFORMATTED // call thesaurus dialog from context menu SfxVoidItem ThesaurusFromContext SID_THES -(SfxStringItem WordReplace SID_THES) +(SfxStringItem WordReplace FN_PARAM_THES_WORD_REPLACE) [ AutoUpdate = FALSE, FastCall = TRUE, @@ -5753,7 +5753,7 @@ SfxVoidItem UnicodeNotationToggle SID_UNICODE_NOTATION_TOGGLE ] SfxVoidItem AdditionsDialog SID_ADDITIONS_DIALOG -(SfxStringItem AdditionsTag SID_ADDITIONS_TAG) +(SfxStringItem AdditionsTag FN_PARAM_ADDITIONS_TAG) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 72076871ee98..2373035dacf8 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -90,7 +90,7 @@ SfxFormalArgument const aFormalArgs[] = { { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "NoEmbDataSet", SID_NO_EMBEDDED_DS }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "IsRedactMode", SID_IS_REDACT_MODE }, { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "RedactionStyle", SID_REDACTION_STYLE }, - { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "AdditionsTag", SID_ADDITIONS_TAG }, + { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "AdditionsTag", FN_PARAM_ADDITIONS_TAG }, }; sal_uInt16 const nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index b671d2924701..3246e43bc404 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1283,7 +1283,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) case SID_THES: { OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -1400,7 +1400,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) OUString aStatusVal; LanguageType nLang = LANGUAGE_NONE; bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() ); - rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + rSet.Put( SfxStringItem( FN_PARAM_THES_WORD_REPLACE, aStatusVal ) ); // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 502fd7a6fa09..e2d41cb03f95 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -153,7 +153,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case SID_THES: { OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -699,7 +699,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) LanguageType nLang = LANGUAGE_NONE; bool bIsLookUpWord = GetStatusValueForThesaurusFromContext(aStatusVal, nLang, pOLV->GetEditView()); - rSet.Put(SfxStringItem(SID_THES, aStatusVal)); + rSet.Put(SfxStringItem(FN_PARAM_THES_WORD_REPLACE, aStatusVal)); // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference<linguistic2::XThesaurus> xThes(::GetThesaurus()); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 43aaae7a7243..5a8b7bf93de7 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -542,7 +542,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { // replace word/selection with text from selected sub menu entry OUString aReplaceText; - const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg(FN_PARAM_THES_WORD_REPLACE); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -1716,7 +1716,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) { // set word and locale to look up as status value OUString aStatusVal = aText + "#" + aLanguageTag.getBcp47(); - rSet.Put( SfxStringItem( SID_THES, aStatusVal ) ); + rSet.Put( SfxStringItem( FN_PARAM_THES_WORD_REPLACE, aStatusVal ) ); } } break; diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index dd0da7acef95..eed4eddcc064 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -81,7 +81,7 @@ void SwView::ExecDlgExt(SfxRequest const &rReq) { OUString sAdditionsTag = ""; - const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(SID_ADDITIONS_TAG); + const SfxStringItem* pStringArg = rReq.GetArg<SfxStringItem>(FN_PARAM_ADDITIONS_TAG); if (pStringArg) sAdditionsTag = pStringArg->GetValue();