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

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Thu Nov 20 10:23:40 PST 2014


 sw/source/core/unocore/unostyle.cxx |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 1e92234dd3726536410678b58b8195095922e9c0
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Nov 20 01:25:56 2014 +0100

    expand complex cascading conditional operator
    
    Change-Id: I3546589bbfaf1f19a9e283bc33a4a9e65e516dbc
    Reviewed-on: https://gerrit.libreoffice.org/13006
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index a66533c..c2b0982 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -745,11 +745,17 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName)
             uno::Reference< style::XStyle >  xStyle = _FindStyle(sStyleName);
             if(!xStyle.is())
             {
-                xStyle = eFamily == SFX_STYLE_FAMILY_PAGE ?
-                    new SwXPageStyle(*pBasePool, pDocShell, eFamily, sStyleName) :
-                        eFamily == SFX_STYLE_FAMILY_FRAME ?
-                        new SwXFrameStyle(*pBasePool, pDocShell->GetDoc(), pBase->GetName()):
-                            new SwXStyle(*pBasePool, eFamily, pDocShell->GetDoc(), sStyleName);
+                switch(eFamily)
+                {
+                    case SFX_STYLE_FAMILY_PAGE:
+                        xStyle = new SwXPageStyle(*pBasePool, pDocShell, eFamily, sStyleName);
+                        break;
+                    case SFX_STYLE_FAMILY_FRAME:
+                        xStyle = new SwXFrameStyle(*pBasePool, pDocShell->GetDoc(), pBase->GetName()):
+                        break;
+                    default:
+                        new SwXStyle(*pBasePool, eFamily, pDocShell->GetDoc(), sStyleName);
+                }
             }
             aRet.setValue(&xStyle, cppu::UnoType<style::XStyle>::get());
         }


More information about the Libreoffice-commits mailing list