summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/PlottingPositionHelper.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-08-03 13:05:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-08-03 21:57:23 +0200
commit81302f33073e7629d724ed269f1fa21dad29e141 (patch)
tree59c1a5422fee301751c170e6ea24a3ca9b0caddc /chart2/source/view/main/PlottingPositionHelper.cxx
parent83b25e4b9fa8f95c24759a64f8cb9716ee34a4a3 (diff)
Move angle normalization code from various places to tools
Also rename svx angle normalization functions in include/svx/svdtrans.hxx, that deal with 100ths of degree, to avoid confusion: NormAngle180 -> NormAngle18000; NormAngle360 -> NormAngle36000. Some places were fixed that previously returned inclusive ranges (i.e., both 0 and 360), see changes in these files: chart2/source/view/main/PlottingPositionHelper.cxx chart2/source/view/main/PolarLabelPositionHelper.cxx chart2/source/view/main/ShapeFactory.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx sw/source/core/graphic/grfatr.cxx (the latter now matches the comment in the function). Change-Id: I9f274bbb4168360d60dceff02aeba6332c519a59 Reviewed-on: https://gerrit.libreoffice.org/58556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2/source/view/main/PlottingPositionHelper.cxx')
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index 9ad4f4465e53..da5cc4159aca 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <rtl/math.hxx>
+#include <tools/helpers.hxx>
namespace chart
{
@@ -477,11 +478,7 @@ double PolarPlottingPositionHelper::transformToAngleDegree( double fLogicValueOn
fRet = m_fAngleDegreeOffset
+ fAxisAngleScaleDirection*(fScaledLogicAngleValue-MinAngleValue)*360.0
/fabs(MaxAngleValue-MinAngleValue);
- while(fRet>360.0)
- fRet-=360.0;
- while(fRet<0)
- fRet+=360.0;
- return fRet;
+ return NormAngle360(fRet);
}
/**