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

Muthu Subramanian muthu.subramanian.karunanidhi at ericsson.com
Fri Oct 10 06:41:14 PDT 2014


 chart2/qa/extras/chart2import.cxx              |   11 +++++++++--
 chart2/qa/extras/data/xlsx/fdo54361-1.xlsx     |binary
 oox/source/drawingml/chart/objectformatter.cxx |   17 ++++++++++-------
 3 files changed, 19 insertions(+), 9 deletions(-)

New commits:
commit e60183503e0cefd567f20b300d674fcbd75f1fb5
Author: Muthu Subramanian <muthu.subramanian.karunanidhi at ericsson.com>
Date:   Fri Oct 10 19:01:03 2014 +0530

    fdo#54361: Add additional unit test case.
    
    Change-Id: Ifa3fd6f074d1957a468a1dad5dc2c223d38d24d4

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 302d2b5..f8c545a 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -55,6 +55,8 @@ public:
     void testAutoBackgroundXLSX();
     void testNumberFormatsXLSX();
 
+    void testTransparentBackground(OUString filename);
+
     CPPUNIT_TEST_SUITE(Chart2ImportTest);
     CPPUNIT_TEST(Fdo60083);
     CPPUNIT_TEST(testSteppedLines);
@@ -593,9 +595,9 @@ void Chart2ImportTest::testFdo78080()
     CPPUNIT_ASSERT(!xTitle.is());
 }
 
-void Chart2ImportTest::testFdo54361()
+void Chart2ImportTest::testTransparentBackground(OUString filename)
 {
-    load("/chart2/qa/extras/data/xlsx/", "fdo54361.xlsx");
+    load("/chart2/qa/extras/data/xlsx/", filename);
     uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet(0, mxComponent);
     CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
 
@@ -610,6 +612,11 @@ void Chart2ImportTest::testFdo54361()
 
     CPPUNIT_ASSERT_MESSAGE("Background needs to be with solid fill style", aStyle == 1);
 }
+void Chart2ImportTest::testFdo54361()
+{
+    testTransparentBackground("fdo54361.xlsx");
+    testTransparentBackground("fdo54361-1.xlsx");
+}
 
 void Chart2ImportTest::testAutoBackgroundXLSX()
 {
diff --git a/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx b/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx
new file mode 100644
index 0000000..dba79ef
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/fdo54361-1.xlsx differ
commit aad90e18cd00ac8af6bcddf14e4e19c9475dedbf
Author: Muthu Subramanian <muthu.subramanian.karunanidhi at ericsson.com>
Date:   Fri Oct 10 18:59:46 2014 +0530

    fdo#54361: Chart background in XLSX is transparent instead of white.
    
    Change-Id: I116e7e8c9046009cfcadc04b5367a6fe25f88d96

diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index d0ab4c0..dd53dde 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -623,7 +623,8 @@ class FillFormatter : public DetailFormatterBase
 public:
     explicit            FillFormatter(
                             ObjectFormatterData& rData,
-                            const AutoFormatEntry* pAutoFormatEntry );
+                            const AutoFormatEntry* pAutoFormatEntry,
+                            const ObjectType eObjType );
 
     /** Converts area formatting to the passed property set. */
     void                convertFormatting(
@@ -678,7 +679,8 @@ public:
     explicit            ObjectTypeFormatter(
                             ObjectFormatterData& rData,
                             const ObjectTypeFormatEntry& rEntry,
-                            const ChartSpaceModel& rChartSpace );
+                            const ChartSpaceModel& rChartSpace,
+                            const ObjectType eObjType );
 
     /** Sets frame formatting properties to the passed property set. */
     void                convertFrameFormatting(
@@ -854,13 +856,14 @@ void LineFormatter::convertFormatting( ShapePropertyMap& rPropMap, const ModelRe
     aLineProps.pushToPropMap( rPropMap, mrData.mrFilter.getGraphicHelper(), getPhColor( nSeriesIdx ) );
 }
 
-FillFormatter::FillFormatter( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry ) :
+FillFormatter::FillFormatter( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry, const ObjectType eObjType ) :
     DetailFormatterBase( rData, pAutoFormatEntry )
 {
     if( pAutoFormatEntry )
     {
         mxAutoFill.reset( new FillProperties );
-        mxAutoFill->moFillType = XML_noFill;
+        if( eObjType != OBJECTTYPE_CHARTSPACE )
+            mxAutoFill->moFillType = XML_noFill;
         if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() )
             if( const FillProperties* pFillProps = pTheme->getFillStyle( pAutoFormatEntry->mnThemedIdx ) )
                 *mxAutoFill = *pFillProps;
@@ -937,9 +940,9 @@ void TextFormatter::convertFormatting( PropertySet& rPropSet, const ModelRef< Te
     convertFormatting( rPropSet, lclGetTextProperties( rxTextProp ) );
 }
 
-ObjectTypeFormatter::ObjectTypeFormatter( ObjectFormatterData& rData, const ObjectTypeFormatEntry& rEntry, const ChartSpaceModel& rChartSpace ) :
+ObjectTypeFormatter::ObjectTypeFormatter( ObjectFormatterData& rData, const ObjectTypeFormatEntry& rEntry, const ChartSpaceModel& rChartSpace, const ObjectType eObjType ) :
     maLineFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoLines,   rChartSpace.mnStyle ) ),
-    maFillFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoFills,   rChartSpace.mnStyle ) ),
+    maFillFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoFills,   rChartSpace.mnStyle ), eObjType ),
     maEffectFormatter( rData, lclGetAutoFormatEntry( rEntry.mpAutoEffects, rChartSpace.mnStyle ) ),
     maTextFormatter(   rData, lclGetAutoTextEntry(   rEntry.mpAutoTexts,   rChartSpace.mnStyle ), rChartSpace.mxTextProp ),
     mrModelObjHelper( rData.maModelObjHelper ),
@@ -990,7 +993,7 @@ ObjectFormatterData::ObjectFormatterData( const XmlFilterBase& rFilter, const Re
 {
     const ObjectTypeFormatEntry* pEntryEnd = STATIC_ARRAY_END( spObjTypeFormatEntries );
     for( const ObjectTypeFormatEntry* pEntry = spObjTypeFormatEntries; pEntry != pEntryEnd; ++pEntry )
-        maTypeFormatters[ pEntry->meObjType ].reset( new ObjectTypeFormatter( *this, *pEntry, rChartSpace ) );
+        maTypeFormatters[ pEntry->meObjType ].reset( new ObjectTypeFormatter( *this, *pEntry, rChartSpace, pEntry->meObjType ) );
 
     try
     {


More information about the Libreoffice-commits mailing list