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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Feb 17 15:49:56 UTC 2019


 sc/source/ui/vba/vbafont.cxx |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit fcf24fa1ae47b2f132c992fe186b4ab38434f406
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Feb 10 18:11:45 2019 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sun Feb 17 16:49:36 2019 +0100

    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 at yahoo.com>

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 ) );


More information about the Libreoffice-commits mailing list