add test for fixed dispBlanksAs OOXML import

Change-Id: I096e235560c81ef4c55cf14ead3544b977916c20
This commit is contained in:
Markus Mohrhard
2015-03-16 06:12:55 +01:00
parent e6dbd5b03c
commit 18e557487b
3 changed files with 33 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/util/Color.hpp>
@@ -67,6 +68,8 @@ public:
// where we fixed the handling of MSO 2007 vs OOXML
void testAutoTitleDelDefaultValue2007XLSX();
void testAutoTitleDelDefaultValue2013XLSX();
void testDispBlanksAsDefaultValue2007XLSX();
void testDispBlanksAsDefaultValue2013XLSX();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -100,6 +103,8 @@ public:
CPPUNIT_TEST(testNumberFormatsXLSX);
CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX);
CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX);
CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX);
CPPUNIT_TEST(testDispBlanksAsDefaultValue2013XLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -779,6 +784,34 @@ void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX()
!xTitle.is());
}
void Chart2ImportTest::testDispBlanksAsDefaultValue2007XLSX()
{
load("/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2007.xlsx");
Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
CPPUNIT_ASSERT(xDiagram.is());
uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment");
sal_Int32 nMissingValueTreatment = -2;
CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment);
CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::LEAVE_GAP, nMissingValueTreatment);
}
void Chart2ImportTest::testDispBlanksAsDefaultValue2013XLSX()
{
load("/chart2/qa/extras/data/xlsx/", "dispBlanksAs_2013.xlsx");
Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
Reference<beans::XPropertySet> xDiagram(xChartDoc->getFirstDiagram(), UNO_QUERY);
CPPUNIT_ASSERT(xDiagram.is());
uno::Any aAny = xDiagram->getPropertyValue("MissingValueTreatment");
sal_Int32 nMissingValueTreatment = -2;
CPPUNIT_ASSERT(aAny >>= nMissingValueTreatment);
CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::USE_ZERO, nMissingValueTreatment);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();

Binary file not shown.

Binary file not shown.