summaryrefslogtreecommitdiff
path: root/sd/source/ui/func
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 /sd/source/ui/func
parent7a2d55a1943e51895d808e87f1766b44761a495a (diff)
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 'sd/source/ui/func')
-rw-r--r--sd/source/ui/func/fudraw.cxx7
-rw-r--r--sd/source/ui/func/fuoltext.cxx10
-rw-r--r--sd/source/ui/func/fupoor.cxx10
-rw-r--r--sd/source/ui/func/fusel.cxx59
-rw-r--r--sd/source/ui/func/futext.cxx10
5 files changed, 53 insertions, 43 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 76898a62cac7..4488b7bb2eff 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -721,9 +721,10 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt)
!mpDocSh->IsReadOnly())
{
SfxUInt16Item aItem(SID_TEXTEDIT, 2);
- mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_TEXTEDIT, SfxCallMode::ASYNCHRON |
- SfxCallMode::RECORD, &aItem, 0L);
+ mpViewShell->GetViewFrame()->GetDispatcher()->ExecuteList(
+ SID_TEXTEDIT,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aItem });
}
else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRUP)
{
diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx
index 79757080dc4e..5a753bb25895 100644
--- a/sd/source/ui/func/fuoltext.cxx
+++ b/sd/source/ui/func/fuoltext.cxx
@@ -155,15 +155,17 @@ bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
if ( rMEvt.IsMod1() )
{
// open in new frame
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aBrowseItem, &aReferer });
}
else
{
// open in current frame
SfxFrameItem aFrameItem( SID_DOCFRAME, pFrame );
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
}
}
}
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index b39c56910356..6d6c9fa7c8d2 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -820,11 +820,10 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// try to activate textedit mode for the selected object
SfxStringItem aInputString(SID_ATTR_CHAR, OUString(rKEvt.GetCharCode()));
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
+ mpViewShell->GetViewFrame()->GetDispatcher()->ExecuteList(
SID_ATTR_CHAR,
SfxCallMode::ASYNCHRON,
- &aInputString,
- 0L);
+ { &aInputString });
// consumed
bReturn = true;
@@ -869,11 +868,10 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt)
mpView->MarkObj(pCandidate, mpView->GetSdrPageView());
SfxStringItem aInputString(SID_ATTR_CHAR, OUString(rKEvt.GetCharCode()));
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
+ mpViewShell->GetViewFrame()->GetDispatcher()->ExecuteList(
SID_ATTR_CHAR,
SfxCallMode::ASYNCHRON,
- &aInputString,
- 0L);
+ { &aInputString });
// consumed
bReturn = true;
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index fbd0587ea3e2..2979c9099416 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -259,8 +259,9 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
SfxUInt16Item aItem(SID_TEXTEDIT, 1);
mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_TEXTEDIT, SfxCallMode::SYNCHRON |
- SfxCallMode::RECORD, &aItem, 0L);
+ ExecuteList(SID_TEXTEDIT,
+ SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
+ { &aItem });
return bReturn; // CAUTION, due to the synchronous slot the object is deleted now
}
}
@@ -285,15 +286,17 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if (rMEvt.IsMod1())
{
// Open in new frame
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aBrowseItem, &aReferer });
}
else
{
// Open in current frame
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
}
bReturn = true;
@@ -1249,9 +1252,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
SfxBoolItem aBrowseItem( SID_BROWSE, true );
mpWindow->ReleaseMouse();
- pFrame->GetDispatcher()->
- Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
bAnimated = true;
}
@@ -1273,8 +1276,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
{
// Jump to Bookmark (Page or Object)
SfxStringItem aItem(SID_NAVIGATOR_OBJECT, pInfo->GetBookmark());
- mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_NAVIGATOR_OBJECT, SfxCallMode::SLOT | SfxCallMode::RECORD, &aItem, 0L);
+ mpViewShell->GetViewFrame()->GetDispatcher()->ExecuteList(
+ SID_NAVIGATOR_OBJECT,
+ SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
bAnimated = true;
}
break;
@@ -1291,8 +1295,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
SfxBoolItem aBrowseItem( SID_BROWSE, true );
pFrame->GetDispatcher()->
- Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
+ ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
}
bAnimated = true;
@@ -1304,8 +1309,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
// Jump to the previous page
SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_PREVIOUS);
mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_NAVIGATOR_PAGE, SfxCallMode::SLOT | SfxCallMode::RECORD,
- &aItem, 0L);
+ ExecuteList(SID_NAVIGATOR_PAGE,
+ SfxCallMode::SLOT | SfxCallMode::RECORD,
+ { &aItem });
bAnimated = true;
}
break;
@@ -1315,8 +1321,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
// Jump to the next page
SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_NEXT);
mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_NAVIGATOR_PAGE, SfxCallMode::SLOT | SfxCallMode::RECORD,
- &aItem, 0L);
+ ExecuteList(SID_NAVIGATOR_PAGE,
+ SfxCallMode::SLOT | SfxCallMode::RECORD,
+ { &aItem });
bAnimated = true;
}
break;
@@ -1326,8 +1333,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
// Jump to the first page
SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_FIRST);
mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_NAVIGATOR_PAGE, SfxCallMode::SLOT | SfxCallMode::RECORD,
- &aItem, 0L);
+ ExecuteList(SID_NAVIGATOR_PAGE,
+ SfxCallMode::SLOT | SfxCallMode::RECORD,
+ { &aItem });
bAnimated = true;
}
break;
@@ -1337,8 +1345,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
// Jump to the last page
SfxUInt16Item aItem(SID_NAVIGATOR_PAGE, PAGE_LAST);
mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_NAVIGATOR_PAGE, SfxCallMode::SLOT | SfxCallMode::RECORD,
- &aItem, 0L);
+ ExecuteList(SID_NAVIGATOR_PAGE,
+ SfxCallMode::SLOT | SfxCallMode::RECORD,
+ { &aItem });
bAnimated = true;
}
break;
@@ -1381,11 +1390,9 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
- pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aUrl,
- &aBrowsing,
- 0L );
+ pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aUrl, &aBrowsing });
}
bAnimated = true;
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 9aecfe3d046e..f5d83bdf8465 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -342,15 +342,17 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
if (rMEvt.IsMod1())
{
// open in new frame
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aBrowseItem, &aReferer });
}
else
{
// open in current frame
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
- pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
+ pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
}
}
else