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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 1 10:27:52 UTC 2021


 hwpfilter/source/hwpfile.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 567922d076cfaf90c11c32c34e8a4955c9248b9b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 1 09:49:01 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 1 12:27:18 2021 +0200

    ofz#33724 compareParaShape will return 0 if input shape has no cshape
    
    so return early in that case and avoid the expensive loop
    
    Change-Id: Ibdde814322c6e9c094c3652c28e0d79887d1f5bd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118211
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 3fbaf6c6f2fc..3a2d2c282e9b 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -626,6 +626,9 @@ int HWPFile::compareCharShape(CharShape const *shape)
 
 int HWPFile::compareParaShape(const ParaShape* shape)
 {
+    if (!shape->cshape)
+        return 0;
+
     int count = pslist.size();
     if (count > 0)
     {
@@ -642,7 +645,7 @@ int HWPFile::compareParaShape(const ParaShape* shape)
                 shape->outline == pshape->outline &&
                 shape->pagebreak == pshape->pagebreak)
             {
-                if (shape->cshape && pshape->cshape &&
+                if (pshape->cshape &&
                     shape->cshape->size == pshape->cshape->size &&
                     shape->cshape->font[0] == pshape->cshape->font[0] &&
                     shape->cshape->ratio[0] == pshape->cshape->ratio[0] &&


More information about the Libreoffice-commits mailing list