diff options
author | Justin Luth <justin.luth@collabora.com> | 2021-01-27 10:46:05 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2021-03-04 17:45:23 +0100 |
commit | 247963e53cce24c199a751c8ffb17f58b3a7d473 (patch) | |
tree | 478ef427534dafe9ad948148a228e266fd41a0d0 /oox | |
parent | c7e9164d7feac34d90f33841612350d2d02995d4 (diff) |
tdf#139940 oox: mark end before growing largest segment backwards
This fixes a regression in 7.1 (backported to 7.0.1) caused by
commit 73993fdb5d4b507694cd0edf80887d19f7e2bf9a for tdf#134183.
The largest segment has already been found, so we know where the
next segment starts. Now if we grow it backwards, that shouldn't
affect where it ends. So flag the end before growing the start,
otherwise we would have to recalculate the end again.
Change-Id: Iaae401d0438e533c7498be56f48fa153f7d3ff0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110004
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 754aa54ee2b8..3aa54ef36ea2 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -630,6 +630,9 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, aGradient.Angle = static_cast< sal_Int16 >( (8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 ); Color aStartColor, aEndColor; + // Make a note where the widest segment stops, because we will try to grow it next. + auto aWidestSegmentEnd = std::next(aWidestSegmentStart); + // Try to grow the widest segment backwards: if a previous segment has the same // color, just different transparency, include it. while (aWidestSegmentStart != aGradientStops.begin()) @@ -644,7 +647,6 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, aWidestSegmentStart = it; } - auto aWidestSegmentEnd = std::next(aWidestSegmentStart); // Try to grow the widest segment forward: if a next segment has the same // color, just different transparency, include it. while (aWidestSegmentEnd != std::prev(aGradientStops.end())) |