summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
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/view
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/view')
-rw-r--r--sd/source/ui/view/Outliner.cxx5
-rw-r--r--sd/source/ui/view/drviews1.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx20
-rw-r--r--sd/source/ui/view/drviews5.cxx8
-rw-r--r--sd/source/ui/view/drviews9.cxx4
-rw-r--r--sd/source/ui/view/drviewsa.cxx4
-rw-r--r--sd/source/ui/view/drviewsb.cxx4
-rw-r--r--sd/source/ui/view/drviewsd.cxx4
-rw-r--r--sd/source/ui/view/drviewse.cxx4
-rw-r--r--sd/source/ui/view/drviewsi.cxx4
-rw-r--r--sd/source/ui/view/presvish.cxx3
-rw-r--r--sd/source/ui/view/viewshel.cxx5
12 files changed, 34 insertions, 35 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0ad60d106942..b5f667e16bcb 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1399,9 +1399,8 @@ void Outliner::EnterEditMode (bool bGrabFocus)
// Make FuText the current function.
SfxUInt16Item aItem (SID_TEXTEDIT, 1);
std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- pViewShell->GetDispatcher()->
- Execute(SID_TEXTEDIT, SfxCallMode::SYNCHRON |
- SfxCallMode::RECORD, &aItem, 0L);
+ pViewShell->GetDispatcher()->ExecuteList(SID_TEXTEDIT,
+ SfxCallMode::SYNCHRON | SfxCallMode::RECORD, { &aItem });
// To be consistent with the usual behaviour in the Office the text
// object that is put into edit mode would have also to be selected.
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index de29408f2abd..710f073b59bb 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -162,8 +162,8 @@ void DrawViewShell::SelectionHasChanged()
//Update3DWindow(); // 3D-Controller
SfxBoolItem aItem( SID_3D_STATE, true );
- GetViewFrame()->GetDispatcher()->Execute(
- SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(
+ SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
SdrOle2Obj* pOleObj = nullptr;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 68aa34b767b4..b2b123d5c585 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1049,8 +1049,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
// The value (sal_uInt16)0xFFFF means set bullet on/off.
SfxUInt16Item aItem(FN_SVX_SET_BULLET, (sal_uInt16)0xFFFF);
- GetViewFrame()->GetDispatcher()->Execute(FN_SVX_SET_BULLET,
- SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET,
+ SfxCallMode::RECORD, { &aItem });
}
break;
@@ -1058,8 +1058,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
// The value (sal_uInt16)0xFFFF means set bullet on/off.
SfxUInt16Item aItem(FN_SVX_SET_NUMBER, (sal_uInt16)0xFFFF);
- GetViewFrame()->GetDispatcher()->Execute(FN_SVX_SET_NUMBER,
- SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER,
+ SfxCallMode::RECORD, { &aItem });
}
break;
@@ -1737,12 +1737,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
- pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aUrl, &aTarget,
- &aFrm, &aReferer,
- &aNewView, &aBrowsing,
- nullptr);
+ {
+ pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aUrl, &aTarget, &aFrm, &aReferer,
+ &aNewView, &aBrowsing });
+ }
}
}
}
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 477b5b79413d..6c6396d24dd1 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -73,8 +73,8 @@ void DrawViewShell::ModelHasChanged()
GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, true );
SfxBoolItem aItem( SID_3D_STATE, true );
- GetViewFrame()->GetDispatcher()->Execute(
- SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(
+ SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
// now initialize the TextEditOutliner which was newly created by the draw engine
::Outliner* pOutliner = mpDrawView->GetTextEditOutliner();
@@ -300,9 +300,9 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if ( mpDrawView->IsDesignMode() != pView->IsDesignMode() )
{
SfxBoolItem aDesignModeItem( SID_FM_DESIGN_MODE, pView->IsDesignMode() );
- GetViewFrame()->GetDispatcher()->Execute(SID_FM_DESIGN_MODE,
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_FM_DESIGN_MODE,
SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
- &aDesignModeItem, nullptr);
+ { &aDesignModeItem });
}
// has to be called in the end, because it executes a WriteFrameViewData()
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index b4ece57c30c5..0a2958c2776b 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -177,8 +177,8 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
else if( nType == css::gallery::GalleryItemType::MEDIA )
{
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() );
- GetViewFrame()->GetDispatcher()->Execute(SID_INSERT_AVMEDIA,
- SfxCallMode::SYNCHRON, &aMediaURLItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_INSERT_AVMEDIA,
+ SfxCallMode::SYNCHRON, { &aMediaURLItem });
}
GetDocSh()->SetWaitCursor( false );
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 35cfb9e6593e..52cd788cf58a 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -749,8 +749,8 @@ void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint)
mbReadOnly = GetDocSh()->IsReadOnly();
SfxBoolItem aItem( SID_FM_DESIGN_MODE, !mbReadOnly );
- GetViewFrame()->GetDispatcher()->Execute( SID_FM_DESIGN_MODE,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_FM_DESIGN_MODE,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
}
}
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index eb6842c8eb29..3369ee40ca55 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -121,8 +121,8 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName )
// inform navigator about change
SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
- GetViewFrame()->GetDispatcher()->Execute(SID_NAVIGATOR_INIT,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, nullptr);
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_NAVIGATOR_INIT,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
// Tell the slide sorter about the name change (necessary for
// accessibility.)
diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx
index 6cf3b4e9a9b1..2d0d157606ed 100644
--- a/sd/source/ui/view/drviewsd.cxx
+++ b/sd/source/ui/view/drviewsd.cxx
@@ -135,8 +135,8 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
SfxBoolItem aBrowseItem(SID_BROWSE, true);
pFrame->GetDispatcher()->
- Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aStrItem, &aFrameItem, &aBrowseItem, &aReferer, nullptr);
+ ExecuteList(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
}
SfxBindings& rBindings = GetViewFrame()->GetBindings();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index d22f581206cc..fe585eed2c7e 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -618,8 +618,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
// Make FuText the current function.
SfxUInt16Item aItem (SID_TEXTEDIT, 1);
GetViewFrame()->GetDispatcher()->
- Execute(SID_TEXTEDIT, SfxCallMode::SYNCHRON |
- SfxCallMode::RECORD, &aItem, nullptr);
+ ExecuteList(SID_TEXTEDIT, SfxCallMode::SYNCHRON |
+ SfxCallMode::RECORD, { &aItem });
// Put text object into edit mode.
GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView);
break;
diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx
index 7964e5dcd305..a2fe62bb2d36 100644
--- a/sd/source/ui/view/drviewsi.cxx
+++ b/sd/source/ui/view/drviewsi.cxx
@@ -139,9 +139,9 @@ void DrawViewShell::AssignFrom3DWindow()
// transform text into 3D
sal_uInt16 nSId = SID_CONVERT_TO_3D;
SfxBoolItem aItem( nSId, true );
- GetViewFrame()->GetDispatcher()->Execute(
+ GetViewFrame()->GetDispatcher()->ExecuteList(
nSId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
- &aItem, nullptr);
+ { &aItem });
// Determine if a FILL attribute is set.
// If not, hard set a fill attribute
diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx
index d673e06c3410..bc696eecf9df 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -125,7 +125,8 @@ void PresentationViewShell::Activate( bool bIsMDIActivate )
{
SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
- GetViewFrame()->GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, 0L );
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_NAVIGATOR_INIT,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
if( xSlideShow.is() )
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index e7543a0ff0f5..30b9f30637e5 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -316,11 +316,10 @@ void ViewShell::Activate(bool bIsMDIActivate)
// thus, the Navigator will also get a current status
SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
if (GetDispatcher() != nullptr)
- GetDispatcher()->Execute(
+ GetDispatcher()->ExecuteList(
SID_NAVIGATOR_INIT,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- &aItem,
- 0L);
+ { &aItem });
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=nullptr);