chart2/source/controller/chartapiwrapper/AxisWrapper.cxx | 20 ++++++++++++- chart2/source/model/main/Axis.cxx | 22 ++++++++++++++- include/xmloff/xmltoken.hxx | 3 ++ offapi/com/sun/star/chart2/Axis.idl | 12 ++++++++ xmloff/source/chart/PropertyMap.hxx | 3 ++ xmloff/source/core/xmltoken.cxx | 2 + 6 files changed, 60 insertions(+), 2 deletions(-)
New commits: commit 83055835b1425b0a9d2fe5dce2f4db2d7a61919d Author: sushil_shinde <sushil.shi...@synerzip.com> Date: Wed Jan 29 14:31:19 2014 +0530 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.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index 665ea53..fd44cce 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 f8a3b90..a94a7d7 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 ); } }; diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 16ddf69..225e374 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -3227,6 +3227,9 @@ namespace xmloff { namespace token { XML_CHART_DTABLE_SHOWHORZBORDER, XML_CHART_DTABLE_SHOWVERTBORDER, XML_CHART_DTABLE_SHOWOUTLINE, + // Chart Display units properties + XML_CHART_DUNITS_DISPLAYUNITS, + XML_CHART_DUNITS_BUILTINUNIT, XML_EXTERNALDATA, XML_TOKEN_END diff --git a/offapi/com/sun/star/chart2/Axis.idl b/offapi/com/sun/star/chart2/Axis.idl index b2fe0b7..c27bf8a 100644 --- a/offapi/com/sun/star/chart2/Axis.idl +++ b/offapi/com/sun/star/chart2/Axis.idl @@ -122,6 +122,18 @@ service Axis /** Determines where the interval marks are placed. */ [optional, property] com::sun::star::chart::ChartAxisMarkPosition MarkPosition; + + /** Determines display units are avaiblable for axis + + @since LibreOffice 4.3 + */ + [optional, property] boolean DisplayUnits; + + /** Determintes built in display unit value for axis + + @since LibreOffice 4.3 + */ + [optional, property] string BuiltInUnit; }; } ; // chart2 diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 89f990a..8bd4b24 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -137,6 +137,9 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = MAP_ENTRY_ODF12( "DataTableHBorder", CHART, XML_CHART_DTABLE_SHOWHORZBORDER, XML_TYPE_BOOL ), MAP_ENTRY_ODF12( "DataTableVBorder", CHART, XML_CHART_DTABLE_SHOWVERTBORDER, XML_TYPE_BOOL ), MAP_ENTRY_ODF12( "DataTableOutline", CHART, XML_CHART_DTABLE_SHOWOUTLINE, XML_TYPE_BOOL ), + // Chart display units flags + MAP_ENTRY_ODF_EXT( "DisplayUnits", LO_EXT, XML_CHART_DUNITS_DISPLAYUNITS, XML_TYPE_BOOL ), + MAP_ENTRY_ODF_EXT( "BuiltInUnit", LO_EXT, XML_CHART_DUNITS_BUILTINUNIT, XML_TYPE_STRING ), MAP_ENTRY_ODF12( "ExternalData", CHART, XML_EXTERNALDATA, XML_TYPE_STRING), MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ), diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 8ff43ec..1e35261 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3226,6 +3226,8 @@ namespace xmloff { namespace token { TOKEN( "data-table-show-horz-border", XML_CHART_DTABLE_SHOWHORZBORDER ), TOKEN( "data-table-show-vert-border", XML_CHART_DTABLE_SHOWVERTBORDER ), TOKEN( "data-table-show-outline", XML_CHART_DTABLE_SHOWOUTLINE ), + TOKEN( "display-units", XML_CHART_DUNITS_DISPLAYUNITS ), + TOKEN( "display-units-built-in-unit", XML_CHART_DUNITS_BUILTINUNIT ), TOKEN( "external-data", XML_EXTERNALDATA), #if OSL_DEBUG_LEVEL > 0 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits