From b49fce18d0b05a8b5f462ba9bf6c84f0bb107d93 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Fri, 11 Jun 2021 15:44:56 +0200 Subject: Simplify vector initializations Change-Id: Icf8972be204799e9b3b3824ab18d8584911fe1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117061 Tested-by: Jenkins Reviewed-by: Julien Nabet --- sdext/source/presenter/PresenterScreen.cxx | 28 ++++++++++++++++------------ sdext/source/presenter/PresenterTheme.cxx | 17 ++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) (limited to 'sdext') diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 30f1864e8aed..c624adcdf614 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -663,13 +663,15 @@ void PresenterScreen::ProcessLayout ( "Layout"), UNO_QUERY_THROW); - ::std::vector aProperties (6); - aProperties[0] = "PaneURL"; - aProperties[1] = "ViewURL"; - aProperties[2] = "RelativeX"; - aProperties[3] = "RelativeY"; - aProperties[4] = "RelativeWidth"; - aProperties[5] = "RelativeHeight"; + ::std::vector aProperties + { + "PaneURL", + "ViewURL", + "RelativeX", + "RelativeY", + "RelativeWidth", + "RelativeHeight" + }; PresenterConfigurationAccess::ForAll( xList, aProperties, @@ -692,11 +694,13 @@ void PresenterScreen::ProcessViewDescriptions ( rConfiguration.GetConfigurationNode("Presenter/Views"), UNO_QUERY_THROW); - ::std::vector aProperties (4); - aProperties[0] = "ViewURL"; - aProperties[1] = "Title"; - aProperties[2] = "AccessibleTitle"; - aProperties[3] = "IsOpaque"; + ::std::vector aProperties + { + "ViewURL", + "Title", + "AccessibleTitle", + "IsOpaque" + }; PresenterConfigurationAccess::ForAll( xViewDescriptionsNode, aProperties, diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx index 52c2d875d4ef..bf911dd970c4 100644 --- a/sdext/source/presenter/PresenterTheme.cxx +++ b/sdext/source/presenter/PresenterTheme.cxx @@ -52,12 +52,13 @@ public: vector ToVector() { - vector aSequence (4); - aSequence[0] = mnLeft == mnInvalidValue ? 0 : mnLeft; - aSequence[1] = mnTop == mnInvalidValue ? 0 : mnTop; - aSequence[2] = mnRight == mnInvalidValue ? 0 : mnRight; - aSequence[3] = mnBottom == mnInvalidValue ? 0 : mnBottom; - return aSequence; + return + { + mnLeft == mnInvalidValue ? 0 : mnLeft, + mnTop == mnInvalidValue ? 0 : mnTop, + mnRight == mnInvalidValue ? 0 : mnRight, + mnBottom == mnInvalidValue ? 0 : mnBottom + }; }; void Merge (const BorderSize& rBorderSize) @@ -1034,9 +1035,7 @@ void StyleAssociationContainer::Read ( if (!xStyleAssociationList.is()) return; - ::std::vector aProperties (2); - aProperties[0] = "ResourceURL"; - aProperties[1] = "StyleName"; + ::std::vector aProperties { "ResourceURL", "StyleName" }; PresenterConfigurationAccess::ForAll( xStyleAssociationList, aProperties, -- cgit