summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/qa/extras/chart2export.cxx13
-rw-r--r--chart2/qa/extras/data/docx/testChartDataTable.docxbin0 -> 18084 bytes
-rw-r--r--include/oox/export/chartexport.hxx1
-rw-r--r--oox/source/export/chartexport.cxx39
4 files changed, 51 insertions, 2 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index dbc0a0d2c9fc..eee9161d8bbb 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -35,6 +35,7 @@ public:
void testStockChart();
void testBarChart();
void testCrosses();
+ void testChartDataTable();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -43,7 +44,7 @@ public:
CPPUNIT_TEST(testStockChart);
CPPUNIT_TEST(testBarChart);
CPPUNIT_TEST(testCrosses);
-
+ CPPUNIT_TEST(testChartDataTable);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -434,6 +435,16 @@ void Chart2ExportTest::testCrosses()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero");
}
+void Chart2ExportTest::testChartDataTable()
+{
+ load("/chart2/qa/extras/data/docx/", "testChartDataTable.docx");
+
+ xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", "1");
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline", "val", "1");
+}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
diff --git a/chart2/qa/extras/data/docx/testChartDataTable.docx b/chart2/qa/extras/data/docx/testChartDataTable.docx
new file mode 100644
index 000000000000..8663e8937ea9
--- /dev/null
+++ b/chart2/qa/extras/data/docx/testChartDataTable.docx
Binary files differ
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 1e6278ba4d82..a0f8d319468a 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -118,6 +118,7 @@ private:
void exportTitle( com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > xShape );
void exportPlotArea( );
+ void exportDataTable( );
void exportAreaChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
void exportBarChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 75752636da03..6a759d0b101c 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1080,11 +1080,48 @@ void ChartExport::exportPlotArea( )
exportShapeProps( xWallPropSet );
}
}
-
+ exportDataTable();
pFS->endElement( FSNS( XML_c, XML_plotArea ) );
}
+void ChartExport::exportDataTable( )
+{
+ FSHelperPtr pFS = GetFS();
+ Reference< beans::XPropertySet > aPropSet( mxDiagram, uno::UNO_QUERY );
+
+ sal_Bool bShowVBorder = sal_False;
+ sal_Bool bShowHBorder = sal_False;
+ sal_Bool bShowOutline = sal_False;
+
+ if (GetProperty( aPropSet, "DataTableHBorder"))
+ mAny >>= bShowHBorder;
+ if (GetProperty( aPropSet, "DataTableVBorder"))
+ mAny >>= bShowVBorder;
+ if (GetProperty( aPropSet, "DataTableOutline"))
+ mAny >>= bShowOutline;
+
+ if (bShowVBorder || bShowHBorder || bShowOutline)
+ {
+ pFS->startElement( FSNS( XML_c, XML_dTable),
+ FSEND );
+ if (bShowHBorder)
+ pFS->singleElement( FSNS( XML_c, XML_showHorzBorder ),
+ XML_val, "1",
+ FSEND );
+ if (bShowVBorder)
+ pFS->singleElement( FSNS( XML_c, XML_showVertBorder ),
+ XML_val, "1",
+ FSEND );
+ if (bShowOutline)
+ pFS->singleElement( FSNS( XML_c, XML_showOutline ),
+ XML_val, "1",
+ FSEND );
+
+ pFS->endElement( FSNS( XML_c, XML_dTable));
+ }
+
+}
void ChartExport::exportAreaChart( Reference< chart2::XChartType > xChartType )
{
FSHelperPtr pFS = GetFS();