summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-12-21 23:43:21 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-12-22 09:01:28 +0100
commitdd55a4e8cd652665848b76b29dd5f98efc752ba1 (patch)
tree35145afe0e185a3965e561f9406163fee7949f22 /oox
parent1d2eb0b64339a771152bb17831c83373830e5c38 (diff)
also export basic chart structure for empty charts
Change-Id: I545be33e5e093d5bd3fda4236213a413a6cc9ce7 Reviewed-on: https://gerrit.libreoffice.org/46939 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx64
1 files changed, 38 insertions, 26 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 598b9e302a4a..f0d639a497a3 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1628,43 +1628,55 @@ void ChartExport::exportRadarChart( const Reference< chart2::XChartType >& xChar
pFS->endElement( FSNS( XML_c, XML_radarChart ) );
}
+void ChartExport::exportScatterChartSeries( const Reference< chart2::XChartType >& xChartType,
+ css::uno::Sequence<css::uno::Reference<chart2::XDataSeries>>* pSeries)
+{
+ FSHelperPtr pFS = GetFS();
+ pFS->startElement( FSNS( XML_c, XML_scatterChart ),
+ FSEND );
+ // TODO:scatterStyle
+
+ sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
+ Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
+ if( GetProperty( xPropSet, "SymbolType" ) )
+ mAny >>= nSymbolType;
+
+ const char* scatterStyle = "lineMarker";
+ if (nSymbolType == css::chart::ChartSymbolType::NONE)
+ {
+ scatterStyle = "line";
+ }
+
+ pFS->singleElement( FSNS( XML_c, XML_scatterStyle ),
+ XML_val, scatterStyle,
+ FSEND );
+
+ exportVaryColors(xChartType);
+ // FIXME: should export xVal and yVal
+ bool bPrimaryAxes = true;
+ if (pSeries)
+ exportSeries(xChartType, *pSeries, bPrimaryAxes);
+ exportAxesId(bPrimaryAxes);
+
+ pFS->endElement( FSNS( XML_c, XML_scatterChart ) );
+}
+
void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xChartType )
{
FSHelperPtr pFS = GetFS();
std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
+ bool bExported = false;
for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
itr != itrEnd; ++itr)
{
if (itr->getLength() == 0)
continue;
- pFS->startElement( FSNS( XML_c, XML_scatterChart ),
- FSEND );
- // TODO:scatterStyle
-
- sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
- Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY);
- if( GetProperty( xPropSet, "SymbolType" ) )
- mAny >>= nSymbolType;
-
- const char* scatterStyle = "lineMarker";
- if (nSymbolType == css::chart::ChartSymbolType::NONE)
- {
- scatterStyle = "line";
- }
-
- pFS->singleElement( FSNS( XML_c, XML_scatterStyle ),
- XML_val, scatterStyle,
- FSEND );
-
- exportVaryColors(xChartType);
- // FIXME: should export xVal and yVal
- bool bPrimaryAxes = true;
- exportSeries(xChartType, *itr, bPrimaryAxes);
- exportAxesId(bPrimaryAxes);
-
- pFS->endElement( FSNS( XML_c, XML_scatterChart ) );
+ bExported = true;
+ exportScatterChartSeries(xChartType, &(*itr));
}
+ if (!bExported)
+ exportScatterChartSeries(xChartType, nullptr);
}
void ChartExport::exportStockChart( const Reference< chart2::XChartType >& xChartType )