diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-10-31 08:43:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-11-05 12:29:55 +0100 |
commit | 1351d5b97fd3e07c2bac1b7659726809bcb1c28d (patch) | |
tree | 3e0576c2d2a4e62e3fc36b75d9e8a92244f95dbf /chart2/qa/extras | |
parent | b0da1ca2d7a426ff13f39b21362fbcd5c0580c24 (diff) |
tdf#108104 OOXML Import: Fix Hatch fill in Charts
Sets an explicit fill hatch, or creates a named fill hatch
and stored in a global container. With this patch the
SUPPORTED MS Office hatch styles by LibreOffice, or the custom
LibreOffice hatches will be appeared correctly instead of the
previous display as horizontal lines in LibreOffice.
(The background color of the hatch styles are not imported correcty,
but that is another BUG.)
Change-Id: Ifda9dc805dd08f58db10b35f40d7f511a8614f77
Reviewed-on: https://gerrit.libreoffice.org/62681
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 24 | ||||
-rwxr-xr-x | chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx | bin | 0 -> 11555 bytes |
2 files changed, 24 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 590cd377c937..6076c63e3680 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -71,6 +71,7 @@ public: void testTdf106217(); void testAutoBackgroundXLSX(); void testChartAreaStyleBackgroundXLSX(); + void testChartHatchFillXLSX(); void testAxisTextRotationXLSX(); // void testTextCanOverlapXLSX(); // TODO : temporarily disabled. void testNumberFormatsXLSX(); @@ -144,6 +145,7 @@ public: CPPUNIT_TEST(testTdf106217); CPPUNIT_TEST(testAutoBackgroundXLSX); CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX); + CPPUNIT_TEST(testChartHatchFillXLSX); CPPUNIT_TEST(testAxisTextRotationXLSX); // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled. CPPUNIT_TEST(testNumberFormatsXLSX); @@ -896,6 +898,28 @@ void Chart2ImportTest::testChartAreaStyleBackgroundXLSX() sal_Int32(0), nColor); } +void Chart2ImportTest::testChartHatchFillXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "chart-hatch-fill.xlsx"); + uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground(); + CPPUNIT_ASSERT(xPropSet.is()); + drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Chart background fill in this xlsx should be loaded as hatch fill.", + drawing::FillStyle_HATCH, eStyle); + + uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); + CPPUNIT_ASSERT(xDataSeries.is()); + + uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(1), uno::UNO_QUERY_THROW); + OUString sHatchName; + xPropertySet->getPropertyValue("HatchName") >>= sHatchName; + CPPUNIT_ASSERT(!sHatchName.isEmpty()); +} + void Chart2ImportTest::testAxisTextRotationXLSX() { load("/chart2/qa/extras/data/xlsx/", "axis-label-rotation.xlsx"); diff --git a/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx Binary files differnew file mode 100755 index 000000000000..e15a46b144dd --- /dev/null +++ b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx |