[Libreoffice-commits] core.git: chart2/qa include/oox oox/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Nov 18 04:25:18 UTC 2018


 chart2/qa/extras/chart2import.cxx                |   20 ++++++++++++++++++++
 chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx |binary
 include/oox/drawingml/shapepropertymap.hxx       |    6 +++---
 oox/source/drawingml/chart/objectformatter.cxx   |    7 ++++---
 oox/source/drawingml/shapepropertymap.cxx        |    4 ++--
 5 files changed, 29 insertions(+), 8 deletions(-)

New commits:
commit dddcfa0089bc84965d7a2c94f5f738a325cfae78
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Thu Nov 8 09:25:18 2018 +0100
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Sun Nov 18 05:24:55 2018 +0100

    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 at googlemail.com>

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
Binary files a/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx and b/chart2/qa/extras/data/xlsx/chart-hatch-fill.xlsx 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


More information about the Libreoffice-commits mailing list