[Libreoffice-commits] core.git: hwpfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 24 20:12:33 UTC 2018


 hwpfilter/source/hbox.cxx      |    4 ++--
 hwpfilter/source/hbox.h        |    4 +++-
 hwpfilter/source/hwpreader.cxx |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit cef587ce6c14261250623fe1d5e100f67952f4ca
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 24 14:22:20 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 24 22:12:05 2018 +0200

    hdo is always a HWPDrawingObject
    
    Change-Id: Ia9484304e9fc3c5bc9aa833bf14711203e9e72fe
    Reviewed-on: https://gerrit.libreoffice.org/62306
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index 200f95b6e609..cb1c8da4e1af 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -359,8 +359,8 @@ Picture::Picture()
 
 Picture::~Picture()
 {
-    if( pictype == PICTYPE_DRAW && picinfo.picdraw.hdo )
-        delete static_cast<HWPDrawingObject *>(picinfo.picdraw.hdo);
+    if (pictype == PICTYPE_DRAW)
+        delete picinfo.picdraw.hdo;
 }
 
 
diff --git a/hwpfilter/source/hbox.h b/hwpfilter/source/hbox.h
index e87af92e7dcf..cc3b13963a31 100644
--- a/hwpfilter/source/hbox.h
+++ b/hwpfilter/source/hbox.h
@@ -549,12 +549,14 @@ struct PicDefOle
     void  *hwpole;
 };
 
+struct HWPDrawingObject;
+
 /**
  * @short Drawing object of hwp
  */
 struct PicDefDraw
 {
-    void      *hdo;
+    HWPDrawingObject *hdo;
     uint      zorder;
     ZZRect    vrect;
     int       mbrcnt;
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 3b3ecefa90cd..49e819b84cd2 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3968,7 +3968,7 @@ void HwpReader::makePicture(Picture * hbox)
               if( hbox->picinfo.picdraw.zorder > 0 )
                  padd("draw:z-index", sXML_CDATA,
                       ascii(Int2Str( hbox->picinfo.picdraw.zorder + 10000, "%d", buf)));
-            makePictureDRAW( static_cast<HWPDrawingObject *>(hbox->picinfo.picdraw.hdo), hbox);
+            makePictureDRAW(hbox->picinfo.picdraw.hdo, hbox);
             break;
         case PICTYPE_UNKNOWN:
             break;


More information about the Libreoffice-commits mailing list