summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-08-07 11:36:46 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-08-07 14:21:59 -0400
commited39df130c6319409eb78eb5e9f03a070120c9d8 (patch)
treebce3d7753adafbecbcc70e082a6681a204212ec6 /oox
parent96f890c63848db2975585a3fb5ae30e397c6add8 (diff)
Doughnut charts don't support label placement option. Don't export it.
Change-Id: I6d0e2c099869120bdf594813468a3c5ba4bb46fd
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 66df939d8241..389485e234f3 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2615,9 +2615,24 @@ void ChartExport::exportDataLabels(
uno::Sequence<sal_Int32> aAttrLabelIndices;
xPropSet->getPropertyValue("AttributedDataPoints") >>= aAttrLabelIndices;
+ // We must not export label placement property when the chart type doesn't
+ // support this option in MS Office, else MS Office would think the file
+ // is corrupt & refuse to open it.
bool bLabelPlacement = !mbIs3DChart;
- if (eChartType == chart::TYPEID_PIE)
- bLabelPlacement = true;
+ eChartType = getChartType();
+ switch (eChartType)
+ {
+ case chart::TYPEID_PIE:
+ // All pie charts support label placement.
+ bLabelPlacement = true;
+ break;
+ case chart::TYPEID_DOUGHNUT:
+ // Doughnut charts don't support label placement.
+ bLabelPlacement = false;
+ break;
+ default:
+ ;
+ }
const sal_Int32* p = aAttrLabelIndices.getConstArray();
const sal_Int32* pEnd = p + aAttrLabelIndices.getLength();