summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-05-04 11:48:51 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-07-15 12:05:51 +0200
commite6dc487a24a4e65794707276e7ca5f9a2ffba191 (patch)
treec450af3e61010e219481b33a8a4078e1d5175f35 /chart2
parent9afcab2a2169041f65ae6281aa8992594dda9866 (diff)
tdf#131175 Import data label solid fill and color.
(cherry picked from commit 603df08a1e0211099ce2cf258cfe64a74ed6ded9) Conflicts: oox/source/drawingml/chart/seriesconverter.cxx Change-Id: I8a3ef6e60d4f2a13310bb9a8fc4eb873df3f9b4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98807 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/inc/unonames.hxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx18
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx13
-rw-r--r--chart2/source/model/main/DataPointProperties.hxx3
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx5
5 files changed, 39 insertions, 2 deletions
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index ba8011431809..9bbbf9a27171 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -28,6 +28,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"
#endif
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index e632e8fb5db1..bebd947acbc5 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -47,6 +47,7 @@
#include <com/sun/star/chart/ChartSymbolType.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <comphelper/sequence.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -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<drawing::FillStyle>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
+ rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_COLOR,
+ PROP_SERIES_DATAPOINT_LABEL_FILL_COLOR,
+ cppu::UnoType<sal_Int32>::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<sal_Int32>::get(),
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 1cb709d0559c..cc9ed237f44b 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -384,6 +384,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<drawing::FillStyle>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_COLOR,
+ PROP_DATAPOINT_LABEL_FILL_COLOR,
+ cppu::UnoType<sal_Int32>::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<sal_Int32>::get(),
@@ -486,6 +497,8 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault< OUString >( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, " " );
PropertyHelper::setPropertyValueDefault<sal_Int32>(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<sal_Int32>(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 51f1d81a71b7..5214b7bcaf9c 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 f96c7b101509..8a949c123fa9 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -340,7 +340,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;
}