diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-29 11:35:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-31 10:41:34 +0100 |
commit | 8a722c086deb751054d02f9f73e92d045cd73e1f (patch) | |
tree | 22f1bc523ab0019850a014ce94dbf69eb4ce075d /starmath/source/node.cxx | |
parent | 07ec9edc26f675646f04721acb3f1f0334a34530 (diff) |
loplugin:flatten in starmath
Change-Id: Iaadd8af404e3eee5ebd49846a02a33735e9c18ba
Reviewed-on: https://gerrit.libreoffice.org/67170
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/node.cxx')
-rw-r--r-- | starmath/source/node.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index ebbb57f3d7b7..97d97582826d 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2630,32 +2630,32 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell Flags() |= FontChangeMask::Face; - if (mbIsFromGreekSymbolSet) + if (!mbIsFromGreekSymbolSet) + return; + + OSL_ENSURE( GetText().getLength() == 1, "a symbol should only consist of 1 char!" ); + bool bItalic = false; + sal_Int16 nStyle = rFormat.GetGreekCharStyle(); + OSL_ENSURE( nStyle >= 0 && nStyle <= 2, "unexpected value for GreekCharStyle" ); + if (nStyle == 1) + bItalic = true; + else if (nStyle == 2) { - OSL_ENSURE( GetText().getLength() == 1, "a symbol should only consist of 1 char!" ); - bool bItalic = false; - sal_Int16 nStyle = rFormat.GetGreekCharStyle(); - OSL_ENSURE( nStyle >= 0 && nStyle <= 2, "unexpected value for GreekCharStyle" ); - if (nStyle == 1) - bItalic = true; - else if (nStyle == 2) + const OUString& rTmp(GetText()); + if (!rTmp.isEmpty()) { - const OUString& rTmp(GetText()); - if (!rTmp.isEmpty()) - { - static const sal_Unicode cUppercaseAlpha = 0x0391; - static const sal_Unicode cUppercaseOmega = 0x03A9; - sal_Unicode cChar = rTmp[0]; - // uppercase letters should be straight and lowercase letters italic - bItalic = !(cUppercaseAlpha <= cChar && cChar <= cUppercaseOmega); - } + static const sal_Unicode cUppercaseAlpha = 0x0391; + static const sal_Unicode cUppercaseOmega = 0x03A9; + sal_Unicode cChar = rTmp[0]; + // uppercase letters should be straight and lowercase letters italic + bItalic = !(cUppercaseAlpha <= cChar && cChar <= cUppercaseOmega); } - - if (bItalic) - Attributes() |= FontAttribute::Italic; - else - Attributes() &= ~FontAttribute::Italic; } + + if (bItalic) + Attributes() |= FontAttribute::Italic; + else + Attributes() &= ~FontAttribute::Italic; }; |