summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-08-13 22:53:40 +0200
committerLászló Németh <nemeth@numbertext.org>2019-08-14 09:06:10 +0200
commite8c7f4cd5bd95b8112c1795ed11b7ac7caed00a2 (patch)
treed6026a472f3dcacd5d34061676e4e5b999686d5c
parenta1e65b1a4bb73dc5c2c72a70518abf521d42b4df (diff)
tdf#124243 fix import of deleted X axis of 3D charts
3D charts imported from ODF and DOCX showed the deleted X axis. Change-Id: I3316d08af3acd122e5f75fbf0031dda6a337edbd Reviewed-on: https://gerrit.libreoffice.org/77432 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
-rw-r--r--chart2/qa/extras/chart2import.cxx19
-rw-r--r--chart2/qa/extras/data/docx/tdf124243.docxbin0 -> 25872 bytes
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx4
3 files changed, 20 insertions, 3 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 90a1bd8485cf..116a0a93519f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -128,6 +128,7 @@ public:
void testTdf121205();
void testTdf114179();
+ void testTdf124243();
void testDeletedDataLabel();
void testDataPointInheritedColorDOCX();
void testExternalStrRefsXLSX();
@@ -215,6 +216,7 @@ public:
CPPUNIT_TEST(testTdf121205);
CPPUNIT_TEST(testTdf114179);
+ CPPUNIT_TEST(testTdf124243);
CPPUNIT_TEST(testDeletedDataLabel);
CPPUNIT_TEST(testDataPointInheritedColorDOCX);
CPPUNIT_TEST(testExternalStrRefsXLSX);
@@ -1908,6 +1910,23 @@ void Chart2ImportTest::testTdf114179()
CPPUNIT_ASSERT( aSize.Height > 0);
}
+void Chart2ImportTest::testTdf124243()
+{
+ load("/chart2/qa/extras/data/docx/", "tdf124243.docx");
+ uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+ Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+ CPPUNIT_ASSERT(xAxis.is());
+
+ Reference<beans::XPropertySet> xPS(xAxis, uno::UNO_QUERY_THROW);
+ bool bShow = true;
+ // test X Axis is not visible.
+ bool bSuccess = xPS->getPropertyValue("Show") >>= bShow;
+ CPPUNIT_ASSERT(bSuccess);
+ CPPUNIT_ASSERT(!bShow);
+}
+
namespace {
void checkDataLabelProperties(const Reference<chart2::XDataSeries>& xDataSeries, sal_Int32 nDataPointIndex, bool bValueVisible)
diff --git a/chart2/qa/extras/data/docx/tdf124243.docx b/chart2/qa/extras/data/docx/tdf124243.docx
new file mode 100644
index 000000000000..e58ef6a02e45
--- /dev/null
+++ b/chart2/qa/extras/data/docx/tdf124243.docx
Binary files differ
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index f55877609937..881fa4d274fb 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -391,9 +391,7 @@ void SchXMLAxisContext::CreateAxis()
break;
case SCH_XML_AXIS_Z:
if( m_aCurrentAxis.nAxisIndex == 0 )
- aPropName = "HasXAxis";
- else
- aPropName = "HasSecondaryXAxis";
+ aPropName = "HasZAxis";
break;
case SCH_XML_AXIS_UNDEF:
SAL_INFO("xmloff.chart", "Invalid axis" );