[Libreoffice-commits] core.git: 2 commits - svx/source

David Tardon dtardon at redhat.com
Wed Jul 9 05:45:20 PDT 2014


 svx/source/dialog/fntctrl.cxx |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit ca4e6cad00fd0c0a9b8670b5f67a8145622fdacf
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Jul 9 14:43:50 2014 +0200

    simplify loop
    
    Change-Id: I26c1456ca805c6f3ecfa5bd4876e7ae345f087e7

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index e9a92eb..80ca478 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -246,11 +246,13 @@ void FontPrevWin_Impl::CheckScript()
         Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
         xBreak = BreakIterator::create(xContext);
     }
-    sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
+
+    sal_uInt16 nScript = 0;
     sal_Int32 nChg = 0;
 
-    do
+    while ( nChg < aText.getLength() )
     {
+        nScript = xBreak->getScriptType( aText, nChg );
         nChg = xBreak->endOfScript( aText, nChg, nScript );
         if (nChg < aText.getLength() && nChg > 0 &&
             (com::sun::star::i18n::ScriptType::WEAK ==
@@ -273,12 +275,7 @@ void FontPrevWin_Impl::CheckScript()
         }
         aScriptType.push_back( nScript );
         aTextWidth.push_back( 0 );
-
-        if( nChg < aText.getLength() )
-            nScript = xBreak->getScriptType( aText, nChg );
-        else
-            break;
-    } while( true );
+    }
 }
 
 /*
commit 8817e5e3a0d92a4febae955ced7a35c52cb08910
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Jul 9 14:41:29 2014 +0200

    fdo#81004 this looks like a mis-merge to me
    
    Change-Id: I2d30774a8a89002b6c2d8487bfce15eb13c82e0d

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 6e9ca6e..e9a92eb 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -248,14 +248,6 @@ void FontPrevWin_Impl::CheckScript()
     }
     sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
     sal_Int32 nChg = 0;
-    if( com::sun::star::i18n::ScriptType::WEAK == nScript )
-    {
-        nChg = xBreak->endOfScript( aText, nChg, nScript );
-        if (nChg < aText.getLength() && nChg >= 0)
-            nScript = xBreak->getScriptType( aText, nChg );
-        else
-            nScript = com::sun::star::i18n::ScriptType::LATIN;
-    }
 
     do
     {


More information about the Libreoffice-commits mailing list