diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-16 22:46:30 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-10-17 11:33:51 +0200 |
commit | 43a9bf11203ed92096af34ab828501e0218832c7 (patch) | |
tree | ce14a91d0e0a74e38057c19154ba51f3b3993bb4 /vcl/source | |
parent | 6cce3821ff14b41b704e279034680ce81d2b14ca (diff) |
Simplify vector initialization in vcl
Change-Id: I881627313221081f72f8421c91417e4c111cfd97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123708
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/throbber.cxx | 10 | ||||
-rw-r--r-- | vcl/source/font/fontcharmap.cxx | 3 | ||||
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 58e1cba83ad6..f783841991c3 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3748,8 +3748,7 @@ void SalInstanceTreeView::thaw() void SalInstanceTreeView::set_column_fixed_widths(const std::vector<int>& rWidths) { - std::vector<tools::Long> aTabPositions; - aTabPositions.push_back(0); + std::vector<tools::Long> aTabPositions{ 0 }; for (size_t i = 0; i < rWidths.size(); ++i) aTabPositions.push_back(aTabPositions[i] + rWidths[i]); m_xTreeView->SetTabs(aTabPositions.size(), aTabPositions.data(), MapUnit::MapPixel); @@ -5096,8 +5095,7 @@ IMPL_LINK_NOARG(SalInstanceTreeView, DoubleClickHdl, SvTreeListBox*, bool) IMPL_LINK(SalInstanceTreeView, EndDragHdl, HeaderBar*, pHeaderBar, void) { - std::vector<tools::Long> aTabPositions; - aTabPositions.push_back(0); + std::vector<tools::Long> aTabPositions{ 0 }; for (int i = 0; i < pHeaderBar->GetItemCount() - 1; ++i) aTabPositions.push_back(aTabPositions[i] + pHeaderBar->GetItemSize(pHeaderBar->GetItemId(i))); diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index e1faeb7c7af1..d7dc3e4a763d 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -99,10 +99,12 @@ void Throbber::initImages() { try { - ::std::vector< ::std::vector< Image > > aImageSets; - aImageSets.push_back( lcl_loadImageSet( ImageSet::N16px ) ); - aImageSets.push_back( lcl_loadImageSet( ImageSet::N32px ) ); - aImageSets.push_back( lcl_loadImageSet( ImageSet::N64px ) ); + ::std::vector< ::std::vector< Image > > aImageSets + { + lcl_loadImageSet( ImageSet::N16px ), + lcl_loadImageSet( ImageSet::N32px ), + lcl_loadImageSet( ImageSet::N64px ) + }; // find the best matching image set (size-wise) const ::Size aWindowSizePixel = GetSizePixel(); diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 90a08d617a86..72a4feacd36e 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -176,9 +176,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) sal_UCS4* pCodePairs = nullptr; int* pStartGlyphs = nullptr; - std::vector<sal_uInt16> aGlyphIdArray; + std::vector<sal_uInt16> aGlyphIdArray { 0 }; aGlyphIdArray.reserve( 0x1000 ); - aGlyphIdArray.push_back( 0 ); // format 4, the most common 16bit char mapping table if( (nFormat == 4) && ((nOffset+16) < nLength) ) diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 86946799a001..dfee625308b2 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -660,8 +660,7 @@ static int GetTTGlyphOutline(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, Cont } else { - std::vector< sal_uInt32 > aPrivList; - aPrivList.push_back( glyphID ); + std::vector< sal_uInt32 > aPrivList { glyphID }; res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist ? *glyphlist : aPrivList ); } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index f8beb309b3d8..5ac275290df3 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -655,9 +655,11 @@ void FloatingWindow::PixelInvalidate(const tools::Rectangle* /*pRectangle*/) { if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier()) { - std::vector<vcl::LOKPayloadItem> aPayload; const tools::Rectangle aRect(Point(0,0), Size(GetSizePixel().Width()+1, GetSizePixel().Height()+1)); - aPayload.push_back(std::make_pair(OString("rectangle"), aRect.toString())); + std::vector<vcl::LOKPayloadItem> aPayload + { + std::make_pair(OString("rectangle"), aRect.toString()) + }; const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier(); pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload); } |