From 04ee8ea4bd129fada31f91d7fa4784eab12894d0 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sun, 31 Aug 2014 19:17:33 +0200 Subject: Remove unneeded local scope Change-Id: I51fe6e130006fdca547abe99a44117f710d1e776 --- sw/source/core/text/porfld.cxx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'sw') diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index aed4bc8c348e..80cde639a9e5 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -192,25 +192,22 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) if( GetExpTxt( rInf, aTxt ) && !aTxt.isEmpty() && g_pBreakIt->GetBreakIter().is() ) { sal_uInt8 nActual = pFnt ? pFnt->GetActual() : rInf.GetFont()->GetActual(); - sal_uInt16 nScript; + sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( aTxt, 0 ); + sal_Int32 nChg = 0; + if( i18n::ScriptType::WEAK == nScript ) { - nScript = g_pBreakIt->GetBreakIter()->getScriptType( aTxt, 0 ); - sal_Int32 nChg = 0; - if( i18n::ScriptType::WEAK == nScript ) - { - nChg = g_pBreakIt->GetBreakIter()->endOfScript(aTxt,0,nScript); - if (nChg < aTxt.getLength() && nChg >= 0) - nScript = g_pBreakIt->GetBreakIter()->getScriptType( aTxt, nChg ); - } + nChg = g_pBreakIt->GetBreakIter()->endOfScript(aTxt,0,nScript); + if (nChg < aTxt.getLength() && nChg >= 0) + nScript = g_pBreakIt->GetBreakIter()->getScriptType( aTxt, nChg ); + } - // nNextScriptChg will be evaluated during SwFldPortion::Format() + // nNextScriptChg will be evaluated during SwFldPortion::Format() - if (nChg < aTxt.getLength() && nChg >= 0) - nNextScriptChg = g_pBreakIt->GetBreakIter()->endOfScript( aTxt, nChg, nScript ); - else - nNextScriptChg = aTxt.getLength(); + if (nChg < aTxt.getLength() && nChg >= 0) + nNextScriptChg = g_pBreakIt->GetBreakIter()->endOfScript( aTxt, nChg, nScript ); + else + nNextScriptChg = aTxt.getLength(); - } sal_uInt8 nTmp; switch ( nScript ) { case i18n::ScriptType::LATIN : nTmp = SW_LATIN; break; -- cgit