Kaydet (Commit) 4089ea55 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: trivial conversions in txttab.cxx

Change-Id: I13b7668fc2cf4b7886c1f96a4a7775dea206e05b
üst c192a32f
...@@ -294,7 +294,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto ...@@ -294,7 +294,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab ) SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab )
: SwFixPortion(), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab ) : SwFixPortion(), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab )
{ {
nLineLength = 1; nLineLength = TextFrameIndex(1);
OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!"); OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!");
SetWhichPor( POR_TAB ); SetWhichPor( POR_TAB );
} }
...@@ -336,7 +336,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) ...@@ -336,7 +336,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
// tab portion representing the list tab of a list label gets the // tab portion representing the list tab of a list label gets the
// same font as the corresponding number portion // same font as the corresponding number portion
std::unique_ptr< SwFontSave > pSave; std::unique_ptr< SwFontSave > pSave;
if ( GetLen() == 0 && if ( GetLen() == TextFrameIndex(0) &&
rInf.GetLast() && rInf.GetLast()->InNumberGrp() && rInf.GetLast() && rInf.GetLast()->InNumberGrp() &&
static_cast<SwNumberPortion*>(rInf.GetLast())->HasFont() ) static_cast<SwNumberPortion*>(rInf.GetLast())->HasFont() )
{ {
...@@ -389,7 +389,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) ...@@ -389,7 +389,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
// In tabulator compatibility mode, we reset the bFull flag // In tabulator compatibility mode, we reset the bFull flag
// if the tabulator is at the end of the paragraph and the // if the tabulator is at the end of the paragraph and the
// tab stop position is outside the frame: // tab stop position is outside the frame:
bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetText().getLength(); bool bAtParaEnd = rInf.GetIdx() + GetLen() == TextFrameIndex(rInf.GetText().getLength());
if ( bFull && bTabCompat && if ( bFull && bTabCompat &&
( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) && ( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) &&
GetTabPos() >= rInf.GetTextFrame()->getFrameArea().Width() ) GetTabPos() >= rInf.GetTextFrame()->getFrameArea().Width() )
...@@ -420,7 +420,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) ...@@ -420,7 +420,7 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
{ {
Height( 0 ); Height( 0 );
Width( 0 ); Width( 0 );
SetLen( 0 ); SetLen( TextFrameIndex(0) );
SetAscent( 0 ); SetAscent( 0 );
SetPortion( nullptr ); //????? SetPortion( nullptr ); //?????
} }
...@@ -517,7 +517,7 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const ...@@ -517,7 +517,7 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
// same font as the corresponding number portion // same font as the corresponding number portion
std::unique_ptr< SwFontSave > pSave; std::unique_ptr< SwFontSave > pSave;
bool bAfterNumbering = false; bool bAfterNumbering = false;
if ( GetLen() == 0 ) if (GetLen() == TextFrameIndex(0))
{ {
const SwLinePortion* pPrevPortion = const SwLinePortion* pPrevPortion =
const_cast<SwTabPortion*>(this)->FindPrevPortion( rInf.GetParaPortion() ); const_cast<SwTabPortion*>(this)->FindPrevPortion( rInf.GetParaPortion() );
...@@ -562,7 +562,8 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const ...@@ -562,7 +562,8 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
sal_uInt16 nChar = Width() / nCharWidth; sal_uInt16 nChar = Width() / nCharWidth;
OUStringBuffer aBuf; OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nChar, ' '); comphelper::string::padToLength(aBuf, nChar, ' ');
rInf.DrawText(aBuf.makeStringAndClear(), *this, 0, nChar, true); rInf.DrawText(aBuf.makeStringAndClear(), *this, TextFrameIndex(0),
TextFrameIndex(nChar), true);
} }
} }
...@@ -582,7 +583,8 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const ...@@ -582,7 +583,8 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
++nChar; // to avoid gaps ++nChar; // to avoid gaps
OUStringBuffer aBuf; OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nChar, cFill); comphelper::string::padToLength(aBuf, nChar, cFill);
rInf.DrawText(aBuf.makeStringAndClear(), *this, 0, nChar, true); rInf.DrawText(aBuf.makeStringAndClear(), *this, TextFrameIndex(0),
TextFrameIndex(nChar), true);
} }
} }
} }
......
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