diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-03-02 10:29:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-03-02 14:30:59 +0100 |
commit | 3e94bd846ab02f3f0dac55e9646ac778d6b7f284 (patch) | |
tree | 51468b1b1c2e6ce76cd3f453267d0674160294d5 | |
parent | b28fbdc6dbee84ff265a2ab9002015d68fcd2ef7 (diff) |
ofz: Integer-overflow
turn macro into a function and have it return a double
Change-Id: Ib410d8f9f53271f58e44f2c46382871051a4476b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130836
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 3469fa1defb2..ff18d5099557 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -3961,8 +3961,8 @@ void HwpReader::makePicture(Picture * hbox) } } +namespace { double DBL(int x) { return x * x; } } -#define DBL(x) ((x) * (x)) void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) { int x = hbox->pgx; @@ -4065,8 +4065,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) bIsRotate = true; } if( bIsRotate ){ - drawobj->extent.w = static_cast<int>(sqrt(double(DBL(pt[1].x-pt[0].x)+DBL(pt[1].y-pt[0].y)))); - drawobj->extent.h = static_cast<int>(sqrt(double(DBL(pt[2].x-pt[1].x)+DBL(pt[2].y-pt[1].y)))); + drawobj->extent.w = static_cast<int>(sqrt(double(DBL(pt[1].x-pt[0].x) + DBL(pt[1].y-pt[0].y)))); + drawobj->extent.h = static_cast<int>(sqrt(double(DBL(pt[2].x-pt[1].x) + DBL(pt[2].y-pt[1].y)))); padd("draw:transform", sXML_CDATA, trans); } } |