[Libreoffice-commits] core.git: chart2/qa chart2/source
Tünde Tóth (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 12 12:59:03 UTC 2020
chart2/qa/extras/chart2import.cxx | 16 ++++++++++++++++
chart2/qa/extras/data/xlsx/piechart_legend.xlsx |binary
chart2/source/view/charttypes/VSeriesPlotter.cxx | 4 +++-
3 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit d23aed9a1fbb6549ca3b8a3e2ab5d779c84e3fb5
Author: Tünde Tóth <toth.tunde at nisz.hu>
AuthorDate: Mon Nov 2 10:28:51 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Thu Nov 12 13:58:17 2020 +0100
tdf#137874 Chart OOXML import: fix pie chart legend entries
Pie chart legend changed when VaryColorsByPoint was false.
Change-Id: I8022e5290f2269a902b4417f91d2e454f088c553
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105172
Tested-by: Jenkins
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 62f9b85c1d76..883d50ca88d9 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -171,6 +171,7 @@ public:
void testTdf136752();
void testTdf137505();
void testTdf137734();
+ void testTdf137874();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -288,6 +289,7 @@ public:
CPPUNIT_TEST(testTdf136752);
CPPUNIT_TEST(testTdf137505);
CPPUNIT_TEST(testTdf137734);
+ CPPUNIT_TEST(testTdf137874);
CPPUNIT_TEST_SUITE_END();
@@ -2753,6 +2755,20 @@ void Chart2ImportTest::testTdf137734()
CPPUNIT_ASSERT_EQUAL(0.0, nRotation);
}
+void Chart2ImportTest::testTdf137874()
+{
+ load("/chart2/qa/extras/data/xlsx/", "piechart_legend.xlsx");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
+ UNO_QUERY_THROW);
+ Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
+ Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+ Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
+ Reference<drawing::XShape> xLegendEntry;
+ xLegendEntry
+ = getShapeByName(xShapes, "CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0");
+ CPPUNIT_ASSERT(xLegendEntry.is());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/piechart_legend.xlsx b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx
new file mode 100644
index 000000000000..baea1de9b0b9
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx differ
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index d40d52e7bc7a..b502efd83fe5 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2668,7 +2668,9 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
ViewLegendEntry aEntry;
OUString aLabelText;
bool bVaryColorsByPoint = rSeries.isVaryColorsByPoint();
- if( bVaryColorsByPoint )
+ if (bVaryColorsByPoint
+ || m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(
+ CHART2_SERVICE_NAME_CHARTTYPE_PIE))
{
Sequence< OUString > aCategoryNames;
if( m_pExplicitCategoriesProvider )
More information about the Libreoffice-commits
mailing list