diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 11:36:46 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-08-07 14:21:59 -0400 |
commit | ed39df130c6319409eb78eb5e9f03a070120c9d8 (patch) | |
tree | bce3d7753adafbecbcc70e082a6681a204212ec6 /oox/source | |
parent | 96f890c63848db2975585a3fb5ae30e397c6add8 (diff) |
Doughnut charts don't support label placement option. Don't export it.
Change-Id: I6d0e2c099869120bdf594813468a3c5ba4bb46fd
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/export/chartexport.cxx | 19 |
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(); |