chart2/qa/extras/chart2import.cxx | 10 ++++++++++ oox/source/drawingml/fillproperties.cxx | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit 7502838f28e4dfca522a61ec7395dc64b8e350c6 Author: Justin Luth <[email protected]> AuthorDate: Wed Jan 27 10:46:05 2021 +0300 Commit: Xisco Fauli <[email protected]> CommitDate: Sun Mar 7 19:37:36 2021 +0100 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 <[email protected]> Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit 247963e53cce24c199a751c8ffb17f58b3a7d473) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111926 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112058 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 8fd7ca7a2277..3092e1ccaf92 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -846,6 +846,16 @@ void Chart2ImportTest::testBnc889755() CPPUNIT_ASSERT_EQUAL(OUString("Nov-13"), aRowLabels[13]); CPPUNIT_ASSERT_EQUAL(OUString("Dec-13"), aRowLabels[14]); CPPUNIT_ASSERT_EQUAL(OUString("Jan-14"), aRowLabels[15]); + + //tdf#139940 - the title's gradient was lost and was filled with solid blue, instead of a "blue underline". + uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW); + uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); + // Shape "Title 3" + uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(5), uno::UNO_QUERY_THROW); + awt::Gradient aTransparence; + xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; + CPPUNIT_ASSERT(aTransparence.StartColor != aTransparence.EndColor); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), aTransparence.StartColor); } void Chart2ImportTest::testBnc882383() diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index d62aa714da50..4bdcc8c5b724 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -530,6 +530,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()) @@ -544,7 +547,6 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, aWidestSegmentStart = it; } - auto aWidestSegmentEnd = std::next(aWidestSegmentStart); // Try to grow the widest segment forward: if a neext segment has the same // color, just different transparency, include it. while (aWidestSegmentEnd != std::prev(aGradientStops.end())) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
