summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2019-02-10 18:11:45 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-02-17 16:49:36 +0100
commitfcf24fa1ae47b2f132c992fe186b4ab38434f406 (patch)
treea2ca13080435efdcaac9b7bf5124539e5f2d2b48 /sc
parent371c744799a3a5791e3a7d643aa8e84dff27527f (diff)
Simplify style processing in ScVbaFont::setFontStyle
Change-Id: If4a2b9d864a007ceae063a4561c6a7172a4e73a1 Reviewed-on: https://gerrit.libreoffice.org/67653 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbafont.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index d4100a4263d8..fe269de6953c 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -140,21 +140,21 @@ ScVbaFont::setFontStyle( const uno::Any& aValue )
OUString aStyles;
aValue >>= aStyles;
- std::vector< OUString > aTokens;
- sal_Int32 nIndex = 0;
- do
- {
- OUString aToken = aStyles.getToken( 0, ' ', nIndex );
- aTokens.push_back( aToken );
- }while( nIndex >= 0 );
-
- for( const auto& rToken : aTokens )
+ for (sal_Int32 nIdx{ 0 }; nIdx>=0; )
{
- if( rToken.equalsIgnoreAsciiCase("Bold") )
+ const OUString aToken{ aStyles.getToken( 0, ' ', nIdx ) };
+ if (aToken.equalsIgnoreAsciiCase("Bold"))
+ {
bBold = true;
-
- if( rToken.equalsIgnoreAsciiCase("Italic") )
+ if (bItalic)
+ break;
+ }
+ else if (aToken.equalsIgnoreAsciiCase("Italic"))
+ {
bItalic = true;
+ if (bBold)
+ break;
+ }
}
setBold( uno::makeAny( bBold ) );