summaryrefslogtreecommitdiff
path: root/chart2/source/model/main
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-03-02 08:56:11 +0100
committerLászló Németh <nemeth@numbertext.org>2020-03-05 12:27:04 +0100
commit9fab1ba8ddc59924c633aa17c65f7330a4762726 (patch)
treea3c1ad1a03c6970182c7345a41d220a1df726d3a /chart2/source/model/main
parentd264170ebbc92f8a920cd51d7f6f2744aa465be1 (diff)
tdf#75330 add a new overlay/no-overlay feature for the legend
Implement "Show the legend without overlapping the chart" option for chart legend. Change-Id: Ifbba4c81136e13995d276434dc17a97b0675428c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89810 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/model/main')
-rw-r--r--chart2/source/model/main/Legend.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 6381d232e31d..4c3b9f0e5167 100644
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -53,6 +53,7 @@ enum
PROP_LEGEND_ANCHOR_POSITION,
PROP_LEGEND_EXPANSION,
PROP_LEGEND_SHOW,
+ PROP_LEGEND_OVERLAY,
PROP_LEGEND_REF_PAGE_SIZE,
PROP_LEGEND_REL_POS,
PROP_LEGEND_REL_SIZE
@@ -78,6 +79,13 @@ void lcl_AddPropertiesToVector(
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT );
+
+ rOutProperties.emplace_back( "Overlay",
+ PROP_LEGEND_OVERLAY,
+ cppu::UnoType<bool>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "ReferencePageSize",
PROP_LEGEND_REF_PAGE_SIZE,
cppu::UnoType<awt::Size>::get(),
@@ -116,6 +124,7 @@ private:
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, css::chart::ChartLegendExpansion_HIGH );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_OVERLAY, false );
float fDefaultCharHeight = 10.0;
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );