diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-22 18:16:43 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-10-22 19:17:50 +0200 |
commit | 86430b76d5833d85f54ccfdbf933162b59a261d9 (patch) | |
tree | 9fa3523899bca5dcbb856e55733b9d9076aa1a7b /sdext | |
parent | db43de861f7b5b66993245ab9e7719fdce61caf8 (diff) |
Revert part of "Simplify vector initialization in sdext"
since it needs 2 allocations instead of one
This partially reverts commit d64a6e2245169e5e4a3f8bc5388b4fff4984e5f4 .
Change-Id: Iadd8193a02bd922105c082fe3bbcc6f8e9f96b22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124069
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterCanvasHelper.cxx | 7 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterWindowManager.cxx | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sdext/source/presenter/PresenterCanvasHelper.cxx b/sdext/source/presenter/PresenterCanvasHelper.cxx index 697a84d0a8ec..8381f8d5aabd 100644 --- a/sdext/source/presenter/PresenterCanvasHelper.cxx +++ b/sdext/source/presenter/PresenterCanvasHelper.cxx @@ -71,11 +71,10 @@ void PresenterCanvasHelper::PaintRectangle ( return; // Create a clip polypolygon that has the content box as hole. - ::std::vector<awt::Rectangle> aRectangles - { - PresenterGeometryHelper::Intersection(rRepaintBox, rOuterBoundingBox) - }; + ::std::vector<awt::Rectangle> aRectangles; aRectangles.reserve(2); + aRectangles.push_back( + PresenterGeometryHelper::Intersection(rRepaintBox, rOuterBoundingBox)); if (rContentBoundingBox.Width > 0 && rContentBoundingBox.Height > 0) aRectangles.push_back( PresenterGeometryHelper::Intersection(rRepaintBox, rContentBoundingBox)); diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 9a541842286d..24115fa52523 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -989,11 +989,9 @@ Reference<rendering::XPolyPolygon2D> PresenterWindowManager::CreateClipPolyPolyg // Create a clip polygon that includes the whole update area but has the // content windows as holes. const sal_Int32 nPaneCount (mpPaneContainer->maPanes.size()); - ::std::vector<awt::Rectangle> aRectangles - { - mxParentWindow->getPosSize() - }; + ::std::vector<awt::Rectangle> aRectangles; aRectangles.reserve(1+nPaneCount); + aRectangles.push_back(mxParentWindow->getPosSize()); for (const auto& pDescriptor : mpPaneContainer->maPanes) { if ( ! pDescriptor->mbIsActive) |