diff options
author | sushil_shinde <sushil.shinde@synerzip.com> | 2014-01-29 14:31:19 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-11 23:23:40 +0000 |
commit | 83055835b1425b0a9d2fe5dce2f4db2d7a61919d (patch) | |
tree | 1116f8f96a7411d66792dcc7eeb23c470324f427 /chart2 | |
parent | 7da3f43e636112b30a15d29de2f419d4b82dcb38 (diff) |
fdo#74112 Preserve Chart displayunits properties during ODF import/export.
Change-Id: I38508b71ee5b3b966e1d36b0d253304fe17c0ec0
Reviewed-on: https://gerrit.libreoffice.org/7721
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/AxisWrapper.cxx | 20 | ||||
-rw-r--r-- | chart2/source/model/main/Axis.cxx | 22 |
2 files changed, 40 insertions, 2 deletions
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index 665ea5301656..fd44cce3b3e2 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx @@ -98,7 +98,9 @@ enum PROP_AXIS_CAN_OVERLAP, PROP_AXIS_STACKEDTEXT, PROP_AXIS_OVERLAP, - PROP_AXIS_GAP_WIDTH + PROP_AXIS_GAP_WIDTH, + PROP_AXIS_DISPLAY_UNITS, + PROP_AXIS_BUILTINUNIT }; void lcl_AddPropertiesToVector( @@ -336,6 +338,22 @@ void lcl_AddPropertiesToVector( ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), //#i111967# no PropertyChangeEvent is fired on change so far 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 StaticAxisWrapperPropertyArray_Initializer 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 ); } }; |