From d0055ac076c61d24c505c2ffa4f99e36c97b1266 Mon Sep 17 00:00:00 2001 From: VaibhavMalik4187 Date: Sat, 19 Mar 2022 16:32:13 +0530 Subject: tdf#147906 Use std::hypot for Pythagorean addition Change-Id: I7813b9929771858d33e951e50e6de7893fe19085 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131684 Tested-by: Jenkins Reviewed-by: Hossein --- lotuswordpro/source/filter/lwpsdwrect.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpsdwrect.cxx b/lotuswordpro/source/filter/lwpsdwrect.cxx index 3ec27ccfbc42..3bc2704ac76f 100644 --- a/lotuswordpro/source/filter/lwpsdwrect.cxx +++ b/lotuswordpro/source/filter/lwpsdwrect.cxx @@ -170,7 +170,7 @@ double SdwRectangle::GetRotationAngle() const double SdwRectangle::CalcDistBetween2Points(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) { - return sqrt(static_cast((nX1-nX2)*(nX1-nX2) + (nY1-nY2)*(nY1-nY2))); + return std::hypot(nX1 - nX2, nY1 - nY2); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit