summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorGabor Kelemen <kelemen.gabor2@nisz.hu>2020-02-06 23:54:26 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-13 09:54:40 +0100
commit176e06c116db09cae5781522461390da87632953 (patch)
tree5095b3d892dd63f2a6f1eda6435cf97f67925444 /chart2
parentdcf6fd8bb66cddbd54ec3f019ea606d2c99d9e08 (diff)
tdf#119138 Show custom chart title if autoTitleDeleted is missing
autoTitleDeleted might be omitted by generators other than Excel while providing custom title. mbAutoTitleDel is set only based on the attribute value and the default also varies on whether MSO 2007 or newer is the generator, see tdf#78080 ECMA-376 Part 1 at 21.2.2.7 says: A value of 1 or true specifies that the property is applied. This is the default value for this attribute, and is implied when the parent element is present, but this attribute is omitted. Change-Id: If3457fe850e13ae8af207bb9beceecc9e887b797 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88151 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx13
-rw-r--r--chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsxbin0 -> 8424 bytes
2 files changed, 13 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 054b04209db2..93be02e70160 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -154,6 +154,7 @@ public:
void testTdf125444PercentageCustomLabel();
void testDataPointLabelCustomPos();
void testTdf130032();
+ void testTdf119138MissingAutoTitleDeleted();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -256,6 +257,7 @@ public:
CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
CPPUNIT_TEST(testDataPointLabelCustomPos);
CPPUNIT_TEST(testTdf130032);
+ CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
CPPUNIT_TEST_SUITE_END();
@@ -2397,6 +2399,17 @@ void Chart2ImportTest::testTdf130032()
CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement);
}
+void Chart2ImportTest::testTdf119138MissingAutoTitleDeleted()
+{
+ load("/chart2/qa/extras/data/xlsx/", "tdf119138-missing-autotitledeleted.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("Missing autoTitleDeleted is implied to be True if title text is present", xTitle.is());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx b/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx
new file mode 100644
index 000000000000..a20aa0bb1bf7
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx
Binary files differ