diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/vba/vbafont.cxx | 24 |
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 ) ); |