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

New commits:
commit 567922d076cfaf90c11c32c34e8a4955c9248b9b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jul 1 09:49:01 2021 +0100
Commit:     Caolán McNamara <caol...@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 <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@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] &&
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to