Kaydet (Commit) 83055835 authored tarafından sushil_shinde's avatar sushil_shinde Kaydeden (comit) Markus Mohrhard

fdo#74112 Preserve Chart displayunits properties during ODF import/export.

Change-Id: I38508b71ee5b3b966e1d36b0d253304fe17c0ec0
Reviewed-on: https://gerrit.libreoffice.org/7721Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 7da3f43e
...@@ -98,7 +98,9 @@ enum ...@@ -98,7 +98,9 @@ enum
PROP_AXIS_CAN_OVERLAP, PROP_AXIS_CAN_OVERLAP,
PROP_AXIS_STACKEDTEXT, PROP_AXIS_STACKEDTEXT,
PROP_AXIS_OVERLAP, PROP_AXIS_OVERLAP,
PROP_AXIS_GAP_WIDTH PROP_AXIS_GAP_WIDTH,
PROP_AXIS_DISPLAY_UNITS,
PROP_AXIS_BUILTINUNIT
}; };
void lcl_AddPropertiesToVector( void lcl_AddPropertiesToVector(
...@@ -336,6 +338,22 @@ void lcl_AddPropertiesToVector( ...@@ -336,6 +338,22 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
//#i111967# no PropertyChangeEvent is fired on change so far //#i111967# no PropertyChangeEvent is fired on change so far
beans::PropertyAttribute::MAYBEDEFAULT )); 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 struct StaticAxisWrapperPropertyArray_Initializer
......
...@@ -76,7 +76,10 @@ enum ...@@ -76,7 +76,10 @@ enum
PROP_AXIS_MAJOR_TICKMARKS, PROP_AXIS_MAJOR_TICKMARKS,
PROP_AXIS_MINOR_TICKMARKS, PROP_AXIS_MINOR_TICKMARKS,
PROP_AXIS_MARK_POSITION PROP_AXIS_MARK_POSITION,
PROP_AXIS_DISPLAY_UNITS,
PROP_AXIS_BUILTINUNIT
}; };
void lcl_AddPropertiesToVector( void lcl_AddPropertiesToVector(
...@@ -180,6 +183,22 @@ void lcl_AddPropertiesToVector( ...@@ -180,6 +183,22 @@ void lcl_AddPropertiesToVector(
PROP_AXIS_MARK_POSITION, PROP_AXIS_MARK_POSITION,
::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisMarkPosition * >(0)), ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisMarkPosition * >(0)),
beans::PropertyAttribute::MAYBEDEFAULT )); 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 struct StaticAxisDefaults_Initializer
...@@ -214,6 +233,7 @@ private: ...@@ -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_MAJOR_TICKMARKS, 2 /* CHAXIS_MARK_OUTER */ );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AXIS_MINOR_TICKMARKS, 0 /* CHAXIS_MARK_NONE */ ); ::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_MARK_POSITION, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_UNITS, false );
} }
}; };
......
...@@ -3227,6 +3227,9 @@ namespace xmloff { namespace token { ...@@ -3227,6 +3227,9 @@ namespace xmloff { namespace token {
XML_CHART_DTABLE_SHOWHORZBORDER, XML_CHART_DTABLE_SHOWHORZBORDER,
XML_CHART_DTABLE_SHOWVERTBORDER, XML_CHART_DTABLE_SHOWVERTBORDER,
XML_CHART_DTABLE_SHOWOUTLINE, XML_CHART_DTABLE_SHOWOUTLINE,
// Chart Display units properties
XML_CHART_DUNITS_DISPLAYUNITS,
XML_CHART_DUNITS_BUILTINUNIT,
XML_EXTERNALDATA, XML_EXTERNALDATA,
XML_TOKEN_END XML_TOKEN_END
......
...@@ -122,6 +122,18 @@ service Axis ...@@ -122,6 +122,18 @@ service Axis
/** Determines where the interval marks are placed. /** Determines where the interval marks are placed.
*/ */
[optional, property] com::sun::star::chart::ChartAxisMarkPosition MarkPosition; [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 } ; // chart2
......
...@@ -137,6 +137,9 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = ...@@ -137,6 +137,9 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY_ODF12( "DataTableHBorder", CHART, XML_CHART_DTABLE_SHOWHORZBORDER, XML_TYPE_BOOL ), 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( "DataTableVBorder", CHART, XML_CHART_DTABLE_SHOWVERTBORDER, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "DataTableOutline", CHART, XML_CHART_DTABLE_SHOWOUTLINE, 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_ODF12( "ExternalData", CHART, XML_EXTERNALDATA, XML_TYPE_STRING),
MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ), MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ),
......
...@@ -3226,6 +3226,8 @@ namespace xmloff { namespace token { ...@@ -3226,6 +3226,8 @@ namespace xmloff { namespace token {
TOKEN( "data-table-show-horz-border", XML_CHART_DTABLE_SHOWHORZBORDER ), TOKEN( "data-table-show-horz-border", XML_CHART_DTABLE_SHOWHORZBORDER ),
TOKEN( "data-table-show-vert-border", XML_CHART_DTABLE_SHOWVERTBORDER ), TOKEN( "data-table-show-vert-border", XML_CHART_DTABLE_SHOWVERTBORDER ),
TOKEN( "data-table-show-outline", XML_CHART_DTABLE_SHOWOUTLINE ), 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), TOKEN( "external-data", XML_EXTERNALDATA),
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment