summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-10-16 13:16:55 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-10-16 18:10:54 +0200
commit5393f9a53eb8b33537aedd03b7c9efc5222748d6 (patch)
tree3f83dc1764e4f5013287fed31bee18c7667ccd62 /sd/source
parenta8a07cea28fd79e240c3abb084b88f4e23674fd6 (diff)
Simplify vector initialization in sd
Change-Id: I5f56919efeea66ce6e644f2cb123fd264edbcb73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123697 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/pglink.cxx3
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx8
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx3
-rw-r--r--sd/source/ui/unoidl/unopage.cxx50
-rw-r--r--sd/source/ui/view/sdview.cxx5
5 files changed, 35 insertions, 34 deletions
diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx
index 6762dcdd9bfa..358012df94f3 100644
--- a/sd/source/core/pglink.cxx
+++ b/sd/source/core/pglink.cxx
@@ -88,8 +88,7 @@ SdPageLink::~SdPageLink()
pPage->SetBookmarkName(aBookmarkName);
}
- std::vector<OUString> aBookmarkList;
- aBookmarkList.push_back(aBookmarkName);
+ std::vector<OUString> aBookmarkList { aBookmarkName };
sal_uInt16 nInsertPos = pPage->GetPageNum();
bool bNoDialogs = false;
bool bCopy = false;
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index ddc769551d5a..703f2f59809f 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -671,10 +671,12 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, SdrTextObj con
// apply line pattern if wanted
if (bDotted)
{
- std::vector<double> aPattern;
static const double fFactor(1.0);
- aPattern.push_back(3.0 * fFactor);
- aPattern.push_back(1.0 * fFactor);
+ std::vector<double> aPattern
+ {
+ 3.0 * fFactor,
+ 1.0 * fFactor
+ };
basegfx::B2DPolyPolygon aDashed;
basegfx::utils::applyLineDashing(aGeometry, aPattern, &aDashed);
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index a902383c42e2..d4f52838c859 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -545,8 +545,7 @@ std::shared_ptr<SdTransferable::UserData> Clipboard::CreateTransferableUserData
// pTransferable->SetView(&mrSlideSorter.GetView());
// Set page bookmark list.
- std::vector<OUString> aPageBookmarks;
- aPageBookmarks.push_back(sBookmark);
+ std::vector<OUString> aPageBookmarks { sBookmark };
pTransferable->SetPageBookmarks(std::move(aPageBookmarks), false);
// Replace the view referenced by the transferable with the
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 984b5fd0df2c..a9ecb7f5906c 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2061,19 +2061,21 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes()
bool bPresPage = IsImpressDocument() && ePageKind != PageKind::Handout;
// Collect the types of this class.
- ::std::vector<uno::Type> aTypes;
+ ::std::vector<uno::Type> aTypes
+ {
+ cppu::UnoType<drawing::XDrawPage>::get(),
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<container::XNamed>::get(),
+ cppu::UnoType<drawing::XMasterPageTarget>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<util::XReplaceable>::get(),
+ cppu::UnoType<document::XLinkTargetSupplier>::get(),
+ cppu::UnoType<drawing::XShapeCombiner>::get(),
+ cppu::UnoType<drawing::XShapeBinder>::get(),
+ cppu::UnoType<office::XAnnotationAccess>::get(),
+ cppu::UnoType<beans::XMultiPropertySet>::get()
+ };
aTypes.reserve(13);
- aTypes.push_back(cppu::UnoType<drawing::XDrawPage>::get());
- aTypes.push_back(cppu::UnoType<beans::XPropertySet>::get());
- aTypes.push_back(cppu::UnoType<container::XNamed>::get());
- aTypes.push_back(cppu::UnoType<drawing::XMasterPageTarget>::get());
- aTypes.push_back(cppu::UnoType<lang::XServiceInfo>::get());
- aTypes.push_back(cppu::UnoType<util::XReplaceable>::get());
- aTypes.push_back(cppu::UnoType<document::XLinkTargetSupplier>::get());
- aTypes.push_back(cppu::UnoType<drawing::XShapeCombiner>::get());
- aTypes.push_back(cppu::UnoType<drawing::XShapeBinder>::get());
- aTypes.push_back(cppu::UnoType<office::XAnnotationAccess>::get());
- aTypes.push_back(cppu::UnoType<beans::XMultiPropertySet>::get());
if( bPresPage )
aTypes.push_back(cppu::UnoType<presentation::XPresentationPage>::get());
if( bPresPage && ePageKind == PageKind::Standard )
@@ -2664,18 +2666,20 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes()
bool bPresPage = IsImpressDocument() && SvxFmDrawPage::mpPage && ePageKind != PageKind::Handout;
// Collect the types of this class.
- ::std::vector<uno::Type> aTypes;
+ ::std::vector<uno::Type> aTypes
+ {
+ cppu::UnoType<drawing::XDrawPage>::get(),
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<container::XNamed>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<util::XReplaceable>::get(),
+ cppu::UnoType<document::XLinkTargetSupplier>::get(),
+ cppu::UnoType<drawing::XShapeCombiner>::get(),
+ cppu::UnoType<drawing::XShapeBinder>::get(),
+ cppu::UnoType<office::XAnnotationAccess>::get(),
+ cppu::UnoType<beans::XMultiPropertySet>::get()
+ };
aTypes.reserve(12);
- aTypes.push_back(cppu::UnoType<drawing::XDrawPage>::get());
- aTypes.push_back(cppu::UnoType<beans::XPropertySet>::get());
- aTypes.push_back(cppu::UnoType<container::XNamed>::get());
- aTypes.push_back(cppu::UnoType<lang::XServiceInfo>::get());
- aTypes.push_back(cppu::UnoType<util::XReplaceable>::get());
- aTypes.push_back(cppu::UnoType<document::XLinkTargetSupplier>::get());
- aTypes.push_back(cppu::UnoType<drawing::XShapeCombiner>::get());
- aTypes.push_back(cppu::UnoType<drawing::XShapeBinder>::get());
- aTypes.push_back(cppu::UnoType<office::XAnnotationAccess>::get());
- aTypes.push_back(cppu::UnoType<beans::XMultiPropertySet>::get());
if( bPresPage )
aTypes.push_back(cppu::UnoType<presentation::XPresentationPage>::get());
if( bPresPage && ePageKind == PageKind::Standard )
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index d332e8cfb65f..d977334013f1 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -258,10 +258,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aPolygon.transform(aObjectMatrix);
// create line and stroke attribute
- ::std::vector< double > aDotDashArray;
-
- aDotDashArray.push_back(160.0);
- aDotDashArray.push_back(80.0);
+ ::std::vector< double > aDotDashArray { 160.0, 80.0 };
const double fFullDotDashLen(::std::accumulate(aDotDashArray.begin(), aDotDashArray.end(), 0.0));
const drawinglayer::attribute::LineAttribute aLine(aRGBColor);