summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-16 02:55:08 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-16 02:56:04 +0100
commite6dbd5b03cf923fa505f8313fbae56f2d287be30 (patch)
treeccd5d5a42f58e9748cc6b62ff26d239992a4d498
parented043994a5e1405350f475add8879ff0715698ed (diff)
add tests for autoTitleDel flag default value fixes
Change-Id: I9860142f2da9c19f52f3a8a2be6ec851bdf81b6e
-rw-r--r--chart2/qa/extras/chart2import.cxx31
-rw-r--r--chart2/qa/extras/data/xlsx/autotitledel_2007.xlsxbin0 -> 10455 bytes
-rw-r--r--chart2/qa/extras/data/xlsx/autotitledel_2013.xlsxbin0 -> 13222 bytes
3 files changed, 31 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index c334713be22a..668c09b45d80 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -63,6 +63,11 @@ public:
void testTransparentBackground(OUString const & filename);
+ // below are OOXML default value tests for cases
+ // where we fixed the handling of MSO 2007 vs OOXML
+ void testAutoTitleDelDefaultValue2007XLSX();
+ void testAutoTitleDelDefaultValue2013XLSX();
+
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
CPPUNIT_TEST(testSteppedLines);
@@ -93,6 +98,8 @@ public:
CPPUNIT_TEST(testAxisTextRotationXLSX);
// CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled.
CPPUNIT_TEST(testNumberFormatsXLSX);
+ CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX);
+ CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -748,6 +755,30 @@ void Chart2ImportTest::testNumberFormatsXLSX()
CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource);
}
+void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
+ OUString aTitle = getTitleString(xTitled);
+ CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is false in MSO 2007 documents",
+ !aTitle.isEmpty());
+}
+
+void Chart2ImportTest::testAutoTitleDelDefaultValue2013XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "autotitledel_2013.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ Reference<chart2::XTitled> xTitled(xChartDoc, uno::UNO_QUERY_THROW);
+ uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
+ CPPUNIT_ASSERT_MESSAGE("autoTitleDel default value is true in the OOXML spec",
+ !xTitle.is());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx
new file mode 100644
index 000000000000..9ce71cf4e0c5
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/autotitledel_2007.xlsx
Binary files differ
diff --git a/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx
new file mode 100644
index 000000000000..a5070273a868
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/autotitledel_2013.xlsx
Binary files differ