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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri May 21 18:31:50 UTC 2021


 svx/source/dialog/dlgutil.cxx |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 70f3327e4ad0267c8e5e711e2b55e30a71ef5452
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri May 21 15:50:13 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri May 21 20:30:51 2021 +0200

    Simplify GetModuleFieldUnit a bit
    
    Change-Id: I34ed20387104cbfa0e9b894a5862d7f0543adfd8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115849
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx
index 9ed2e2bdb9f4..3d40889a839f 100644
--- a/svx/source/dialog/dlgutil.cxx
+++ b/svx/source/dialog/dlgutil.cxx
@@ -30,16 +30,11 @@
 
 FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet )
 {
-    FieldUnit eUnit = FieldUnit::INCH;
-    const SfxPoolItem* pItem = nullptr;
-    if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_METRIC, false, &pItem ) )
-        eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
-    else
-    {
-        return SfxModule::GetCurrentFieldUnit();
-    }
+    if (const SfxPoolItem* pItem = nullptr;
+        SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem))
+        return static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
 
-    return eUnit;
+    return SfxModule::GetCurrentFieldUnit();
 }
 
 bool GetApplyCharUnit( const SfxItemSet& rSet )


More information about the Libreoffice-commits mailing list