summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-03-30 17:55:05 +0200
committerMichael Stahl <mstahl@redhat.com>2016-03-31 11:19:23 +0000
commit51d7f466df85f679f54e4e690f8b5e602192eb7b (patch)
tree94a72abb002879ef4dca830ad652415521b8bdd5 /cui
parentFix Windows part of 97858ca008fd8cf405e52795c8db415ef6c5afb3 (diff)
downloadcore-51d7f466df85f679f54e4e690f8b5e602192eb7b.tar.gz
core-51d7f466df85f679f54e4e690f8b5e602192eb7b.zip
sfx2: make SfxDispatcher::Execute() less variadic ...
... and less overloaded; C++11 initializer_list should make undefined behavior as fixed in ba0a866b83f016fd460320e7d057dd107e019f19 less likely. Change-Id: I15cc0804451b6a4fcbfaa623f9a30db222207865 Reviewed-on: https://gerrit.libreoffice.org/23666 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx4
-rw-r--r--cui/source/dialogs/hldocntp.cxx13
-rw-r--r--cui/source/options/treeopt.cxx16
3 files changed, 17 insertions, 16 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 02b29e70f086..b423b1cc0627 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -211,8 +211,8 @@ void SvxHpLinkDlg::Apply()
aItemSet.GetItem (SID_HYPERLINK_SETLINK));
OUString aStrEmpty;
if ( aItem->GetURL() != aStrEmpty )
- GetDispatcher()->Execute( SID_HYPERLINK_SETLINK, SfxCallMode::ASYNCHRON |
- SfxCallMode::RECORD, aItem, 0L);
+ GetDispatcher()->ExecuteList(SID_HYPERLINK_SETLINK,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { aItem });
static_cast<SvxHyperlinkTabPageBase*>( GetTabPage( GetCurPageId() ) )->DoApply();
}
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 479d6a961ed9..2545c726f4fd 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -354,10 +354,9 @@ void SvxHyperlinkNewDocTp::DoApply ()
SfxStringItem aFlags (SID_OPTIONS, aStrFlags);
// open url
- const SfxPoolItem* pReturn = GetDispatcher()->Execute( SID_OPENDOC,
- SfxCallMode::SYNCHRON,
- &aName, &aFlags,
- &aFrame, &aReferer, 0L );
+ const SfxPoolItem* pReturn = GetDispatcher()->ExecuteList(
+ SID_OPENDOC, SfxCallMode::SYNCHRON,
+ { &aName, &aFlags, &aFrame, &aReferer });
// save new doc
const SfxViewFrameItem *pItem = dynamic_cast<const SfxViewFrameItem*>( pReturn ); // SJ: pReturn is NULL if the Hyperlink
@@ -368,9 +367,9 @@ void SvxHyperlinkNewDocTp::DoApply ()
{
SfxStringItem aNewName( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- pViewFrame->GetDispatcher()->Execute( SID_SAVEASDOC,
- SfxCallMode::SYNCHRON,
- &aNewName, 0L );
+ pViewFrame->GetDispatcher()->ExecuteList(
+ SID_SAVEASDOC, SfxCallMode::SYNCHRON,
+ { &aNewName });
}
}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 0bbd5c7ffbe9..8357b71482c4 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1351,7 +1351,8 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
if ( pViewFrame )
{
SfxDispatcher* pDispatch = pViewFrame->GetDispatcher();
- pDispatch->Execute( SID_ATTR_YEAR2000, SfxCallMode::ASYNCHRON, pItem, 0L);
+ pDispatch->ExecuteList(SID_ATTR_YEAR2000,
+ SfxCallMode::ASYNCHRON, { pItem });
}
aMisc.SetYear2000(nY2K);
}
@@ -1431,25 +1432,25 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
pItem = nullptr;
if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_LANGUAGE, false, &pItem ))
{
- pDispatch->Execute(pItem->Which(), SfxCallMode::ASYNCHRON, pItem, 0L);
+ pDispatch->ExecuteList(pItem->Which(), SfxCallMode::ASYNCHRON, { pItem });
bSaveSpellCheck = true;
}
if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE, false, &pItem ))
{
- pDispatch->Execute(pItem->Which(), SfxCallMode::ASYNCHRON, pItem, 0L);
+ pDispatch->ExecuteList(pItem->Which(), SfxCallMode::ASYNCHRON, { pItem });
bSaveSpellCheck = true;
}
if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE, false, &pItem ))
{
- pDispatch->Execute(pItem->Which(), SfxCallMode::ASYNCHRON, pItem, 0L);
+ pDispatch->ExecuteList(pItem->Which(), SfxCallMode::ASYNCHRON, { pItem });
bSaveSpellCheck = true;
}
if( SfxItemState::SET == rSet.GetItemState(SID_AUTOSPELL_CHECK, false, &pItem ))
{
bool bOnlineSpelling = static_cast<const SfxBoolItem*>(pItem)->GetValue();
- pDispatch->Execute(SID_AUTOSPELL_CHECK,
- SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, pItem, 0L);
+ pDispatch->ExecuteList(SID_AUTOSPELL_CHECK,
+ SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, { pItem });
xProp->setIsSpellAuto( bOnlineSpelling );
}
@@ -1467,7 +1468,8 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
SfxViewFrame* _pViewFrame = SfxViewFrame::GetFirst();
while ( _pViewFrame )
{
- _pViewFrame->GetDispatcher()->Execute(pItem->Which(), SfxCallMode::ASYNCHRON, pItem, 0L);
+ _pViewFrame->GetDispatcher()->ExecuteList(pItem->Which(),
+ SfxCallMode::ASYNCHRON, { pItem });
_pViewFrame = SfxViewFrame::GetNext( *_pViewFrame );
}
}