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 /svx/source/sidebar | |
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 'svx/source/sidebar')
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 13 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index b84f5a45244e..582d4536d981 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -491,8 +491,7 @@ void AreaPropertyPanelBase::FillStyleChanged(bool bUpdateModel) // MCGR: preserve ColorStops if given // tdf#155901 We need offset of first and last stop, so include them. if (aGradient.GetColorStops().size() >= 2) - maColorStops = basegfx::BColorStops(aGradient.GetColorStops().begin(), - aGradient.GetColorStops().end()); + maColorStops = aGradient.GetColorStops(); else maColorStops.clear(); @@ -1375,11 +1374,11 @@ basegfx::BColorStops AreaPropertyPanelBase::createColorStops() if (maColorStops.size() >= 2) { - aColorStops.emplace_back(maColorStops.front().getStopOffset(), - mxLbFillGradFrom->GetSelectEntryColor().getBColor()); - aColorStops.insert(aColorStops.begin(), maColorStops.begin() + 1, maColorStops.end() - 1); - aColorStops.emplace_back(maColorStops.back().getStopOffset(), - mxLbFillGradTo->GetSelectEntryColor().getBColor()); + aColorStops = maColorStops; + aColorStops.front() = basegfx::BColorStop(maColorStops.front().getStopOffset(), + mxLbFillGradFrom->GetSelectEntryColor().getBColor()); + aColorStops.back() = basegfx::BColorStop(maColorStops.back().getStopOffset(), + mxLbFillGradTo->GetSelectEntryColor().getBColor()); } else { diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx index 6a717551e456..680cf2cfc4ee 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx @@ -87,8 +87,7 @@ void AreaTransparencyGradientPopup::InitStatus(XFillFloatTransparenceItem const // MCGR: preserve ColorStops if given // tdf#155901 We need offset of first and last stop, so include them. if (aGradient.GetColorStops().size() >= 2) - maColorStops = basegfx::BColorStops(aGradient.GetColorStops().begin(), - aGradient.GetColorStops().end()); + maColorStops = aGradient.GetColorStops(); else maColorStops.clear(); @@ -142,9 +141,9 @@ void AreaTransparencyGradientPopup::ExecuteValueModify() if (maColorStops.size() >= 2) { - aColorStops.emplace_back(maColorStops.front().getStopOffset(), aStartBColor); - aColorStops.insert(aColorStops.begin(), maColorStops.begin() + 1, maColorStops.end() - 1); - aColorStops.emplace_back(maColorStops.back().getStopOffset(), aEndBColor); + aColorStops = maColorStops; + aColorStops.front() = basegfx::BColorStop(maColorStops.front().getStopOffset(), aStartBColor); + aColorStops.back() = basegfx::BColorStop(maColorStops.back().getStopOffset(), aEndBColor); } else { |