From 57ad52ce8037ce24b4d0a0019e5089c03b90f3c8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 1 Jul 2021 09:52:06 +0100 Subject: can flatten this a level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I71742038c2a2ac8e335a404e99f5412430c0ff8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118212 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- hwpfilter/source/hwpfile.cxx | 45 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'hwpfilter/source/hwpfile.cxx') diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 3a2d2c282e9b..29f25cb39e08 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -630,33 +630,30 @@ int HWPFile::compareParaShape(const ParaShape* shape) return 0; int count = pslist.size(); - if (count > 0) + for (int i = 0; i < count; ++i) { - for (int i = 0; i < count; ++i) + ParaShape *pshape = pslist[i].get(); + if (shape->left_margin == pshape->left_margin && + shape->right_margin == pshape->right_margin && + shape->pspacing_prev == pshape->pspacing_prev && + shape->pspacing_next == pshape->pspacing_next && + shape->indent == pshape->indent && + shape->lspacing == pshape->lspacing && + shape->arrange_type == pshape->arrange_type && + shape->outline == pshape->outline && + shape->pagebreak == pshape->pagebreak) { - ParaShape *pshape = pslist[i].get(); - if (shape->left_margin == pshape->left_margin && - shape->right_margin == pshape->right_margin && - shape->pspacing_prev == pshape->pspacing_prev && - shape->pspacing_next == pshape->pspacing_next && - shape->indent == pshape->indent && - shape->lspacing == pshape->lspacing && - shape->arrange_type == pshape->arrange_type && - shape->outline == pshape->outline && - shape->pagebreak == pshape->pagebreak) + 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] && + shape->cshape->space[0] == pshape->cshape->space[0] && + shape->cshape->color[1] == pshape->cshape->color[1] && + shape->cshape->color[0] == pshape->cshape->color[0] && + shape->cshape->shade == pshape->cshape->shade && + shape->cshape->attr == pshape->cshape->attr) { - 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] && - shape->cshape->space[0] == pshape->cshape->space[0] && - shape->cshape->color[1] == pshape->cshape->color[1] && - shape->cshape->color[0] == pshape->cshape->color[0] && - shape->cshape->shade == pshape->cshape->shade && - shape->cshape->attr == pshape->cshape->attr) - { - return pshape->index; - } + return pshape->index; } } } -- cgit