From 83055835b1425b0a9d2fe5dce2f4db2d7a61919d Mon Sep 17 00:00:00 2001 From: sushil_shinde Date: Wed, 29 Jan 2014 14:31:19 +0530 Subject: fdo#74112 Preserve Chart displayunits properties during ODF import/export. Change-Id: I38508b71ee5b3b966e1d36b0d253304fe17c0ec0 Reviewed-on: https://gerrit.libreoffice.org/7721 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- chart2/source/model/main/Axis.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'chart2/source/model/main/Axis.cxx') diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index f8a3b90448f1..a94a7d750f38 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -76,7 +76,10 @@ enum PROP_AXIS_MAJOR_TICKMARKS, PROP_AXIS_MINOR_TICKMARKS, - PROP_AXIS_MARK_POSITION + PROP_AXIS_MARK_POSITION, + + PROP_AXIS_DISPLAY_UNITS, + PROP_AXIS_BUILTINUNIT }; void lcl_AddPropertiesToVector( @@ -180,6 +183,22 @@ void lcl_AddPropertiesToVector( PROP_AXIS_MARK_POSITION, ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisMarkPosition * >(0)), beans::PropertyAttribute::MAYBEDEFAULT )); + + //Properties for display units: + rOutProperties.push_back( + Property( "DisplayUnits", + PROP_AXIS_DISPLAY_UNITS, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + //Properties for labels: + rOutProperties.push_back( + Property( "BuiltInUnit", + PROP_AXIS_BUILTINUNIT, + ::getCppuType( reinterpret_cast< const OUString * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); } struct StaticAxisDefaults_Initializer @@ -214,6 +233,7 @@ private: ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_MARK_POSITION, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_UNITS, false ); } }; -- cgit v1.2.3