From 603df08a1e0211099ce2cf258cfe64a74ed6ded9 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Mon, 4 May 2020 11:48:51 +0300 Subject: tdf#131175 Import data label solid fill and color. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8a3ef6e60d4f2a13310bb9a8fc4eb873df3f9b4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93407 Tested-by: Jenkins Reviewed-by: Gülşah Köse --- chart2/inc/unonames.hxx | 2 ++ .../chartapiwrapper/DataSeriesPointWrapper.cxx | 18 +++++++++++++++++- chart2/source/model/main/DataPointProperties.cxx | 13 +++++++++++++ chart2/source/model/main/DataPointProperties.hxx | 3 +++ chart2/source/view/main/PropertyMapper.cxx | 5 ++++- 5 files changed, 39 insertions(+), 2 deletions(-) (limited to 'chart2') diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx index 8f4c855d3766..d7d56d61a001 100644 --- a/chart2/inc/unonames.hxx +++ b/chart2/inc/unonames.hxx @@ -27,6 +27,8 @@ #define CHART_UNONAME_LABEL_BORDER_DASH "LabelBorderDash" #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_COLOR "LabelFillColor" #define CHART_UNONAME_CUSTOM_LABEL_FIELDS "CustomLabelFields" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index a695076a4c13..f30e28115302 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -81,7 +82,9 @@ enum PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE, PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH, PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR, - PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS + PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS, + PROP_SERIES_DATAPOINT_LABEL_FILL_STYLE, + PROP_SERIES_DATAPOINT_LABEL_FILL_COLOR }; void lcl_AddPropertiesToVector_PointProperties( @@ -154,6 +157,19 @@ void lcl_AddPropertiesToVector_PointProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_STYLE, + PROP_SERIES_DATAPOINT_LABEL_FILL_STYLE, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); + + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_COLOR, + PROP_SERIES_DATAPOINT_LABEL_FILL_COLOR, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID + | 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 114fb4355069..be665c606310 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -385,6 +385,17 @@ void DataPointProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_STYLE, + PROP_DATAPOINT_LABEL_FILL_STYLE, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_COLOR, + PROP_DATAPOINT_LABEL_FILL_COLOR, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID + | beans::PropertyAttribute::MAYBEDEFAULT ); rOutProperties.emplace_back( CHART_UNONAME_LABEL_BORDER_WIDTH, PROP_DATAPOINT_LABEL_BORDER_WIDTH, cppu::UnoType::get(), @@ -493,6 +504,8 @@ void DataPointProperties::AddDefaultsToMap( PropertyHelper::setPropertyValueDefault< OUString >( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, " " ); PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, sal_Int32(drawing::LineStyle_NONE)); 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::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 d591f13625f3..259e7a8976eb 100644 --- a/chart2/source/model/main/DataPointProperties.hxx +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -35,6 +35,9 @@ namespace DataPointProperties // FastProperty Ids for properties enum { + PROP_DATAPOINT_LABEL_FILL_STYLE, + PROP_DATAPOINT_LABEL_FILL_COLOR, + // common PROP_DATAPOINT_COLOR = FAST_PROPERTY_ID_START_DATA_POINT, PROP_DATAPOINT_TRANSPARENCY, diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 2658e94ea78a..271c8e378535 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -339,7 +339,10 @@ namespace { {"LineStyle", CHART_UNONAME_LABEL_BORDER_STYLE}, {"LineWidth", CHART_UNONAME_LABEL_BORDER_WIDTH}, {"LineColor", CHART_UNONAME_LABEL_BORDER_COLOR}, - {"LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS}}); + {"LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS}, + {"FillStyle", CHART_UNONAME_LABEL_FILL_STYLE}, + {"FillColor", CHART_UNONAME_LABEL_FILL_COLOR} + }); // fix the spelling! return map; } -- cgit