From 6f752061d5153da50d6f536d506358c8f512a397 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Fri, 8 May 2020 13:27:54 +0300 Subject: Related: tdf#131175 OOXML chart: import data label fill pattern Change-Id: I2db64489c86e4381167eb13af4ab5118113960d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93715 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- chart2/inc/unonames.hxx | 2 ++ .../controller/chartapiwrapper/DataSeriesPointWrapper.cxx | 15 ++++++++++++++- chart2/source/model/main/DataPointProperties.cxx | 12 ++++++++++++ chart2/source/model/main/DataPointProperties.hxx | 2 ++ chart2/source/view/main/PropertyMapper.cxx | 4 +++- 5 files changed, 33 insertions(+), 2 deletions(-) (limited to 'chart2') diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx index d7d56d61a001..2174f4abb1d7 100644 --- a/chart2/inc/unonames.hxx +++ b/chart2/inc/unonames.hxx @@ -28,6 +28,8 @@ #define CHART_UNONAME_LABEL_BORDER_DASHNAME "LabelBorderDashName" #define CHART_UNONAME_LABEL_BORDER_TRANS "LabelBorderTransparency" #define CHART_UNONAME_LABEL_FILL_STYLE "LabelFillStyle" +#define CHART_UNONAME_LABEL_FILL_BACKGROUND "LabelFillBackground" +#define CHART_UNONAME_LABEL_FILL_HATCH_NAME "LabelFillHatchName" #define CHART_UNONAME_LABEL_FILL_COLOR "LabelFillColor" #define CHART_UNONAME_CUSTOM_LABEL_FIELDS "CustomLabelFields" diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index f30e28115302..e98ebe65bbbd 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -84,7 +85,9 @@ enum PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR, PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS, PROP_SERIES_DATAPOINT_LABEL_FILL_STYLE, - PROP_SERIES_DATAPOINT_LABEL_FILL_COLOR + PROP_SERIES_DATAPOINT_LABEL_FILL_COLOR, + PROP_SERIES_DATAPOINT_LABEL_FILL_BACKGROUND, + PROP_SERIES_DATAPOINT_LABEL_FILL_HATCH_NAME }; void lcl_AddPropertiesToVector_PointProperties( @@ -170,6 +173,16 @@ void lcl_AddPropertiesToVector_PointProperties( | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_BACKGROUND, + PROP_SERIES_DATAPOINT_LABEL_FILL_BACKGROUND, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_HATCH_NAME, + PROP_SERIES_DATAPOINT_LABEL_FILL_HATCH_NAME, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); rOutProperties.emplace_back( CHART_UNONAME_LABEL_BORDER_WIDTH, PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH, cppu::UnoType::get(), diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index be665c606310..7bc20bbc30e6 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -396,6 +396,16 @@ void DataPointProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_BACKGROUND, + PROP_DATAPOINT_LABEL_FILL_BACKGROUND, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_HATCH_NAME, + PROP_DATAPOINT_LABEL_FILL_HATCH_NAME, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); rOutProperties.emplace_back( CHART_UNONAME_LABEL_BORDER_WIDTH, PROP_DATAPOINT_LABEL_BORDER_WIDTH, cppu::UnoType::get(), @@ -506,6 +516,8 @@ void DataPointProperties::AddDefaultsToMap( PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_COLOR); PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_STYLE); PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_COLOR); + PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_BACKGROUND); + PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_FILL_HATCH_NAME); PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_WIDTH, 0); PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_DASH, drawing::LineDash()); PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_DASH_NAME); diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx index 0482108b1e6b..1998c4e20369 100644 --- a/chart2/source/model/main/DataPointProperties.hxx +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -37,6 +37,8 @@ namespace DataPointProperties { PROP_DATAPOINT_LABEL_FILL_STYLE, PROP_DATAPOINT_LABEL_FILL_COLOR, + PROP_DATAPOINT_LABEL_FILL_BACKGROUND, + PROP_DATAPOINT_LABEL_FILL_HATCH_NAME, // common PROP_DATAPOINT_COLOR = FAST_PROPERTY_ID_START_DATA_POINT, diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 271c8e378535..c062eb2b451a 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -341,7 +341,9 @@ namespace { {"LineColor", CHART_UNONAME_LABEL_BORDER_COLOR}, {"LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS}, {"FillStyle", CHART_UNONAME_LABEL_FILL_STYLE}, - {"FillColor", CHART_UNONAME_LABEL_FILL_COLOR} + {"FillColor", CHART_UNONAME_LABEL_FILL_COLOR}, + {"FillBackground", CHART_UNONAME_LABEL_FILL_BACKGROUND}, + {"FillHatchName", CHART_UNONAME_LABEL_FILL_HATCH_NAME} }); // fix the spelling! return map; -- cgit