From c32a4c2fac32b766a05473d037d73cbcd972dadd Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 5 Dec 2018 03:45:17 +0100 Subject: tdf#51671, implement feature to disable legend entry for series No UI and no ODF or OOXML support yet. Change-Id: I839c195e9c42f074838ff6592331f7cdd13b6cd2 Reviewed-on: https://gerrit.libreoffice.org/64583 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- chart2/source/model/main/DataSeriesProperties.cxx | 7 +++++++ chart2/source/model/main/DataSeriesProperties.hxx | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'chart2/source/model') diff --git a/chart2/source/model/main/DataSeriesProperties.cxx b/chart2/source/model/main/DataSeriesProperties.cxx index 6c7e38d7e038..375e6c441c2a 100644 --- a/chart2/source/model/main/DataSeriesProperties.cxx +++ b/chart2/source/model/main/DataSeriesProperties.cxx @@ -57,6 +57,12 @@ void DataSeriesProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "ShowLegendEntry", + PROP_DATASERIES_SHOW_LEGEND_ENTRY, + cppu::UnoType::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT ); + // add properties of service DataPointProperties DataPointProperties::AddPropertiesToVector( rOutProperties ); } @@ -67,6 +73,7 @@ void DataSeriesProperties::AddDefaultsToMap( PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING ); PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false ); PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 ); + PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_SHOW_LEGEND_ENTRY, true ); // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default diff --git a/chart2/source/model/main/DataSeriesProperties.hxx b/chart2/source/model/main/DataSeriesProperties.hxx index e27b9acd44f2..6791078d5678 100644 --- a/chart2/source/model/main/DataSeriesProperties.hxx +++ b/chart2/source/model/main/DataSeriesProperties.hxx @@ -36,7 +36,8 @@ namespace DataSeriesProperties PROP_DATASERIES_ATTRIBUTED_DATA_POINTS = FAST_PROPERTY_ID_START_DATA_SERIES, PROP_DATASERIES_STACKING_DIRECTION, PROP_DATASERIES_VARY_COLORS_BY_POINT, - PROP_DATASERIES_ATTACHED_AXIS_INDEX + PROP_DATASERIES_ATTACHED_AXIS_INDEX, + PROP_DATASERIES_SHOW_LEGEND_ENTRY }; void AddPropertiesToVector( -- cgit v1.2.3