diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-10-16 08:42:39 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-10-16 12:12:27 +0200 |
commit | e5be07f5167d4103b4620201df350b1d9e795393 (patch) | |
tree | a100ca13a792d765caf75decd2b47104bf3a9f41 /sw/source/uibase/shells | |
parent | 427c5dc6e0f817253b2f8cd7727e447ac4f4d656 (diff) |
sfx items: Kill the unreadable SFX_REQUEST_ARG, use a template param instead.
Change-Id: I7130f7a84077a63cdc0ca1e131a4d90469eac90d
Diffstat (limited to 'sw/source/uibase/shells')
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/shells/langhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtnum.cxx | 8 |
9 files changed, 45 insertions, 45 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index a07e9a684eff..d4e9cdaac179 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -275,7 +275,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) { if( rReq.GetArgs() ) { - SFX_REQUEST_ARG(rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE); + const SvxUnderlineItem* pItem = rReq.GetArg<SvxUnderlineItem>(SID_ATTR_CHAR_UNDERLINE); if (pItem) { aNewAttr.Put(*pItem); @@ -470,7 +470,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_CHAR_DLG: { const SfxItemSet* pArgs = rReq.GetArgs(); - SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, FN_PARAM_1); + const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1); if( !pArgs || pItem ) { @@ -1113,7 +1113,7 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq) break; case FN_DELETE_NOTE_AUTHOR: { - SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSlot); + const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pItem ) pPostItMgr->Delete( pItem->GetValue() ); break; @@ -1125,7 +1125,7 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq) break; case FN_HIDE_NOTE_AUTHOR: { - SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSlot); + const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pItem ) pPostItMgr->Hide( pItem->GetValue() ); } @@ -1222,7 +1222,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) case SID_THES: { OUString aReplaceText; - SFX_REQUEST_ARG(rReq, pItem2, SfxStringItem, SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 828ab5dae721..9336584c413e 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2576,11 +2576,11 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) if( pArgs && pArgs->Count() >= 2 ) { - SFX_REQUEST_ARG(_rRequest, pName, SfxStringItem, FN_INSERT_TABLE); - SFX_REQUEST_ARG(_rRequest, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN); - SFX_REQUEST_ARG(_rRequest, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW); - SFX_REQUEST_ARG(_rRequest, pFlags, SfxInt32Item, FN_PARAM_1); - SFX_REQUEST_ARG(_rRequest, pAuto, SfxStringItem, FN_PARAM_2); + const SfxStringItem* pName = _rRequest.GetArg<SfxStringItem>(FN_INSERT_TABLE); + const SfxUInt16Item* pCols = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_COLUMN); + const SfxUInt16Item* pRows = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_ROW); + const SfxInt32Item* pFlags = _rRequest.GetArg<SfxInt32Item>(FN_PARAM_1); + const SfxStringItem* pAuto = _rRequest.GetArg<SfxStringItem>(FN_PARAM_2); if ( pName ) aTableName = pName->GetValue(); @@ -2772,8 +2772,8 @@ void SwBaseShell::ExecuteGallery(SfxRequest &rReq) if ( nSel & nsSelectionType::SEL_DRW_TXT ) break; - SFX_REQUEST_ARG(rReq, pPos, SfxUInt16Item, SID_GALLERY_BG_POS); - SFX_REQUEST_ARG(rReq, pBrush, SvxBrushItem, SID_GALLERY_BG_BRUSH); + const SfxUInt16Item* pPos = rReq.GetArg<SfxUInt16Item>(SID_GALLERY_BG_POS); + const SvxBrushItem* pBrush = rReq.GetArg<SvxBrushItem>(SID_GALLERY_BG_BRUSH); if ( !pPos || !pBrush ) break; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 1d81df196561..69b808b99523 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -135,7 +135,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case SID_THES: { OUString aReplaceText; - SFX_REQUEST_ARG(rReq, pItem2, SfxStringItem, SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -318,7 +318,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case SID_CHAR_DLG_FOR_PARAGRAPH: { const SfxItemSet* pArgs = rReq.GetArgs(); - SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, FN_PARAM_1); + const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1); if( !pArgs || pItem ) { diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index b4657e6d4ccf..27329776a93e 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -111,7 +111,7 @@ namespace SwLangHelper // get the language OUString aNewLangText; - SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS); + const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(SID_LANGUAGE_STATUS); if (pItem) aNewLangText = pItem->GetValue(); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index d40d21a0f43b..641b1f00257e 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -943,9 +943,9 @@ void SwTableShell::Execute(SfxRequest &rReq) long nCount=0; bool bHorizontal=true; bool bProportional = false; - SFX_REQUEST_ARG(rReq, pSplit, SfxInt32Item, FN_TABLE_SPLIT_CELLS); - SFX_REQUEST_ARG(rReq, pHor, SfxBoolItem, FN_PARAM_1); - SFX_REQUEST_ARG(rReq, pProp, SfxBoolItem, FN_PARAM_2); + const SfxInt32Item* pSplit = rReq.GetArg<SfxInt32Item>(FN_TABLE_SPLIT_CELLS); + const SfxBoolItem* pHor = rReq.GetArg<SfxBoolItem>(FN_PARAM_1); + const SfxBoolItem* pProp = rReq.GetArg<SfxBoolItem>(FN_PARAM_2); if ( pSplit ) { nCount = pSplit->GetValue(); @@ -985,7 +985,7 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_SPLIT_TABLE: { - SFX_REQUEST_ARG(rReq, pType, SfxUInt16Item, FN_PARAM_1); + const SfxUInt16Item* pType = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1); if( pType ) { switch( pType->GetValue() ) diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index a69be420ccb1..4ea500e1d49c 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -347,7 +347,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) break; case FN_DELETE_NOTE_AUTHOR: { - SFX_REQUEST_ARG(rReq, pNoteItem, SfxStringItem, nSlot); + const SfxStringItem* pNoteItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pNoteItem && GetView().GetPostItMgr() ) GetView().GetPostItMgr()->Delete( pNoteItem->GetValue() ); } @@ -365,7 +365,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) break; case FN_HIDE_NOTE_AUTHOR: { - SFX_REQUEST_ARG(rReq, pNoteItem, SfxStringItem, nSlot); + const SfxStringItem* pNoteItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pNoteItem && GetView().GetPostItMgr() ) GetView().GetPostItMgr()->Hide( pNoteItem->GetValue() ); } @@ -376,7 +376,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD); if (bNew || GetView().GetPostItMgr()->IsAnswer()) { - SFX_REQUEST_ARG(rReq, pAuthorItem, SvxPostItAuthorItem, SID_ATTR_POSTIT_AUTHOR); + const SvxPostItAuthorItem* pAuthorItem = rReq.GetArg<SvxPostItAuthorItem>(SID_ATTR_POSTIT_AUTHOR); OUString sAuthor; if ( pAuthorItem ) sAuthor = pAuthorItem->GetValue(); @@ -388,7 +388,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) sAuthor = SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ); } - SFX_REQUEST_ARG(rReq, pTextItem, SvxPostItTextItem, SID_ATTR_POSTIT_TEXT); + const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT); OUString sText; if ( pTextItem ) sText = pTextItem->GetValue(); @@ -543,8 +543,8 @@ void SwTextShell::ExecField(SfxRequest &rReq) if ( pItem ) { aText = static_cast<const SfxStringItem*>(pItem)->GetValue(); - SFX_REQUEST_ARG(rReq, pType, SfxStringItem, FN_PARAM_2); - SFX_REQUEST_ARG(rReq, pIsUrl, SfxBoolItem, FN_PARAM_1); + const SfxStringItem* pType = rReq.GetArg<SfxStringItem>(FN_PARAM_2); + const SfxBoolItem* pIsUrl = rReq.GetArg<SfxBoolItem>(FN_PARAM_1); if ( pType ) aType = pType->GetValue(); if ( pIsUrl ) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 45f4ecbdc385..c842ef5e14d5 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -282,7 +282,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case SID_INSERT_OBJECT: case SID_INSERT_PLUGIN: { - SFX_REQUEST_ARG(rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT); + const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT); SvGlobalName *pName = NULL; SvGlobalName aName; if ( pNameItem ) @@ -291,8 +291,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) pName = &aName; } - SFX_REQUEST_ARG(rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2); - SFX_REQUEST_ARG(rReq, pCommandsItem, SfxStringItem, FN_PARAM_3); + const SfxStringItem* pClassLocationItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2); + const SfxStringItem* pCommandsItem = rReq.GetArg<SfxStringItem>(FN_PARAM_3); //TODO/LATER: recording currently not working, need code for Commandlist svt::EmbeddedObjectRef xObj; if( nSlot == SID_INSERT_PLUGIN && ( pClassLocationItem || pCommandsItem ) ) @@ -353,11 +353,11 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case SID_INSERT_FLOATINGFRAME: { svt::EmbeddedObjectRef xObj; - SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, FN_PARAM_1); - SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem, FN_PARAM_2); - SFX_REQUEST_ARG(rReq, pMarginItem, SvxSizeItem, FN_PARAM_3); - SFX_REQUEST_ARG(rReq, pScrollingItem, SfxByteItem, FN_PARAM_4); - SFX_REQUEST_ARG(rReq, pBorderItem, SfxBoolItem, FN_PARAM_5); + const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1); + const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(FN_PARAM_2); + const SvxSizeItem* pMarginItem = rReq.GetArg<SvxSizeItem>(FN_PARAM_3); + const SfxByteItem* pScrollingItem = rReq.GetArg<SfxByteItem>(FN_PARAM_4); + const SfxBoolItem* pBorderItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_5); if(pURLItem) // URL is a _must_ { diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index f67df16a5908..2e1b8eba6a56 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -189,7 +189,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const } else if (pDlg && pReq) { - SFX_REQUEST_ARG((*pReq), pItem, SfxStringItem, FN_PARAM_1); + const SfxStringItem* pItem = (*pReq).GetArg<SfxStringItem>(FN_PARAM_1); if (pItem) pDlg->SetCurPageId(OUStringToOString(pItem->GetValue(), RTL_TEXTENCODING_UTF8)); } @@ -323,7 +323,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { // get the language OUString aNewLangText; - SFX_REQUEST_ARG(rReq, pItem2, SfxStringItem, SID_LANGUAGE_STATUS); + const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_LANGUAGE_STATUS); if (pItem2) aNewLangText = pItem2->GetValue(); @@ -435,7 +435,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { // replace word/selection with text from selected sub menu entry OUString aReplaceText; - SFX_REQUEST_ARG(rReq, pItem2, SfxStringItem, SID_THES); + const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(SID_THES); if (pItem2) aReplaceText = pItem2->GetValue(); if (!aReplaceText.isEmpty()) @@ -457,8 +457,8 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_INSERT_ENDNOTE: { OUString aStr; - SFX_REQUEST_ARG(rReq, pFont, SfxStringItem, FN_PARAM_1); - SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, nSlot); + const SfxStringItem* pFont = rReq.GetArg<SfxStringItem>(FN_PARAM_1); + const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pNameItem ) aStr = pNameItem->GetValue(); bool bFont = pFont && !pFont->GetValue().isEmpty(); @@ -556,9 +556,9 @@ void SwTextShell::Execute(SfxRequest &rReq) if ( pItem ) { nKind = static_cast<const SfxInt16Item*>(pItem)->GetValue(); - SFX_REQUEST_ARG(rReq, pTemplate, SfxStringItem, FN_PARAM_1); - SFX_REQUEST_ARG(rReq, pNumber, SfxUInt16Item, FN_PARAM_2); - SFX_REQUEST_ARG(rReq, pIsNumberFilled, SfxBoolItem, FN_PARAM_3); + const SfxStringItem* pTemplate = rReq.GetArg<SfxStringItem>(FN_PARAM_1); + const SfxUInt16Item* pNumber = rReq.GetArg<SfxUInt16Item>(FN_PARAM_2); + const SfxBoolItem* pIsNumberFilled = rReq.GetArg<SfxBoolItem>(FN_PARAM_3); if ( pTemplate ) aTemplateName = pTemplate->GetValue(); if ( pNumber && pIsNumberFilled && pIsNumberFilled->GetValue() ) diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 3c96264d08ae..9b3e89563f7d 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -50,7 +50,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) case FN_NUM_NUMBERING_ON: { GetShell().StartAllAction(); - SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, FN_PARAM_1); + const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_1); bool bMode = !GetShell().SelectionHasNumber(); // #i29560# if ( pItem ) bMode = pItem->GetValue(); @@ -79,7 +79,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) case FN_NUM_BULLET_ON: { GetShell().StartAllAction(); - SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, FN_PARAM_1); + const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_1); bool bMode = !GetShell().SelectionHasBullet(); // #i29560# if ( pItem ) bMode = pItem->GetValue(); @@ -186,7 +186,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, GetView().GetWindow(), &aSet, GetShell())); OSL_ENSURE(pDlg, "Dialog creation failed!"); - SFX_REQUEST_ARG(rReq, pPageItem, SfxStringItem, FN_PARAM_1); + const SfxStringItem* pPageItem = rReq.GetArg<SfxStringItem>(FN_PARAM_1); if ( pPageItem ) pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) ); const short nRet = pDlg->Execute(); @@ -247,7 +247,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) case FN_SVX_SET_NUMBER: case FN_SVX_SET_BULLET: { - SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nSlot); + const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSlot); if ( pItem != NULL ) { const sal_uInt16 nChoosenItemIdx = pItem->GetValue(); |