oox/source/shape/WpgContext.cxx |   26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

New commits:
commit c74d97f1218a3592226a4fae4d4c1941dabe4f7a
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Sep 28 23:40:14 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Sep 29 07:47:59 2022 +0200

    oox: avoid else after return in WpgContext
    
    It's less code and does the same.
    
    Change-Id: I9b08f5b5c982bbf3740d7d5d04156ae01d878705
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140718
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx
index 8d83758b7316..339e7a70eac5 100644
--- a/oox/source/shape/WpgContext.cxx
+++ b/oox/source/shape/WpgContext.cxx
@@ -50,15 +50,13 @@ oox::core::ContextHandlerRef 
WpgContext::onCreateContext(sal_Int32 nElementToken
                 return new oox::shape::WpsContext(*this, 
uno::Reference<drawing::XShape>(), mpShape,
                                                   pShape);
             }
-            else
-            {
-                // Don't set default character height, Writer has its own way 
to set
-                // the default, and if we don't set it here, editeng properly 
inherits
-                // it.
-                oox::drawingml::ShapePtr pShape = 
std::make_shared<oox::drawingml::Shape>(
-                    "com.sun.star.drawing.CustomShape", 
/*bDefaultHeight=*/false);
-                return new oox::drawingml::ShapeContext(*this, mpShape, 
pShape);
-            }
+
+            // Don't set default character height, Writer has its own way to 
set
+            // the default, and if we don't set it here, editeng properly 
inherits
+            // it.
+            oox::drawingml::ShapePtr pShape = 
std::make_shared<oox::drawingml::Shape>(
+                "com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false);
+            return new oox::drawingml::ShapeContext(*this, mpShape, pShape);
         }
         case XML_pic:
             return new oox::drawingml::GraphicShapeContext(
@@ -72,12 +70,10 @@ oox::core::ContextHandlerRef 
WpgContext::onCreateContext(sal_Int32 nElementToken
                 pWPGShape->setFullWPGSupport(m_bFullWPGSupport);
                 return pWPGShape;
             }
-            else
-            {
-                return new oox::drawingml::ShapeGroupContext(
-                    *this, mpShape,
-                    
std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape"));
-            }
+
+            return new oox::drawingml::ShapeGroupContext(
+                *this, mpShape,
+                
std::make_shared<oox::drawingml::Shape>("com.sun.star.drawing.GroupShape"));
         }
         case XML_graphicFrame:
         {

Reply via email to