summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorKelemen Gábor <kelemeng@ubuntu.com>2019-11-12 15:03:04 +0100
committerLászló Németh <nemeth@numbertext.org>2020-09-28 09:18:06 +0200
commit41fa7244746819411f209110f13af43941f17ce8 (patch)
tree216c7b532e3cd38936396722c4a109e5d0ac6726 /chart2/source/model
parent050e95e50d44a5cbb74bb5de481cb30551f83136 (diff)
tdf#108059 Introduce compatibility key for pie chart orientation
There is no similar setting in MSO, it just always uses clockwise. LO on the other hand confuses users by using counterclockwise which turns to clockwise upon save to OOXML and reload. Eliminate this behavior by introducing a compatibility key for OOXML-heavy environments that: - sets the orientation to clockwise when pie chart type is selected - hides the checkbox that would have no effect after a save to OOXML Default value is false to keep current behavior Change-Id: I9e12ecad8e9978f960c921a521461aee023a5063 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/82524 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/template/PieChartTypeTemplate.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index ec08764a7509..7f58b6e856e6 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <officecfg/Office/Compatibility.hxx>
#include <tools/diagnose_ex.h>
+#include <officecfg/Office/Compatibility.hxx>
#include <rtl/math.hxx>
@@ -237,7 +238,15 @@ void PieChartTypeTemplate::adaptScales(
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
AxisHelper::removeExplicitScaling( aScaleData );
- aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+ // tdf#108059 Create new pie/donut charts with clockwise orientation
+ if (!officecfg::Office::Compatibility::View::ClockwisePieChartDirection::get())
+ {
+ aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+ }
+ else
+ {
+ aScaleData.Orientation = chart2::AxisOrientation_REVERSE;
+ }
xAxis->setScaleData( aScaleData );
}