diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2015-07-19 18:18:00 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-09-09 07:41:51 +0000 |
commit | 9ed1dd01be8afa0961e388a79e9ff4c1235820c2 (patch) | |
tree | 366cad6bae91e791be462e4c03f499ab0ba3e2f2 /chart2/source/model | |
parent | 79bc956e7f44b762bfd6560e5a9c9812fa3dcf4d (diff) |
tdf#90839: support for wrapped text in data labels and for centered data value
Now in a pie chart the text of a label can be wrapped, the wrapping is
automatic and the maximum text width is fixed to almost half the pie
radius. This feature is used to import correctly the relative text
wrapping property provided by MSO.
Moreover the data value and percent value of a label are now centered
horizontally, respect with the label text.
Conflicts:
chart2/qa/extras/xshape/chart2xshape.cxx
Change-Id: Ie10d6184365436f763cd9693a5bbefcfa9b3862b
Reviewed-on: https://gerrit.libreoffice.org/17193
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'chart2/source/model')
-rw-r--r-- | chart2/source/model/main/DataPointProperties.cxx | 8 | ||||
-rw-r--r-- | chart2/source/model/main/DataPointProperties.hxx | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index 8c131837f449..3d04e961ceb1 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -414,6 +414,13 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( + Property( "TextWordWrap", + PROP_DATAPOINT_TEXT_WORD_WRAP, + cppu::UnoType<bool>::get(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( Property( CHART_UNONAME_LABEL_SEP, PROP_DATAPOINT_LABEL_SEPARATOR, cppu::UnoType<OUString>::get(), @@ -529,6 +536,7 @@ void DataPointProperties::AddDefaultsToMap( sal_False // ShowLegendSymbol )); + PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_TEXT_WORD_WRAP, false ); PropertyHelper::setPropertyValueDefault< OUString >( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, " " ); PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, drawing::LineStyle_NONE); PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_COLOR); diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx index f4fbf0e2d00e..e87c1a9d16c3 100644 --- a/chart2/source/model/main/DataPointProperties.hxx +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -74,6 +74,7 @@ namespace DataPointProperties // label PROP_DATAPOINT_LABEL, PROP_DATAPOINT_LABEL_SEPARATOR, + PROP_DATAPOINT_TEXT_WORD_WRAP, PROP_DATAPOINT_LABEL_BORDER_STYLE, PROP_DATAPOINT_LABEL_BORDER_COLOR, PROP_DATAPOINT_LABEL_BORDER_WIDTH, |