summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/qa/extras/chart2import.cxx20
-rw-r--r--chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsxbin11555 -> 11579 bytes
-rw-r--r--include/oox/drawingml/shapepropertymap.hxx6
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx7
-rw-r--r--oox/source/drawingml/shapepropertymap.cxx4
5 files changed, 29 insertions, 8 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
diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx
index bace1978d78a..edbae76f0d6c 100644
--- a/include/oox/drawingml/shapepropertymap.hxx
+++ b/include/oox/drawingml/shapepropertymap.hxx
@@ -72,10 +72,10 @@ enum class ShapeProperty
FillBitmapOffsetY,
FillBitmapRectanglePoint,
FillHatch, /// Explicit fill hatch or name of a fill hatch stored in a global container.
- ShadowXDistance,
- FillBitmapName,
FillBackground,
- LAST = FillBackground
+ FillBitmapName,
+ ShadowXDistance,
+ LAST = ShadowXDistance
};
typedef o3tl::enumarray<ShapeProperty, sal_Int32> ShapePropertyIds;
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index a513fdb435a5..184cb111f02f 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -450,7 +450,7 @@ static const ShapePropertyIds spnCommonPropIds =
PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_INVALID, PROP_FillGradientName,
PROP_FillBitmapName, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY,
PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint,
- PROP_FillHatchName
+ PROP_FillHatchName, PROP_FillBackground
};
static const ShapePropertyIds spnLinearPropIds =
@@ -460,7 +460,7 @@ static const ShapePropertyIds spnLinearPropIds =
PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID,
PROP_INVALID, PROP_INVALID, PROP_INVALID,
- PROP_INVALID
+ PROP_INVALID, PROP_INVALID
};
static const ShapePropertyIds spnFilledPropIds =
@@ -489,7 +489,8 @@ static const ShapePropertyIds spnFilledPropIds =
PROP_FillBitmapPositionOffsetX,
PROP_FillBitmapPositionOffsetY,
PROP_FillBitmapRectanglePoint,
- PROP_HatchName
+ PROP_HatchName,
+ PROP_FillBackground
};
/** Property info for common chart objects, to be used in ShapePropertyMap. */
diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx
index b072403d4142..5e34fff6cc73 100644
--- a/oox/source/drawingml/shapepropertymap.cxx
+++ b/oox/source/drawingml/shapepropertymap.cxx
@@ -47,9 +47,9 @@ static const ShapePropertyIds spnDefaultShapeIds =
PROP_FillBitmap, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY,
PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint,
PROP_FillHatch,
- PROP_ShadowXDistance,
+ PROP_FillBackground,
PROP_FillBitmapName,
- PROP_FillBackground
+ PROP_ShadowXDistance
};
} // namespace