summaryrefslogtreecommitdiff
path: root/sw/source/core/text/itradj.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-05-09 14:57:26 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 21:51:25 +0200
commitcd9ae347a8f2dd60cafe882c0522ff8fa2936481 (patch)
treebc3e155271dfea088dceeabe8277052f5e4d842d /sw/source/core/text/itradj.cxx
parentc8f1802fa4595d7b73ccde773f89a2d83c6aacd3 (diff)
sw_redlinehide: trivial conversions in itradj.cxx
Change-Id: Ifc9cc3187e16e63aa468e31efa454c70fd907f50
Diffstat (limited to 'sw/source/core/text/itradj.cxx')
-rw-r--r--sw/source/core/text/itradj.cxx48
1 files changed, 24 insertions, 24 deletions
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index ee37e1785040..524454d7a093 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -44,7 +44,7 @@ void SwTextAdjuster::FormatBlock( )
const SwLinePortion *pFly = nullptr;
bool bSkip = !IsLastBlock() &&
- m_nStart + m_pCurr->GetLen() >= GetInfo().GetText().getLength();
+ m_nStart + m_pCurr->GetLen() >= TextFrameIndex(GetInfo().GetText().getLength());
// Multi-line fields are tricky, because we need to check whether there are
// any other text portions in the paragraph.
@@ -102,7 +102,7 @@ void SwTextAdjuster::FormatBlock( )
}
}
- const sal_Int32 nOldIdx = GetInfo().GetIdx();
+ const TextFrameIndex nOldIdx = GetInfo().GetIdx();
GetInfo().SetIdx( m_nStart );
CalcNewBlock( m_pCurr, pFly );
GetInfo().SetIdx( nOldIdx );
@@ -110,14 +110,14 @@ void SwTextAdjuster::FormatBlock( )
}
static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwTextIter& rItr,
- sal_Int32& rKashidas, sal_Int32& nGluePortion )
+ sal_Int32& rKashidas, TextFrameIndex& nGluePortion)
{
if ( rInf.GetOut()->GetMinKashida() <= 0 )
return false;
// i60594 validate Kashida justification
- sal_Int32 nIdx = rItr.GetStart();
- sal_Int32 nEnd = rItr.GetEnd();
+ TextFrameIndex nIdx = rItr.GetStart();
+ TextFrameIndex nEnd = rItr.GetEnd();
// Note on calling KashidaJustify():
// Kashida positions may be marked as invalid. Therefore KashidaJustify may return the clean
@@ -138,7 +138,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
while ( rKashidas && nIdx < nEnd )
{
rItr.SeekAndChgAttrIter( nIdx, rInf.GetOut() );
- sal_Int32 nNext = rItr.GetNextAttr();
+ TextFrameIndex nNext = rItr.GetNextAttr();
// is there also a script change before?
// if there is, nNext should point to the script change
@@ -146,7 +146,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
if( nNextScript < nNext )
nNext = nNextScript;
- if ( nNext == COMPLETE_STRING || nNext > nEnd )
+ if (nNext == TextFrameIndex(COMPLETE_STRING) || nNext > nEnd)
nNext = nEnd;
sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( nullptr, nullptr, nIdx, nNext - nIdx );
if (nKashidasInAttr > 0)
@@ -182,7 +182,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
}
static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwTextIter& rItr, sal_Int32& rKashidas,
- sal_Int32& nGluePortion, const long nGluePortionWidth, long& nSpaceAdd )
+ TextFrameIndex& nGluePortion, const long nGluePortionWidth, long& nSpaceAdd )
{
// check kashida width
// if width is smaller than minimal kashida width allowed by fonts in the current line
@@ -190,12 +190,12 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
while (rKashidas)
{
bool bAddSpaceChanged = false;
- sal_Int32 nIdx = rItr.GetStart();
- sal_Int32 nEnd = rItr.GetEnd();
+ TextFrameIndex nIdx = rItr.GetStart();
+ TextFrameIndex nEnd = rItr.GetEnd();
while ( nIdx < nEnd )
{
rItr.SeekAndChgAttrIter( nIdx, rInf.GetOut() );
- sal_Int32 nNext = rItr.GetNextAttr();
+ TextFrameIndex nNext = rItr.GetNextAttr();
// is there also a script change before?
// if there is, nNext should point to the script change
@@ -221,7 +221,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT
if( !rKashidas || !nGluePortion ) // nothing left, return false to
return false; // do regular blank justification
- nSpaceAdd = nGluePortionWidth / nGluePortion;
+ nSpaceAdd = nGluePortionWidth / sal_Int32(nGluePortion);
bAddSpaceChanged = true;
}
if( nKashidasDropped )
@@ -248,8 +248,8 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
OSL_ENSURE( pCurrent->Height(), "SwTextAdjuster::CalcBlockAdjust: missing CalcLine()" );
pCurrent->InitSpaceAdd();
- sal_Int32 nGluePortion = 0;
- sal_Int32 nCharCnt = 0;
+ TextFrameIndex nGluePortion(0);
+ TextFrameIndex nCharCnt(0);
sal_uInt16 nSpaceIdx = 0;
// i60591: hennerdrews
@@ -307,8 +307,8 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
pCurrent->SetLLSpaceAdd( 0, nSpaceIdx );
nSpaceIdx++;
- nGluePortion = 0;
- nCharCnt = 0;
+ nGluePortion = TextFrameIndex(0);
+ nCharCnt = TextFrameIndex(0);
}
else if( pMulti->IsDouble() )
nGluePortion = nGluePortion + static_cast<SwDoubleLinePortion*>(pMulti)->GetSpaceCnt();
@@ -344,7 +344,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
if( nGluePortion )
{
- long nSpaceAdd = nGluePortionWidth / nGluePortion;
+ long nSpaceAdd = nGluePortionWidth / sal_Int32(nGluePortion);
// i60594
if( rSI.CountKashida() && !bSkipKashida )
@@ -363,16 +363,16 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
pCurrent->SetLLSpaceAdd( nSpaceAdd , nSpaceIdx );
pPos->Width( static_cast<SwGluePortion*>(pPos)->GetFixWidth() );
}
- else if ( IsOneBlock() && nCharCnt > 1 )
+ else if (IsOneBlock() && nCharCnt > TextFrameIndex(1))
{
- const long nSpaceAdd = - nGluePortionWidth / ( nCharCnt - 1 );
+ const long nSpaceAdd = - nGluePortionWidth / (sal_Int32(nCharCnt) - 1);
pCurrent->SetLLSpaceAdd( nSpaceAdd, nSpaceIdx );
pPos->Width( static_cast<SwGluePortion*>(pPos)->GetFixWidth() );
}
nSpaceIdx++;
- nGluePortion = 0;
- nCharCnt = 0;
+ nGluePortion = TextFrameIndex(0);
+ nCharCnt = TextFrameIndex(0);
}
else
++nGluePortion;
@@ -582,10 +582,10 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent )
CalcRightMargin( pCurrent );
SwLinePortion *pPos = pLeft->GetPortion();
- sal_Int32 nLen = 0;
+ TextFrameIndex nLen(0);
// If we only have one line, the text portion is consecutive and we center, then ...
- bool bComplete = 0 == m_nStart;
+ bool bComplete = TextFrameIndex(0) == m_nStart;
const bool bTabCompat = GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_COMPAT);
bool bMultiTab = false;
@@ -607,7 +607,7 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent )
// to left-aligned.
// The first text portion gets the whole Glue, but only if we have
// more than one line.
- if( bComplete && GetInfo().GetText().getLength() == nLen )
+ if (bComplete && TextFrameIndex(GetInfo().GetText().getLength()) == nLen)
static_cast<SwGluePortion*>(pPos)->MoveHalfGlue( pGlue );
else
{