oox/source/export/chartexport.cxx |   29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

New commits:
commit 5b1a8f39ee58fe5372eea18ce1ee99c95b11ba05
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sat May 21 00:00:30 2022 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Jul 26 14:14:12 2022 +0200

    oox export: add export of basic properties of a data table
    
    Change-Id: I2c8b76125fc788a9e4df164171d6cbd351bc1c4a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137406
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 8a6d5fa7d298..988fe4413529 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1732,6 +1732,7 @@ void ChartExport::exportPlotArea(const Reference< 
css::chart::XChartDocument >&
     }
     //Axis Data
     exportAxes( );
+
     // Data Table
     exportDataTable();
 
@@ -2033,35 +2034,41 @@ void ChartExport::exportGradientFill( const Reference< 
XPropertySet >& xPropSet
 
 void ChartExport::exportDataTable( )
 {
+    auto xDataTable = mxNewDiagram->getDataTable();
+    if (!xDataTable.is())
+        return;
+
     FSHelperPtr pFS = GetFS();
-    Reference< beans::XPropertySet > aPropSet( mxDiagram, uno::UNO_QUERY );
+    uno::Reference<beans::XPropertySet> aPropSet(xDataTable, uno::UNO_QUERY);
 
     bool bShowVBorder = false;
     bool bShowHBorder = false;
     bool bShowOutline = false;
+    bool bShowKeys = false;
 
-    if (GetProperty( aPropSet, "DataTableHBorder"))
+    if (GetProperty(aPropSet, "HBorder"))
         mAny >>= bShowHBorder;
-    if (GetProperty( aPropSet, "DataTableVBorder"))
+    if (GetProperty(aPropSet, "VBorder"))
         mAny >>= bShowVBorder;
-    if (GetProperty( aPropSet, "DataTableOutline"))
+    if (GetProperty(aPropSet, "Outline"))
+        mAny >>= bShowOutline;
+    if (GetProperty(aPropSet, "Keys"))
         mAny >>= bShowOutline;
-
-    if (!(bShowVBorder || bShowHBorder || bShowOutline))
-        return;
 
     pFS->startElement(FSNS(XML_c, XML_dTable));
+
     if (bShowHBorder)
-        pFS->singleElement( FSNS( XML_c, XML_showHorzBorder ),
-                        XML_val, "1" );
+        pFS->singleElement(FSNS(XML_c, XML_showHorzBorder), XML_val, "1" );
     if (bShowVBorder)
         pFS->singleElement(FSNS(XML_c, XML_showVertBorder), XML_val, "1");
     if (bShowOutline)
         pFS->singleElement(FSNS(XML_c, XML_showOutline), XML_val, "1");
+    if (bShowKeys)
+        pFS->singleElement(FSNS(XML_c, XML_showKeys), XML_val, "1");
 
-    pFS->endElement(  FSNS( XML_c, XML_dTable));
-
+    pFS->endElement(FSNS(XML_c, XML_dTable));
 }
+
 void ChartExport::exportAreaChart( const Reference< chart2::XChartType >& 
xChartType )
 {
     FSHelperPtr pFS = GetFS();

Reply via email to