summaryrefslogtreecommitdiffstats
path: root/sw/source/core/text/itrform2.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
commit0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (patch)
treed9b77eece17b7b144a4ea50592b639b9f7c87095 /sw/source/core/text/itrform2.cxx
parentMore loplugin:cstylecast: test (diff)
downloadcore-0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d.tar.gz
core-0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d.zip
More loplugin:cstylecast: sw
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
Diffstat (limited to 'sw/source/core/text/itrform2.cxx')
-rw-r--r--sw/source/core/text/itrform2.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 04a1e3c46bee..2b7d853ee734 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -238,7 +238,7 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf )
// line width is adjusted, so that pPor does not fit to current
// line anymore
- rInf.Width( (sal_uInt16)(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
+ rInf.Width( static_cast<sal_uInt16>(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
rInf.SetLen( pPor->GetLen() );
rInf.SetFull( false );
if( pFly )
@@ -398,7 +398,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
{
SwFontScript nNxtActual = rInf.GetFont()->GetActual();
SwFontScript nLstActual = nNxtActual;
- sal_uInt16 nLstHeight = (sal_uInt16)rInf.GetFont()->GetHeight();
+ sal_uInt16 nLstHeight = static_cast<sal_uInt16>(rInf.GetFont()->GetHeight());
bool bAllowBehind = false;
const CharClass& rCC = GetAppCharClass();
@@ -441,7 +441,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
if ( pTmpFnt )
{
nLstActual = pTmpFnt->GetActual();
- nLstHeight = (sal_uInt16)pTmpFnt->GetHeight();
+ nLstHeight = static_cast<sal_uInt16>(pTmpFnt->GetHeight());
}
}
}
@@ -504,7 +504,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
const SwTwips nRestWidth = rInf.Width() - rInf.X();
if ( nKernWidth <= nRestWidth )
- pGridKernPortion->Width( (sal_uInt16)nKernWidth );
+ pGridKernPortion->Width( static_cast<sal_uInt16>(nKernWidth) );
}
if ( pGridKernPortion != pPor )
@@ -593,7 +593,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
if( nTmp == m_pScriptInfo->NextScriptChg( nTmp - 1 ) &&
nTmp != rInf.GetText().getLength() )
{
- const sal_uInt16 nDist = (sal_uInt16)(rInf.GetFont()->GetHeight()/5);
+ const sal_uInt16 nDist = static_cast<sal_uInt16>(rInf.GetFont()->GetHeight()/5);
if( nDist )
{
@@ -647,7 +647,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
0;
const SwTwips nTmpWidth = i * nGridWidth;
const SwTwips nKernWidth = std::min(nTmpWidth - nSumWidth, nRestWidth);
- const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2);
+ const sal_uInt16 nKernWidth_1 = static_cast<sal_uInt16>(nKernWidth / 2);
OSL_ENSURE( nKernWidth <= nRestWidth,
"Not enough space left for adjusting non-asian text in grid mode" );
@@ -656,7 +656,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
rInf.X( rInf.X() + nKernWidth_1 );
if ( ! bFull )
- new SwKernPortion( *pPor, (short)(nKernWidth - nKernWidth_1),
+ new SwKernPortion( *pPor, static_cast<short>(nKernWidth - nKernWidth_1),
false, true );
pGridKernPortion = nullptr;
@@ -1337,7 +1337,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
POR_TABDECIMAL == pLastTabPortion->GetWhichPor() )
{
OSL_ENSURE( rInf.X() >= pLastTabPortion->GetFix(), "Decimal tab stop position cannot be calculated" );
- const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = (sal_uInt16)(rInf.X() - pLastTabPortion->GetFix() );
+ const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = static_cast<sal_uInt16>(rInf.X() - pLastTabPortion->GetFix() );
static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
rInf.SetTabDecimal( 0 );
}
@@ -1710,7 +1710,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
nTmp = 100;
nTmp *= nLineHeight;
- nLineHeight = (sal_uInt16)(nTmp / 100);
+ nLineHeight = static_cast<sal_uInt16>(nTmp / 100);
}
m_pCurr->SetRealHeight( nLineHeight );
@@ -1744,7 +1744,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
nTmp /= 100;
if( !nTmp )
++nTmp;
- nLineHeight = (sal_uInt16)nTmp;
+ nLineHeight = static_cast<sal_uInt16>(nTmp);
sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5; // 80%
#if 0
// could do clipping here (like Word does)
@@ -1799,7 +1799,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
nTmp /= 100;
if( !nTmp )
++nTmp;
- nLineHeight = (sal_uInt16)nTmp;
+ nLineHeight = static_cast<sal_uInt16>(nTmp);
break;
}
case SvxInterLineSpaceRule::Fix:
@@ -2360,7 +2360,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
if( bForced )
{
m_pCurr->SetForcedLeftMargin();
- rInf.ForcedLeftMargin( (sal_uInt16)aInter.Width() );
+ rInf.ForcedLeftMargin( static_cast<sal_uInt16>(aInter.Width()) );
}
if( bFullLine )
@@ -2450,7 +2450,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
const long nNewWidth = ( i - 1 ) * nGridWidth - nOfst;
if ( nNewWidth > 0 )
- rInf.Width( (sal_uInt16)nNewWidth );
+ rInf.Width( static_cast<sal_uInt16>(nNewWidth) );
else
rInf.Width( 0 );