diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2023-06-24 16:08:26 +0200 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-06-24 22:29:34 +0200 |
commit | 81daca18b69d31995bcd56f804659318398c02e2 (patch) | |
tree | 592f8ce6bfcf11868e67da99e0cdbdf6d708c957 /sd | |
parent | 5b02c7225837615d15f90e36a163fd3c39108465 (diff) |
CID several. Use ctor 'from other' instead 'first..last'
This covers CID#1532461, CID#1532462, CID#1532464, CID#1532467,
CID#1532479.
Now solutions without iterator are used.
In all cases constructions like
maColorStops = basegfx::BColorStops(rGradient.GetColorStops().begin(),
rGradient.GetColorStops().end());
are replaced with solutions like
maColorStops = rGradient.GetColorStops();
And instead of constructions like
aColorStops.emplace_back(maColorStops.front().getStopOffset(),
aStartBColor);
aColorStops.insert(aColorStops.begin(),
maColorStops.begin() + 1, maColorStops.end() - 1);
aColorStops.emplace_back(maColorStops.back().getStopOffset(),
aEndBColor);
now it is like
aColorStops = maColorStops;
aColorStops.front() =
basegfx::BColorStop(maColorStops.front().getStopOffset(),
aStartBColor);
aColorStops.back() =
basegfx::BColorStop(maColorStops.back().getStopOffset(),
aEndBColor);
Change-Id: I66662d2286e7707b205c58977bc3f850b2a49dda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153555
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index dd2a0f491418..ebdbf0977505 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -406,8 +406,7 @@ void SlideBackground::Update() // MCGR: preserve ColorStops if given. // tdf#155901 We need offset of first and last stop, so include them. if (aBGradient.GetColorStops().size() >= 2) - maColorStops = basegfx::BColorStops(aBGradient.GetColorStops().begin(), - aBGradient.GetColorStops().end()); + maColorStops = aBGradient.GetColorStops(); else maColorStops.clear(); } @@ -1293,11 +1292,11 @@ basegfx::BColorStops SlideBackground::createColorStops() if (maColorStops.size() >= 2) { - aColorStops.emplace_back(maColorStops.front().getStopOffset(), - mxFillGrad1->GetSelectEntryColor().getBColor()); - aColorStops.insert(aColorStops.begin(), maColorStops.begin() + 1, maColorStops.end() - 1); - aColorStops.emplace_back(maColorStops.back().getStopOffset(), - mxFillGrad2->GetSelectEntryColor().getBColor()); + aColorStops = maColorStops; + aColorStops.front() = basegfx::BColorStop(maColorStops.front().getStopOffset(), + mxFillGrad1->GetSelectEntryColor().getBColor()); + aColorStops.back() = basegfx::BColorStop(maColorStops.back().getStopOffset(), + mxFillGrad2->GetSelectEntryColor().getBColor()); } else { |