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

Caolán McNamara caolanm at redhat.com
Fri Sep 22 15:32:45 UTC 2017


 hwpfilter/source/htags.cxx |    8 +++-----
 hwpfilter/source/htags.h   |    2 --
 2 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit c75a3ffd88732f424f8f557c94e580ecc54f551f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 22 12:19:38 2017 +0100

    ofz: alloc+read+discard -> skipblock
    
    Change-Id: I51aa0a1155c468aa5d360c63f6f7c8d347078bf1
    Reviewed-on: https://gerrit.libreoffice.org/42638
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx
index 6bccf5c85bbc..f9952e009f8b 100644
--- a/hwpfilter/source/htags.cxx
+++ b/hwpfilter/source/htags.cxx
@@ -72,14 +72,13 @@ bool EmPicture::Read(HWPFile & hwpf)
 
 OlePicture::OlePicture(int tsize)
     : signature(0)
+#ifdef _WIN32
     , pis(nullptr)
+#endif
 {
     size = tsize - 4;
     if (size <= 0)
         return;
-#ifndef _WIN32
-     pis.reset( new char[size] );
-#endif
 };
 
 OlePicture::~OlePicture()
@@ -130,8 +129,7 @@ void OlePicture::Read(HWPFile & hwpf)
     }
     unlink(tname);
 #else
-    if (pis == nullptr || hwpf.ReadBlock(pis.get(), size) == 0)
-        return;
+    hwpf.SkipBlock(size);
 #endif
 }
 
diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h
index 2bf52b66a96f..3507633b0294 100644
--- a/hwpfilter/source/htags.h
+++ b/hwpfilter/source/htags.h
@@ -62,8 +62,6 @@ struct OlePicture
     uint signature;
 #ifdef _WIN32
     IStorage *pis;
-#else
-    std::unique_ptr<char[]> pis;
 #endif
     explicit OlePicture(int tsize);
     ~OlePicture(void);


More information about the Libreoffice-commits mailing list