summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-07-09 14:43:50 +0200
committerDavid Tardon <dtardon@redhat.com>2014-07-09 14:44:45 +0200
commitca4e6cad00fd0c0a9b8670b5f67a8145622fdacf (patch)
tree52fc37b88afd45356563ca047fcdef296a809119
parent8817e5e3a0d92a4febae955ced7a35c52cb08910 (diff)
simplify loop
Change-Id: I26c1456ca805c6f3ecfa5bd4876e7ae345f087e7
-rw-r--r--svx/source/dialog/fntctrl.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index e9a92eb4a5ec..80ca47844986 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 );
+ }
}
/*