diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-03-04 23:29:50 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-03-05 11:51:32 +0100 |
commit | aecdb5425538130ff4b82d56fa910bffcd9c3b81 (patch) | |
tree | e9a51f36470b7df4f4c3ea1b5aa57f36e398c84c /vcl | |
parent | d6886c340d1c940a4b3ab7e7ca499fff63183845 (diff) |
emplace_back: use perfect forwarding if possible
When using that new-ish method, try giving the compiler a chance to
construct in-place. Left out harder cases using initializer lists,
and might have missed slightly less obvious places.
Change-Id: Ifcc3a6d4599474457e37dd17a35c41fc73e7a17e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111980
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/stdtext.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/scrwnd.cxx | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx index 0d5e8411bc60..f5b603e009bd 100644 --- a/vcl/source/app/stdtext.cxx +++ b/vcl/source/app/stdtext.cxx @@ -39,10 +39,10 @@ static void ImplInitMsgBoxImageList() std::vector<Image> &rImages = pSVData->mpWinData->maMsgBoxImgList; if (rImages.empty()) { - rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX)); - rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_QUERYBOX)); - rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WARNINGBOX)); - rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_INFOBOX)); + rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX); + rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_QUERYBOX); + rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_WARNINGBOX); + rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_INFOBOX); } } diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 3fd68cf09351..efb29c4f52f5 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -118,12 +118,12 @@ void ImplWheelWindow::ImplSetRegion( const Bitmap& rRegionBmp ) void ImplWheelWindow::ImplCreateImageList() { - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_SCROLLVH)); - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_SCROLLV)); - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_SCROLLH)); - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WHEELVH)); - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WHEELV)); - maImgList.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WHEELH)); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_SCROLLVH); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_SCROLLV); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_SCROLLH); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_WHEELVH); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_WHEELV); + maImgList.emplace_back(StockImage::Yes, SV_RESID_BITMAP_WHEELH); } void ImplWheelWindow::ImplSetWheelMode( WheelMode nWheelMode ) |