summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-03-03 23:02:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-03-03 22:59:04 +0100
commit4cbaaf21fe1c22b36dd72798cecfa59e73d0f8c3 (patch)
treef7901791cddda9c63d9f1160362bc541cce360ce /hwpfilter
parentbe1076297b9b1191030cb4fc8c94cfae354630da (diff)
Use <cmath>'s std::hypot
Change-Id: I2f9db19dca795b6318cd88ca645020077520f5da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130943 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpreader.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 6c285c664e23..a8272d82746e 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3943,8 +3943,6 @@ void HwpReader::makePicture(Picture * hbox)
}
}
-namespace { double DBL(int x) { return x * x; } }
-
void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
{
int x = hbox->pgx;
@@ -4047,8 +4045,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
bIsRotate = true;
}
if( bIsRotate ){
- drawobj->extent.w = static_cast<int>(sqrt(DBL(pt[1].x-pt[0].x) + DBL(pt[1].y-pt[0].y)));
- drawobj->extent.h = static_cast<int>(sqrt(DBL(pt[2].x-pt[1].x) + DBL(pt[2].y-pt[1].y)));
+ drawobj->extent.w = static_cast<int>(std::hypot(pt[1].x-pt[0].x, pt[1].y-pt[0].y));
+ drawobj->extent.h = static_cast<int>(std::hypot(pt[2].x-pt[1].x, pt[2].y-pt[1].y));
padd("draw:transform", sXML_CDATA, trans);
}
}