Kaydet (Commit) 3337a14a authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: SwDrawTextInfo conversion in frmpaint.cxx etc.

Change-Id: I64bb3478b11888373d9b5e0c8d4716065a625f6c
üst d10f615c
......@@ -1465,7 +1465,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
if( FILL_TAB != rFill.Mode() )
{
const OUString aTmp(" ");
SwDrawTextInfo aDrawInf( pSh, *pOut, nullptr, aTmp, 0, 2 );
SwDrawTextInfo aDrawInf( pSh, *pOut, aTmp, 0, 2 );
nSpace = pFnt->GetTextSize_( aDrawInf ).Width()/2;
}
if( rFill.X() >= nRight )
......
......@@ -192,7 +192,7 @@ void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed )
// Get script type of line numbering:
pFnt->SetActual( SwScriptInfo::WhichFont( 0, &aTmp, nullptr ) );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), nullptr, aTmp, 0, aTmp.getLength() );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), aTmp, 0, aTmp.getLength() );
aDrawInf.SetSpace( 0 );
aDrawInf.SetWrong( nullptr );
aDrawInf.SetGrammarCheck( nullptr );
......@@ -547,7 +547,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const
if ( EmptyHeight( ) > 1 )
{
const OUString aTmp( CH_PAR );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), nullptr, aTmp, 0, 1 );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), aTmp, 0, 1 );
aDrawInf.SetPos( aPos );
aDrawInf.SetSpace( 0 );
aDrawInf.SetKanaComp( 0 );
......
......@@ -1651,11 +1651,11 @@ TextFrameIndex SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoin
// additional information:
aDrawInf.SetNumberOfBlanks( pPor->InTextGrp() ?
static_cast<const SwTextPortion*>(pPor)->GetSpaceCnt( aSizeInf, nCharCnt ) :
0 );
TextFrameIndex(0) );
}
if ( pPor->InFieldGrp() && pCMS && pCMS->m_pSpecialPos )
aDrawInf.SetLen( COMPLETE_STRING );
aDrawInf.SetLen( TextFrameIndex(COMPLETE_STRING) );
aDrawInf.SetSpace( nSpaceAdd );
aDrawInf.SetFont( aSizeInf.GetFont() );
......
......@@ -1137,7 +1137,7 @@ void SwCombinedPortion::Paint( const SwTextPaintInfo &rInf ) const
}
}
const_cast<SwTextPaintInfo&>(rInf).SetPos( aOutPos );
rInf.DrawText( m_aExpand, *this, i, TextFrameIndex(1) );
rInf.DrawText(m_aExpand, *this, TextFrameIndex(i), TextFrameIndex(1));
}
// rInf is const, so we have to take back our manipulations
const_cast<SwTextPaintInfo&>(rInf).SetPos( aOldPos );
......@@ -1213,7 +1213,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf )
aTmpFont.SetSize( aFontSize, nScrp );
}
SwDrawTextInfo aDrawInf( pSh, *rInf.GetOut(), nullptr, m_aExpand, i, 1 );
SwDrawTextInfo aDrawInf(pSh, *rInf.GetOut(), m_aExpand, i, 1);
Size aSize = aTmpFont.GetTextSize_( aDrawInf );
const sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
aPos[ i ] = static_cast<sal_uInt16>(aSize.Width());
......
......@@ -529,7 +529,7 @@ void SwTextPortion::Paint( const SwTextPaintInfo &rInf ) const
assert(false); // this is some debugging only code
rInf.DrawBackBrush( *this );
const OUString aText(CH_TXT_ATR_SUBST_FIELDEND);
rInf.DrawText( aText, *this, 0, aText.getLength() );
rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(aText.getLength()));
}
else if (rInf.OnWin() && TextFrameIndex(1) == rInf.GetLen()
&& CH_TXT_ATR_FIELDSTART == rInf.GetText()[sal_Int32(rInf.GetIdx())])
......@@ -537,7 +537,7 @@ void SwTextPortion::Paint( const SwTextPaintInfo &rInf ) const
assert(false); // this is some debugging only code
rInf.DrawBackBrush( *this );
const OUString aText(CH_TXT_ATR_SUBST_FIELDSTART);
rInf.DrawText( aText, *this, 0, aText.getLength() );
rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(aText.getLength()));
}
else if( GetLen() )
{
......@@ -757,7 +757,7 @@ void SwHolePortion::Paint( const SwTextPaintInfo &rInf ) const
}
const OUString aText( ' ' );
rInf.DrawText( aText, *this, 0, 1 );
rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(1));
delete pFontSave;
delete pHoleFont;
......
......@@ -469,22 +469,23 @@ void SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf )
SwRect aRect( rInf.GetPos(), rInf.GetSize() );
if( rInf.GetSpace() )
{
sal_Int32 nTmpLen = COMPLETE_STRING == rInf.GetLen() ? rInf.GetText().getLength() :
rInf.GetLen();
TextFrameIndex const nTmpLen = TextFrameIndex(COMPLETE_STRING) == rInf.GetLen()
? TextFrameIndex(rInf.GetText().getLength())
: rInf.GetLen();
if( rInf.GetSpace() > 0 )
{
sal_Int32 nSpaceCnt = 0;
const sal_Int32 nEndPos = rInf.GetIdx() + nTmpLen;
for( sal_Int32 nPos = rInf.GetIdx(); nPos < nEndPos; ++nPos )
const TextFrameIndex nEndPos = rInf.GetIdx() + nTmpLen;
for (TextFrameIndex nPos = rInf.GetIdx(); nPos < nEndPos; ++nPos)
{
if( CH_BLANK == rInf.GetText()[ nPos ] )
if (CH_BLANK == rInf.GetText()[sal_Int32(nPos)])
++nSpaceCnt;
}
if( nSpaceCnt )
aRect.Width( aRect.Width() + nSpaceCnt * rInf.GetSpace() );
}
else
aRect.Width( aRect.Width() - nTmpLen * rInf.GetSpace() );
aRect.Width( aRect.Width() - sal_Int32(nTmpLen) * rInf.GetSpace() );
}
if( aClipSave.IsOn() && rInf.GetOut().IsClipRegion() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment