summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2018-11-08 09:25:18 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-11-18 05:24:55 +0100
commitdddcfa0089bc84965d7a2c94f5f738a325cfae78 (patch)
tree28909b95b3fa1c64270259b4897668eb5b7a82fb /chart2
parent1baf55c0ab7cc003225fd9adcaf702a511db575a (diff)
tdf#94231 OOXML Import: Fix disappeared Hatch Background Color
With adding the PROP_FillBackground property to spnCommonPropIds and spnFilledPropIds the hatch background color imported correctly, an will not disappear. Change-Id: I56745179236d2912a2d5c8585098e54acc4e3062 Reviewed-on: https://gerrit.libreoffice.org/63069 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx20
-rw-r--r--chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsxbin11555 -> 11579 bytes
2 files changed, 20 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index f9d5343c0317..c85bcc67c06a 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -912,6 +912,7 @@ void Chart2ImportTest::testChartHatchFillXLSX()
uno::Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ // Check the chart background FillStyle is HATCH
Reference<beans::XPropertySet> xPropSet = xChartDoc->getPageBackground();
CPPUNIT_ASSERT(xPropSet.is());
drawing::FillStyle eStyle = xPropSet->getPropertyValue("FillStyle").get<drawing::FillStyle>();
@@ -919,6 +920,16 @@ void Chart2ImportTest::testChartHatchFillXLSX()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Chart background fill in this xlsx should be loaded as hatch fill.",
drawing::FillStyle_HATCH, eStyle);
+ // Check the FillBackground of chart background
+ bool bBackgroundFill = false;
+ xPropSet->getPropertyValue("FillBackground") >>= bBackgroundFill;
+ CPPUNIT_ASSERT(bBackgroundFill);
+
+ sal_Int32 nBackgroundColor;
+ xPropSet->getPropertyValue("FillColor") >>= nBackgroundColor;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xFFFFFF), nBackgroundColor);
+
+ // Check the datapoint has HatchName value
uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
CPPUNIT_ASSERT(xDataSeries.is());
@@ -926,6 +937,15 @@ void Chart2ImportTest::testChartHatchFillXLSX()
OUString sHatchName;
xPropertySet->getPropertyValue("HatchName") >>= sHatchName;
CPPUNIT_ASSERT(!sHatchName.isEmpty());
+
+ // Check the FillBackground of datapoint
+ bool bBackgroundFillofDatapoint = false;
+ xPropertySet->getPropertyValue("FillBackground") >>= bBackgroundFillofDatapoint;
+ CPPUNIT_ASSERT(bBackgroundFillofDatapoint);
+
+ sal_Int32 nBackgroundColorofDatapoint;
+ xPropertySet->getPropertyValue("FillColor") >>= nBackgroundColorofDatapoint;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00B050), nBackgroundColorofDatapoint);
}
void Chart2ImportTest::testAxisTextRotationXLSX()
diff --git a/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx
index e15a46b144dd..4e3394c8efdf 100644
--- a/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx
+++ b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx
Binary files differ