summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-12 02:01:27 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-12 20:04:47 +0200
commit9ec0633e3179cbe3c50260d0ba46826264ef5f68 (patch)
tree454459285ef8caa5117c2a2630542e70d42ecffa /oox
parentcafbd676785b5238f584982654c279f29d2393e0 (diff)
use chart2 API for attached axis export
Change-Id: Ide1a30307711e3857d83b691c95d984439359005
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx32
1 files changed, 24 insertions, 8 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 6af00926d452..a5257b683ab5 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -117,6 +117,22 @@ namespace cssc = css::chart;
namespace oox { namespace drawingml {
+namespace {
+
+sal_Int32 translateFromChart2AxisIndexToOox(sal_Int32 nIndex)
+{
+ assert(nIndex == 0 || nIndex == 1);
+ if (nIndex == 0)
+ return AXIS_PRIMARY_Y;
+ else if (nIndex == 1)
+ return AXIS_SECONDARY_Y;
+
+ // good default value for release builds
+ return AXIS_PRIMARY_Y;
+}
+
+}
+
class lcl_MatchesRole : public ::std::unary_function< Reference< chart2::data::XLabeledDataSequence >, bool >
{
public:
@@ -2032,19 +2048,19 @@ void ChartExport::exportSeries( Reference<chart2::XChartType> xChartType,
if( xLabelSeq.is() )
exportSeriesText( xLabelSeq );
+ Reference<XPropertySet> xPropSet(xDataSeries, UNO_QUERY_THROW);
+ if( GetProperty( xPropSet, "AttachedAxisIndex") )
+ {
+ sal_Int32 nLocalAttachedAxis;
+ mAny >>= nLocalAttachedAxis;
+ nAttachedAxis = translateFromChart2AxisIndexToOox(nLocalAttachedAxis);
+ }
+
// export shape properties
Reference< XPropertySet > xOldPropSet = SchXMLSeriesHelper::createOldAPISeriesPropertySet(
rSeriesSeq[nSeriesIdx], getModel() );
if( xOldPropSet.is() )
{
- if( GetProperty( xOldPropSet, "Axis") )
- {
- mAny >>= nAttachedAxis;
- if( nAttachedAxis == css::chart::ChartAxisAssign::SECONDARY_Y )
- nAttachedAxis = AXIS_SECONDARY_Y;
- else
- nAttachedAxis = AXIS_PRIMARY_Y;
- }
exportShapeProps( xOldPropSet );
}