diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-20 01:25:56 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-20 18:23:13 +0000 |
commit | 1e92234dd3726536410678b58b8195095922e9c0 (patch) | |
tree | a2886acacbeab5a4ac1897c5c2fb0741ac14a66e | |
parent | 15298a55fbde6352f260b919c0e600737e01d4a7 (diff) |
expand complex cascading conditional operator
Change-Id: I3546589bbfaf1f19a9e283bc33a4a9e65e516dbc
Reviewed-on: https://gerrit.libreoffice.org/13006
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index a66533c0924e..c2b098267f3e 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()); } |