hwpfilter/source/hcode.cxx | 6 ++---- hwpfilter/source/hcode.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
New commits: commit 02f30509f8b19d862b569fab480617808f2be2a7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Mar 16 09:42:37 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Mar 16 11:30:57 2022 +0100 ofz#45598 Integer-overflow Change-Id: I1b997a35630bdb3a14fe606c9a34faf4330099ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131646 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 7a00271641b1..a02e689d28d6 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -1398,7 +1398,7 @@ OUString base64_encode_string( const uchar *buf, unsigned int len ) return OUString::createFromAscii(aBuf); } -double calcAngle(int x1, int y1, int x2, int y2) +double calcAngle(double x1, double y1, double x2, double y2) { y1 = -y1; y2 = -y2; @@ -1408,10 +1408,8 @@ double calcAngle(int x1, int y1, int x2, int y2) else return 270.; } - double angle; // atan2 handles all 4 quadrants - angle = basegfx::rad2deg(atan2(y2 - y1 , x2 - x1)); - return angle; + return basegfx::rad2deg(atan2(y2 - y1 , x2 - x1)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/hwpfilter/source/hcode.h b/hwpfilter/source/hcode.h index da7ff7345913..53c1513e246f 100644 --- a/hwpfilter/source/hcode.h +++ b/hwpfilter/source/hcode.h @@ -69,6 +69,6 @@ DLLEXPORT OUString rgb2str(unsigned char red, unsigned char green, unsigned char DLLEXPORT OUString rgb2str(int32_t rgb); DLLEXPORT OUString base64_encode_string( const uchar *buf, unsigned int len ); -DLLEXPORT double calcAngle(int x1, int y1, int x2, int y2); +DLLEXPORT double calcAngle(double x1, double y1, double x2, double y2); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */