diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 00:22:31 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 15:42:03 +0100 |
commit | bc0ab08634f59e1a1814e575fe6ad5e50bf1aee1 (patch) | |
tree | 8691eec1adefd9e4def8245898e8a3e5c5542037 /sw | |
parent | 168ae4c00a86b7534dedd303f9ef008e19822b99 (diff) |
Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversions
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 2efafc412d82..dd15aeee8445 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -110,16 +110,15 @@ void lclMovePositionWithRotation(awt::Point& aPos, const Size& rSize, Degree100 // Use nRotation in [0;9000], for to have only one and not four cases. if (nRotation100 == 0_deg100) return; - sal_Int64 nRotation = nRotation100.get(); - if (nRotation < 0) - nRotation = (36000 + nRotation) % 36000; - if (nRotation % 18000 == 0) - nRotation = 0; // prevents endless loop - while (nRotation > 9000) - nRotation = (18000 - (nRotation % 18000)); - - double fVal = static_cast<double>(nRotation) * F_PI18000; - double fCos = (nRotation == 9000) ? 0.0 : cos(fVal); + if (nRotation100 < 0_deg100) + nRotation100 = (36000_deg100 + nRotation100) % 36000_deg100; + if (nRotation100 % 18000_deg100 == 0_deg100) + nRotation100 = 0_deg100; // prevents endless loop + while (nRotation100 > 9000_deg100) + nRotation100 = 18000_deg100 - (nRotation100 % 18000_deg100); + + double fVal = toRadians(nRotation100); + double fCos = (nRotation100 == 9000_deg100) ? 0.0 : cos(fVal); double fSin = sin(fVal); double fWidthHalf = static_cast<double>(rSize.Width()) / 2.0; |