summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-07-01 09:49:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-07-01 12:27:18 +0200
commit567922d076cfaf90c11c32c34e8a4955c9248b9b (patch)
tree75063837952eb30c4e3632236811cff8f435cbb1 /hwpfilter
parent65af6fda33bc40670d41055f63e010c763f5b0b1 (diff)
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@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpfile.cxx5
1 files changed, 4 insertions, 1 deletions
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] &&