diff options
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 13 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx | bin | 0 -> 8424 bytes | |||
-rw-r--r-- | oox/source/drawingml/chart/chartspaceconverter.cxx | 5 |
3 files changed, 17 insertions, 1 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 Binary files differnew file mode 100644 index 000000000000..a20aa0bb1bf7 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf119138-missing-autotitledeleted.xlsx diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index ade046ef08e8..9ea5d8a6c97f 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -176,7 +176,10 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern } // chart title - if( !mrModel.mbAutoTitleDel ) try + /* tdf#119138 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 */ + if( !mrModel.mbAutoTitleDel || mrModel.mxTitle.is() ) try { /* If the title model is missing, but the chart shows exactly one series, the series title is shown as chart title. */ |