diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-02-08 11:24:07 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2019-03-05 08:56:08 +0100 |
commit | 592c6893156615695b7f95f53d71624a87650bf6 (patch) | |
tree | 5a5cafe37b7e94440bddf6a6116c6614bf33043f /oox | |
parent | 66b9f180c865d0ed57a297fe439a068f513b0fc6 (diff) |
tdf#122226 OOXML Chart Import: data label separator
Set the data label separator to "new line" if there is not
present explicit point separator and the "percentage format
wins over number value format". In MS-Office (2007/2010/2013/2016)
the defult separator is the "new line" in that case, any other
case the separator is a semicolon.
(cherry picked from commit de73efb96fbb1d268caea0f41acbe20a234ec59f)
(cherry picked from commit 42fd10b0ab6c6f65ba6394f9ae216c0f13973221)
Change-Id: I9ee0fb9f98fc1bb322892616af50954f4f8db0f9
Reviewed-on: https://gerrit.libreoffice.org/67758
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 716a0b234bdd..01e1d72562c5 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -182,7 +182,11 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt convertTextProperty(rPropSet, rFormatter, rDataLabel.mxTextProp); // data label separator (do not overwrite series separator, if no explicit point separator is present) - if( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) + // Set the data label separator to "new line" if the value is shown as percentage with a category name, + // just like in MS-Office. In any other case the default separator will be a semicolon. + if( bShowPercent && !bShowValue && ( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) ) + rPropSet.setProperty( PROP_LabelSeparator, rDataLabel.moaSeparator.get( "\n" ) ); + else if( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) rPropSet.setProperty( PROP_LabelSeparator, rDataLabel.moaSeparator.get( "; " ) ); // data label placement (do not overwrite series placement, if no explicit point placement is present) |