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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 3 10:07:13 UTC 2019


 sw/source/core/crsr/findattr.cxx |   15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 0e2959222367dcc5e201b1bf652669777c7a499e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 08:12:10 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 3 11:05:26 2019 +0100

    Directly use o3tl::optional comparison
    
    Change-Id: I864137704dd8c27d034dc34c947c97954dd18ef3
    Reviewed-on: https://gerrit.libreoffice.org/84296
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 1709efbcb910..a4014be21762 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -64,25 +64,12 @@ static bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
         return static_cast<const SvxColorItem&>(rItem1).GetValue().IsRGBEqual(
                                 static_cast<const SvxColorItem&>(rItem2).GetValue() );
     case RES_PAGEDESC:
-        bool bNumOffsetEqual = false;
         ::o3tl::optional<sal_uInt16> const oNumOffset1 =
             static_cast<const SwFormatPageDesc&>(rItem1).GetNumOffset();
         ::o3tl::optional<sal_uInt16> const oNumOffset2 =
             static_cast<const SwFormatPageDesc&>(rItem2).GetNumOffset();
-        if (!oNumOffset1 && !oNumOffset2)
-        {
-            bNumOffsetEqual = true;
-        }
-        else if (oNumOffset1 && oNumOffset2)
-        {
-            bNumOffsetEqual = *oNumOffset1 == *oNumOffset2;
-        }
-        else
-        {
-            bNumOffsetEqual = false;
-        }
 
-        if (!bNumOffsetEqual)
+        if (oNumOffset1 != oNumOffset2)
             return false;
 
         return static_cast<const SwFormatPageDesc&>(rItem1).GetPageDesc() == static_cast<const SwFormatPageDesc&>(rItem2).GetPageDesc();


More information about the Libreoffice-commits mailing list