summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-10-16 08:42:39 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-16 12:12:27 +0200
commite5be07f5167d4103b4620201df350b1d9e795393 (patch)
treea100ca13a792d765caf75decd2b47104bf3a9f41 /sfx2
parent427c5dc6e0f817253b2f8cd7727e447ac4f4d656 (diff)
sfx items: Kill the unreadable SFX_REQUEST_ARG, use a template param instead.
Change-Id: I7130f7a84077a63cdc0ca1e131a4d90469eac90d
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appbas.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx58
-rw-r--r--sfx2/source/appl/appserv.cxx17
-rw-r--r--sfx2/source/control/request.cxx23
-rw-r--r--sfx2/source/doc/objserv.cxx17
-rw-r--r--sfx2/source/view/viewfrm.cxx32
-rw-r--r--sfx2/source/view/viewfrm2.cxx6
-rw-r--r--sfx2/source/view/viewprn.cxx6
-rw-r--r--sfx2/source/view/viewsh.cxx10
9 files changed, 74 insertions, 97 deletions
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 6dd18292a9c8..1a4365bb37f8 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -152,7 +152,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
{
case SID_ATTR_UNDO_COUNT:
{
- SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID);
+ const SfxUInt16Item* pCountItem = rReq.GetArg<SfxUInt16Item>(nSID);
std::shared_ptr< comphelper::ConfigurationChanges > batch(
comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Undo::Steps::set(
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index ae314e1deefe..79f733719b38 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -413,7 +413,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStri
void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
{
- SFX_REQUEST_ARG(rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT);
+ const SfxStringItem* pFactoryItem = rReq.GetArg<SfxStringItem>(SID_NEWDOCDIRECT);
OUString aFactName;
if ( pFactoryItem )
aFactName = pFactoryItem->GetValue();
@@ -429,10 +429,10 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
aReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString( "_default" ) ) );
// TODO/LATER: Should the other arguments be transferred as well?
- SFX_REQUEST_ARG(rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH);
+ const SfxStringItem* pDefaultPathItem = rReq.GetArg<SfxStringItem>(SID_DEFAULTFILEPATH);
if ( pDefaultPathItem )
aReq.AppendItem( *pDefaultPathItem );
- SFX_REQUEST_ARG(rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME);
+ const SfxStringItem* pDefaultNameItem = rReq.GetArg<SfxStringItem>(SID_DEFAULTFILENAME);
if ( pDefaultNameItem )
aReq.AppendItem( *pDefaultNameItem );
@@ -447,9 +447,9 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
{
// No Parameter from BASIC only Factory given?
- SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME);
- SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME);
- SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME);
+ const SfxStringItem* pTemplNameItem = rReq.GetArg<SfxStringItem>(SID_TEMPLATE_NAME);
+ const SfxStringItem* pTemplFileNameItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME);
+ const SfxStringItem* pTemplRegionNameItem = rReq.GetArg<SfxStringItem>(SID_TEMPLATE_REGIONNAME);
SfxObjectShellLock xDoc;
@@ -576,12 +576,12 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter)
void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
OUString aDocService;
- SFX_REQUEST_ARG(rReq, pDocSrvItem, SfxStringItem, SID_DOC_SERVICE);
+ const SfxStringItem* pDocSrvItem = rReq.GetArg<SfxStringItem>(SID_DOC_SERVICE);
if (pDocSrvItem)
aDocService = pDocSrvItem->GetValue();
sal_uInt16 nSID = rReq.GetSlot();
- SFX_REQUEST_ARG(rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME);
+ const SfxStringItem* pFileNameItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME);
if ( pFileNameItem )
{
OUString aCommand( pFileNameItem->GetValue() );
@@ -608,7 +608,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
OUString aFilter;
SfxItemSet* pSet = NULL;
OUString aPath;
- SFX_REQUEST_ARG(rReq, pFolderNameItem, SfxStringItem, SID_PATH);
+ const SfxStringItem* pFolderNameItem = rReq.GetArg<SfxStringItem>(SID_PATH);
if ( pFolderNameItem )
aPath = pFolderNameItem->GetValue();
else if ( nSID == SID_OPENTEMPLATE )
@@ -619,23 +619,23 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG;
- SFX_REQUEST_ARG(rReq, pSystemDialogItem, SfxBoolItem, SID_FILE_DIALOG);
+ const SfxBoolItem* pSystemDialogItem = rReq.GetArg<SfxBoolItem>(SID_FILE_DIALOG);
if ( pSystemDialogItem )
nDialog = pSystemDialogItem->GetValue() ? SFX2_IMPL_DIALOG_SYSTEM : SFX2_IMPL_DIALOG_OOO;
- SFX_REQUEST_ARG(rReq, pRemoteDialogItem, SfxBoolItem, SID_REMOTE_DIALOG);
+ const SfxBoolItem* pRemoteDialogItem = rReq.GetArg<SfxBoolItem>(SID_REMOTE_DIALOG);
if ( pRemoteDialogItem && pRemoteDialogItem->GetValue())
nDialog = SFX2_IMPL_DIALOG_REMOTE;
OUString sStandardDir;
- SFX_REQUEST_ARG(rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR);
+ const SfxStringItem* pStandardDirItem = rReq.GetArg<SfxStringItem>(SID_STANDARD_DIR);
if ( pStandardDirItem )
sStandardDir = pStandardDirItem->GetValue();
::com::sun::star::uno::Sequence< OUString > aBlackList;
- SFX_REQUEST_ARG(rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST);
+ const SfxStringListItem* pBlackListItem = rReq.GetArg<SfxStringListItem>(SID_BLACK_LIST);
if ( pBlackListItem )
pBlackListItem->GetStringList( aBlackList );
@@ -672,7 +672,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
css::uno::Reference< css::task::XInteractionHandler > xWrappedHandler;
// wrap existing handler or create new UUI handler
- SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER);
+ const SfxUnoAnyItem* pInteractionItem = rReq.GetArg<SfxUnoAnyItem>(SID_INTERACTIONHANDLER);
if (pInteractionItem)
{
pInteractionItem->GetValue() >>= xWrappedHandler;
@@ -760,22 +760,22 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// no else here! It's optional ...
if (!bHyperlinkUsed)
{
- SFX_REQUEST_ARG(rReq, pHyperLinkUsedItem, SfxBoolItem, SID_BROWSE);
+ const SfxBoolItem* pHyperLinkUsedItem = rReq.GetArg<SfxBoolItem>(SID_BROWSE);
if ( pHyperLinkUsedItem )
bHyperlinkUsed = pHyperLinkUsedItem->GetValue();
// no "official" item, so remove it from ItemSet before using UNO-API
rReq.RemoveItem( SID_BROWSE );
}
- SFX_REQUEST_ARG(rReq, pFileName, SfxStringItem, SID_FILE_NAME);
+ const SfxStringItem* pFileName = rReq.GetArg<SfxStringItem>(SID_FILE_NAME);
OUString aFileName = pFileName->GetValue();
OUString aReferer;
- SFX_REQUEST_ARG(rReq, pRefererItem, SfxStringItem, SID_REFERER);
+ const SfxStringItem* pRefererItem = rReq.GetArg<SfxStringItem>(SID_REFERER);
if ( pRefererItem )
aReferer = pRefererItem->GetValue();
- SFX_REQUEST_ARG(rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS);
+ const SfxStringItem* pFileFlagsItem = rReq.GetArg<SfxStringItem>(SID_OPTIONS);
if ( pFileFlagsItem )
{
OUString aFileFlags = pFileFlagsItem->GetValue();
@@ -936,13 +936,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SfxFrame* pTargetFrame = NULL;
Reference< XFrame > xTargetFrame;
- SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME);
+ const SfxFrameItem* pFrameItem = rReq.GetArg<SfxFrameItem>(SID_DOCFRAME);
if ( pFrameItem )
pTargetFrame = pFrameItem->GetFrame();
if ( !pTargetFrame )
{
- SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME);
+ const SfxUnoFrameItem* pUnoFrameItem = rReq.GetArg<SfxUnoFrameItem>(SID_FILLFRAME);
if ( pUnoFrameItem )
xTargetFrame = pUnoFrameItem->GetFrame();
}
@@ -951,7 +951,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
pTargetFrame = &SfxViewFrame::Current()->GetFrame();
// check if caller has set a callback
- SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK);
+ const SfxLinkItem* pLinkItem = rReq.GetArg<SfxLinkItem>(SID_DONELINK);
// remove from Itemset, because it confuses the parameter transformation
if ( pLinkItem )
@@ -961,19 +961,19 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// check if the view must be hidden
bool bHidden = false;
- SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN);
+ const SfxBoolItem* pHidItem = rReq.GetArg<SfxBoolItem>(SID_HIDDEN);
if ( pHidItem )
bHidden = pHidItem->GetValue();
// This request is a UI call. We have to set the right values inside the MediaDescriptor
// for: InteractionHandler, StatusIndicator, MacroExecutionMode and DocTemplate.
// But we have to look for already existing values or for real hidden requests.
- SFX_REQUEST_ARG(rReq, pPreviewItem, SfxBoolItem, SID_PREVIEW);
+ const SfxBoolItem* pPreviewItem = rReq.GetArg<SfxBoolItem>(SID_PREVIEW);
if (!bHidden && ( !pPreviewItem || !pPreviewItem->GetValue() ) )
{
- SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER);
- SFX_REQUEST_ARG(rReq, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE);
- SFX_REQUEST_ARG(rReq, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE);
+ const SfxUnoAnyItem* pInteractionItem = rReq.GetArg<SfxUnoAnyItem>(SID_INTERACTIONHANDLER);
+ const SfxUInt16Item* pMacroExecItem = rReq.GetArg<SfxUInt16Item>(SID_MACROEXECMODE);
+ const SfxUInt16Item* pDocTemplateItem = rReq.GetArg<SfxUInt16Item>(SID_UPDATEDOCMODE);
if (!pInteractionItem)
{
@@ -988,12 +988,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// extract target name
OUString aTarget;
- SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME);
+ const SfxStringItem* pTargetItem = rReq.GetArg<SfxStringItem>(SID_TARGETNAME);
if ( pTargetItem )
aTarget = pTargetItem->GetValue();
else
{
- SFX_REQUEST_ARG(rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW);
+ const SfxBoolItem* pNewViewItem = rReq.GetArg<SfxBoolItem>(SID_OPEN_NEW_VIEW);
if ( pNewViewItem && pNewViewItem->GetValue() )
aTarget = "_blank" ;
}
@@ -1020,7 +1020,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
// make URL ready
- SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem, SID_FILE_NAME);
+ const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME);
aFileName = pURLItem->GetValue();
if( aFileName.startsWith("#") ) // Mark without URL
{
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index e126695f5417..2fa9faefc408 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -346,7 +346,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if ( pFact )
{
- SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, SID_CONFIG);
+ const SfxStringItem* pStringItem = rReq.GetArg<SfxStringItem>(SID_CONFIG);
SfxItemSet aSet(
GetPool(), SID_CONFIG, SID_CONFIG );
@@ -481,7 +481,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_HELPTIPS:
{
// Evaluate Parameter
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS);
+ const SfxBoolItem* pOnItem = rReq.GetArg<SfxBoolItem>(SID_HELPTIPS);
bool bOn = pOnItem
? pOnItem->GetValue()
: !Help::IsQuickHelpEnabled();
@@ -508,7 +508,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_HELPBALLOONS:
{
// Evaluate Parameter
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS);
+ const SfxBoolItem* pOnItem = rReq.GetArg<SfxBoolItem>(SID_HELPBALLOONS);
bool bOn = pOnItem
? pOnItem->GetValue()
: !Help::IsBalloonHelpEnabled();
@@ -569,9 +569,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_SHOW_IME_STATUS_WINDOW:
if (sfx2::appl::ImeStatusWindow::canToggle())
{
- SfxBoolItem const * pItem = static_cast< SfxBoolItem const * >(
- rReq.GetArg(SID_SHOW_IME_STATUS_WINDOW, false,
- checkSfxPoolItem<SfxBoolItem>));
+ const SfxBoolItem * pItem = rReq.GetArg<SfxBoolItem>(SID_SHOW_IME_STATUS_WINDOW);
bool bShow = pItem == 0
? !pAppData_Impl->m_xImeStatusWindow->isShowing()
: pItem->GetValue();
@@ -634,8 +632,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
}
case SID_AVAILABLE_TOOLBARS:
{
- SfxStringItem const * pToolbarName = static_cast< SfxStringItem const *>(
- rReq.GetArg(SID_AVAILABLE_TOOLBARS, false, checkSfxPoolItem< SfxStringItem >));
+ const SfxStringItem* pToolbarName = rReq.GetArg<SfxStringItem>(SID_AVAILABLE_TOOLBARS);
if ( pToolbarName )
{
@@ -962,7 +959,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_OPTIONS_TREEDIALOG:
{
OUString sPageURL;
- SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem, SID_OPTIONS_PAGEURL);
+ const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(SID_OPTIONS_PAGEURL);
if ( pURLItem )
sPageURL = pURLItem->GetValue();
const SfxItemSet* pArgs = rReq.GetInternalArgs_Impl();
@@ -1220,7 +1217,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_OFFICE_CHECK_PLZ:
{
bool bRet = false;
- SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, rReq.GetSlot());
+ const SfxStringItem* pStringItem = rReq.GetArg<SfxStringItem>(rReq.GetSlot());
if ( pStringItem )
{
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 1c314a631534..0ab61b547a6c 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -426,20 +426,6 @@ void SfxRequest::RemoveItem( sal_uInt16 nID )
}
}
-
-
-const SfxPoolItem* SfxRequest::GetArg
-(
- sal_uInt16 nSlotId, // Slot-Id or Which-Id of the parameters
- bool bDeep, // sal_False: do not search in the Parent-ItemSets
- std::function<bool ( const SfxPoolItem* )> isItemType // != 0: check for required pool item class
-) const
-{
- return GetItem( pArgs, nSlotId, bDeep, isItemType );
-}
-
-
-
const SfxPoolItem* SfxRequest::GetItem
(
const SfxItemSet* pArgs,
@@ -464,15 +450,10 @@ const SfxPoolItem* SfxRequest::GetItem
case SID_MY:
{
...
- // An Example on not using the macros
- const SfxInt32Item *pPosItem = (const SfxUInt32Item*)
- rReq.GetArg( SID_POS, sal_False, TYPE(SfxInt32Item) );
+ // An example
+ const SfxInt32Item *pPosItem = rReq.GetArg<SfxUInt32Item>(SID_POS);
sal_uInt16 nPos = pPosItem ? pPosItem->GetValue() : 0;
- // An Example on using the macros
- SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, sal_False);
- sal_uInt16 nSize = pSizeItem ? pPosItem->GetValue() : 0;
-
...
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2bd58b2fff08..27fc3156ebc2 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -450,7 +450,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_DOCINFO:
{
- SFX_REQUEST_ARG(rReq, pDocInfItem, SfxDocumentInfoItem, SID_DOCINFO);
+ const SfxDocumentInfoItem* pDocInfItem = rReq.GetArg<SfxDocumentInfoItem>(SID_DOCINFO);
if ( pDocInfItem )
{
// parameter, e.g. from replayed macro
@@ -461,7 +461,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
{
// no argument containing DocInfo; check optional arguments
bool bReadOnly = IsReadOnly();
- SFX_REQUEST_ARG(rReq, pROItem, SfxBoolItem, SID_DOC_READONLY);
+ const SfxBoolItem* pROItem = rReq.GetArg<SfxBoolItem>(SID_DOC_READONLY);
if ( pROItem )
// override readonly attribute of document
// e.g. if a readonly document is saved elsewhere and user asks for editing DocInfo before
@@ -573,7 +573,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// TODO/LATER: do the following GUI related actions in standalown method
// Introduce a status indicator for GUI operation
- SFX_REQUEST_ARG(rReq, pStatusIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL);
+ const SfxUnoAnyItem* pStatusIndicatorItem = rReq.GetArg<SfxUnoAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
if ( !pStatusIndicatorItem )
{
// get statusindicator
@@ -610,7 +610,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
// Introduce an interaction handler for GUI operation
- SFX_REQUEST_ARG(rReq, pInteractionHandlerItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER);
+ const SfxUnoAnyItem* pInteractionHandlerItem = rReq.GetArg<SfxUnoAnyItem>(SID_INTERACTIONHANDLER);
if ( !pInteractionHandlerItem )
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
@@ -707,7 +707,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( lErr && nErrorCode == ERRCODE_NONE )
{
- SFX_REQUEST_ARG(rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING);
+ const SfxBoolItem* pWarnItem = rReq.GetArg<SfxBoolItem>(SID_FAIL_ON_WARNING);
if ( pWarnItem && pWarnItem->GetValue() )
nErrorCode = lErr;
}
@@ -729,8 +729,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( ( nId == SID_SAVEASDOC || nId == SID_SAVEASREMOTE ) && nErrorCode == ERRCODE_NONE )
{
- SfxBoolItem const * saveTo = static_cast<SfxBoolItem const *>(
- rReq.GetArg(SID_SAVETO, false, checkSfxPoolItem< SfxBoolItem >));
+ const SfxBoolItem* saveTo = rReq.GetArg<SfxBoolItem>(SID_SAVETO);
if (saveTo == nullptr || !saveTo->GetValue())
{
GetFrame()->RemoveInfoBar("readonly");
@@ -806,8 +805,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
// Evaluate Parameter
- SFX_REQUEST_ARG(rReq, pSaveItem, SfxBoolItem, SID_CLOSEDOC_SAVE);
- SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_CLOSEDOC_FILENAME);
+ const SfxBoolItem* pSaveItem = rReq.GetArg<SfxBoolItem>(SID_CLOSEDOC_SAVE);
+ const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(SID_CLOSEDOC_FILENAME);
if ( pSaveItem )
{
if ( pSaveItem->GetValue() )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 432e7da5a3d2..82667530348d 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -417,7 +417,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( rReq.IsAPI() )
{
// Control through API if r/w or r/o
- SFX_REQUEST_ARG(rReq, pEditItem, SfxBoolItem, SID_EDITDOC);
+ const SfxBoolItem* pEditItem = rReq.GetArg<SfxBoolItem>(SID_EDITDOC);
if ( pEditItem )
nOpenMode = pEditItem->GetValue() ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY;
}
@@ -559,7 +559,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( !pSh || !pSh->CanReload_Impl() )
break;
SfxApplication* pApp = SfxGetpApp();
- SFX_REQUEST_ARG(rReq, pForceReloadItem, SfxBoolItem, SID_FORCERELOAD);
+ const SfxBoolItem* pForceReloadItem = rReq.GetArg<SfxBoolItem>(SID_FORCERELOAD);
if( pForceReloadItem && !pForceReloadItem->GetValue() &&
!pSh->GetMedium()->IsExpired() )
return;
@@ -567,20 +567,20 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
return;
// AutoLoad is prohibited if possible
- SFX_REQUEST_ARG(rReq, pAutoLoadItem, SfxBoolItem, SID_AUTOLOAD);
+ const SfxBoolItem* pAutoLoadItem = rReq.GetArg<SfxBoolItem>(SID_AUTOLOAD);
if ( pAutoLoadItem && pAutoLoadItem->GetValue() &&
GetFrame().IsAutoLoadLocked_Impl() )
return;
SfxObjectShellLock xOldObj( pSh );
pImp->bReloading = true;
- SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem, SID_FILE_NAME);
+ const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME);
// Open as editable?
bool bForEdit = !pSh->IsReadOnly();
// If possible ask the User
bool bDo = GetViewShell()->PrepareClose();
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT);
+ const SfxBoolItem* pSilentItem = rReq.GetArg<SfxBoolItem>(SID_SILENT);
if ( bDo && GetFrame().DocIsModified_Impl() &&
!rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
{
@@ -633,7 +633,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Filter Detection
OUString referer;
- SFX_REQUEST_ARG(rReq, refererItem, SfxStringItem, SID_REFERER);
+ const SfxStringItem* refererItem = rReq.GetArg<SfxStringItem>(SID_REFERER);
if (refererItem != 0) {
referer = refererItem->GetValue();
}
@@ -1942,8 +1942,8 @@ SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const
SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const sal_uInt16 i_nViewId )
{
- SFX_REQUEST_ARG(i_rCreateDocRequest, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME);
- SFX_REQUEST_ARG(i_rCreateDocRequest, pHiddenItem, SfxBoolItem, SID_HIDDEN);
+ const SfxUnoFrameItem* pFrameItem = i_rCreateDocRequest.GetArg<SfxUnoFrameItem>(SID_FILLFRAME);
+ const SfxBoolItem* pHiddenItem = i_rCreateDocRequest.GetArg<SfxBoolItem>(SID_HIDDEN);
return LoadViewIntoFrame_Impl_NoThrow(
i_rDoc,
@@ -2217,12 +2217,12 @@ void SfxViewFrame::ExecView_Impl
pMed->GetItemSet()->ClearItem( SID_HIDDEN );
// the view ID (optional arg. TODO: this is currently not supported in the slot definition ...)
- SFX_REQUEST_ARG(rReq, pViewIdItem, SfxUInt16Item, SID_VIEW_ID);
+ const SfxUInt16Item* pViewIdItem = rReq.GetArg<SfxUInt16Item>(SID_VIEW_ID);
const sal_uInt16 nViewId = pViewIdItem ? pViewIdItem->GetValue() : GetCurViewId();
Reference < XFrame > xFrame;
// the frame (optional arg. TODO: this is currently not supported in the slot definition ...)
- SFX_REQUEST_ARG(rReq, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME);
+ const SfxUnoFrameItem* pFrameItem = rReq.GetArg<SfxUnoFrameItem>(SID_FILLFRAME);
if ( pFrameItem )
xFrame = pFrameItem->GetFrame();
@@ -2234,7 +2234,7 @@ void SfxViewFrame::ExecView_Impl
case SID_OBJECT:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxInt16Item, SID_OBJECT);
+ const SfxInt16Item* pItem = rReq.GetArg<SfxInt16Item>(SID_OBJECT);
SfxViewShell *pViewShell = GetViewShell();
if ( pViewShell && pItem )
@@ -2713,7 +2713,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
xRecorder = xSupplier->getDispatchRecorder();
bool bIsRecording = xRecorder.is();
- SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, SID_RECORDMACRO);
+ const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_RECORDMACRO);
if ( pItem && pItem->GetValue() == bIsRecording )
return;
@@ -2723,7 +2723,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
aProp <<= com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier >();
xSet->setPropertyValue(sProperty,aProp);
- SFX_REQUEST_ARG(rReq, pRecordItem, SfxBoolItem, FN_PARAM_1);
+ const SfxBoolItem* pRecordItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_1);
if ( !pRecordItem || !pRecordItem->GetValue() )
// insert script into basic library container of application
AddDispatchMacroToBasic_Impl(xRecorder->getRecordedMacro());
@@ -2782,7 +2782,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
{
OUString aStatusbarResString( "private:resource/statusbar/statusbar" );
// Evaluate parameter.
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, rReq.GetSlot());
+ const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(rReq.GetSlot());
bool bShow( true );
if ( !pShowItem )
bShow = xLayoutManager->isElementVisible( aStatusbarResString );
@@ -2807,7 +2807,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_WIN_FULLSCREEN:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot());
+ const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(rReq.GetSlot());
SfxViewFrame *pTop = GetTopViewFrame();
if ( pTop )
{
@@ -3002,7 +3002,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
// Evaluate Parameter
sal_uInt16 nSID = rReq.GetSlot();
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSID);
+ const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(nSID);
if ( nSID == SID_VIEW_DATA_SOURCE_BROWSER )
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DATABASE))
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index e44350c2e5f3..a2ccc4339538 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -163,9 +163,9 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
{
case SID_SHOWPOPUPS :
{
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS);
+ const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(SID_SHOWPOPUPS);
bool bShow = pShowItem == nullptr || pShowItem->GetValue();
- SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID);
+ const SfxUInt16Item* pIdItem = rReq.GetArg<SfxUInt16Item>(SID_CONFIGITEMID);
sal_uInt16 nId = pIdItem ? pIdItem->GetValue() : 0;
SfxWorkWindow *pWorkWin = GetFrame().GetWorkWindow_Impl();
@@ -206,7 +206,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
case SID_NEWDOCDIRECT :
{
- SFX_REQUEST_ARG(rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT);
+ const SfxStringItem* pFactoryItem = rReq.GetArg<SfxStringItem>(SID_NEWDOCDIRECT);
OUString aFactName;
if ( pFactoryItem )
aFactName = pFactoryItem->GetValue();
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index b11b990e5f77..6beda04894a7 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -646,7 +646,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// Should it be visible on the user interface,
// should it launch popup dialogue ?
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT);
+ const SfxBoolItem* pSilentItem = rReq.GetArg<SfxBoolItem>(SID_SILENT);
bSilent = pSilentItem && pSilentItem->GetValue();
}
@@ -677,7 +677,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
return;
// should we print only the selection or the whole document
- SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION);
+ const SfxBoolItem* pSelectItem = rReq.GetArg<SfxBoolItem>(SID_SELECTION);
bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() );
// detect non api call from writer ( that adds SID_SELECTION ) and reset bIsAPI
if ( pSelectItem && rReq.GetArgs()->Count() == 1 )
@@ -764,7 +764,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
SfxPrinter *pDocPrinter = GetPrinter(true);
// look for printer in parameters
- SFX_REQUEST_ARG(rReq, pPrinterItem, SfxStringItem, SID_PRINTER_NAME);
+ const SfxStringItem* pPrinterItem = rReq.GetArg<SfxStringItem>(SID_PRINTER_NAME);
if ( pPrinterItem )
{
// use PrinterName parameter to create a printer
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 47597535194f..cf88e35c8b81 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -472,7 +472,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
{
case SID_STYLE_FAMILY :
{
- SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId);
+ const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nId);
if (pItem)
{
pImp->m_nFamily = pItem->GetValue();
@@ -555,11 +555,11 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
SfxMailModel aModel;
OUString aDocType;
- SFX_REQUEST_ARG(rReq, pMailSubject, SfxStringItem, SID_MAIL_SUBJECT);
+ const SfxStringItem* pMailSubject = rReq.GetArg<SfxStringItem>(SID_MAIL_SUBJECT);
if ( pMailSubject )
aModel.SetSubject( pMailSubject->GetValue() );
- SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT);
+ const SfxStringItem* pMailRecipient = rReq.GetArg<SfxStringItem>(SID_MAIL_RECIPIENT);
if ( pMailRecipient )
{
OUString aRecipient( pMailRecipient->GetValue() );
@@ -569,7 +569,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
aRecipient = aRecipient.copy( aMailToStr.getLength() );
aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO );
}
- SFX_REQUEST_ARG(rReq, pMailDocType, SfxStringItem, SID_TYPE_NAME);
+ const SfxStringItem* pMailDocType = rReq.GetArg<SfxStringItem>(SID_TYPE_NAME);
if ( pMailDocType )
aDocType = pMailDocType->GetValue();
@@ -750,7 +750,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_PLUGINS_ACTIVE:
{
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId);
+ const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(nId);
bool const bActive = (pShowItem)
? pShowItem->GetValue()
: !pImp->m_bPlugInsActive;