diff --git a/basegfx/test/basegfxtools.cxx b/basegfx/test/basegfxtools.cxx index a768357c13a5..9c6075919333 100644 --- a/basegfx/test/basegfxtools.cxx +++ b/basegfx/test/basegfxtools.cxx @@ -32,14 +32,7 @@ class KeyStopLerpTest : public CppUnit::TestFixture { utils::KeyStopLerp maKeyStops; - static std::vector getTestVector() - { - std::vector aStops(3); - aStops[0] = 0.1; - aStops[1] = 0.5; - aStops[2] = 0.9; - return aStops; - } + static std::vector getTestVector() { return { 0.1, 0.5, 0.9 }; } public: KeyStopLerpTest() diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index c5f9490f01f7..35c615fe2873 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -56,9 +56,7 @@ struct lcl_NumberedStringGenerator } vector< uno::Any > operator()() { - vector< uno::Any > aRet(1); - aRet[0] <<= m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::number( ++m_nCounter )); - return aRet; + return { uno::Any(m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::number( ++m_nCounter ))) }; } private: OUString m_aStub; diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 9595cf2375d7..e9beeb6d1d41 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -369,9 +369,7 @@ InternalDataProvider::InternalDataProvider( aNewCategories.reserve( nLength ); for( sal_Int32 nN=0; nN aVector(1); - aVector[0] <<= aSimplecategories[nN]; - aNewCategories.push_back( aVector ); + aNewCategories.push_back( { uno::Any(aSimplecategories[nN]) } ); } } } diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 07e0e85815c1..8f2021608830 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1251,9 +1251,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas( ) std::vector< std::vector > vec; while( rs->next() ) { - std::vector row(1); - row[0] <<= xRow->getString(1); - vec.push_back( row ); + vec.push_back( { Any(xRow->getString(1)) } ); } // sort public first, sort internal schemas last, sort rest in alphabetic order diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 365cba4d8489..73a2ed613548 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -723,9 +723,7 @@ void ScColumn::AttachNewFormulaCells( const sc::CellStoreType::position_type& aP { // Merge into one span. // The original two spans are ordered from top to bottom. - std::vector aRows(2); - aRows[0] = std::min( rNewSharedRows[0], nTopRow); - aRows[1] = std::max( rNewSharedRows[3], nBotRow); + std::vector aRows { std::min( rNewSharedRows[0], nTopRow), std::max( rNewSharedRows[3], nBotRow) }; rNewSharedRows.swap( aRows); } else diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 6c79d99469f1..ac63d34414b5 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -490,26 +491,29 @@ void XclExpBiff8Encrypter::GetDocId( sal_uInt8 pnDocId[16] ) const void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_uInt8 nData ) { - vector aByte(1); - aByte[0] = nData; + vector aByte { nData }; EncryptBytes(rStrm, aByte); } void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_uInt16 nData ) { - ::std::vector pnBytes(2); - pnBytes[0] = nData & 0xFF; - pnBytes[1] = (nData >> 8) & 0xFF; + ::std::vector pnBytes + { + o3tl::narrowing(nData & 0xFF), + o3tl::narrowing((nData >> 8) & 0xFF) + }; EncryptBytes(rStrm, pnBytes); } void XclExpBiff8Encrypter::Encrypt( SvStream& rStrm, sal_uInt32 nData ) { - ::std::vector pnBytes(4); - pnBytes[0] = nData & 0xFF; - pnBytes[1] = (nData >> 8) & 0xFF; - pnBytes[2] = (nData >> 16) & 0xFF; - pnBytes[3] = (nData >> 24) & 0xFF; + ::std::vector pnBytes + { + o3tl::narrowing(nData & 0xFF), + o3tl::narrowing((nData >> 8) & 0xFF), + o3tl::narrowing((nData >> 16) & 0xFF), + o3tl::narrowing((nData >> 24) & 0xFF) + }; EncryptBytes(rStrm, pnBytes); } 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,