hwpfilter/source/hwpreader.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3e94bd846ab02f3f0dac55e9646ac778d6b7f284
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Mar 2 10:29:06 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Mar 2 14:30:59 2022 +0100

    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 <caol...@redhat.com>

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);
                 }
             }

Reply via email to