Kaydet (Commit) 31ae7d51 authored tarafından Matteo Casalin's avatar Matteo Casalin

sal_Bool to bool

Change-Id: Ia0a2183a3175ce1285c8d46a03a69702cbb8685c
üst ed68c388
......@@ -50,14 +50,14 @@ using namespace ::com::sun::star::linguistic2;
* otherwise possible break or hyphenation position is determined
*************************************************************************/
sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
const KSHORT nPorHeight )
{
nCutPos = rInf.GetIdx();
// Empty strings are always 0
if( !rInf.GetLen() || rInf.GetTxt().isEmpty() )
return sal_False;
return false;
OSL_ENSURE( rInf.GetIdx() < rInf.GetTxt().getLength(),
"+SwTxtGuess::Guess: invalid SwTxtFormatInfo" );
......@@ -84,7 +84,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nMaxLen = rInf.GetLen();
if( !nMaxLen )
return sal_False;
return false;
KSHORT nItalic = 0;
if( ITALIC_NONE != rInf.GetFont()->GetItalic() && !rInf.NotEOL() )
......@@ -145,7 +145,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nBreakWidth += nLeftRightBorderSpace;
return sal_True;
return true;
}
}
......@@ -184,7 +184,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
rInf.GetTxtSize( &rSI, rInf.GetIdx(), nMaxLen, nMaxComp,
nBreakWidth, nMaxSizeDiff );
// The following comparison should always give sal_True, otherwise
// The following comparison should always give true, otherwise
// there likely has been a pixel rounding error in GetTxtBreak
if ( nBreakWidth <= nLineWidth )
{
......@@ -197,7 +197,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nBreakWidth += nLeftRightBorderSpace;
return sal_True;
return true;
}
}
......@@ -207,7 +207,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
{
nBreakPos = rInf.GetIdx();
nCutPos = rInf.GetLen();
return sal_False;
return false;
}
sal_Int32 nPorLen = 0;
......@@ -347,12 +347,12 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
const ForbiddenCharacters aForbidden(
*rInf.GetTxtFrm()->GetNode()->getIDocumentSettingAccess()->getForbiddenCharacters( aLang, true ) );
const sal_Bool bAllowHanging = rInf.IsHanging() && ! rInf.IsMulti() &&
const bool bAllowHanging = rInf.IsHanging() && ! rInf.IsMulti() &&
! rPor.InFldGrp();
LineBreakUserOptions aUserOpt(
aForbidden.beginLine, aForbidden.endLine,
rInf.HasForbiddenChars(), bAllowHanging, sal_False );
rInf.HasForbiddenChars(), bAllowHanging, false );
//! register listener to LinguServiceEvents now in order to get
//! notified about relevant changes in the future
......@@ -523,7 +523,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
if( pHanging )
nBreakPos = nCutPos;
return sal_False;
return false;
}
/*************************************************************************
......@@ -540,7 +540,7 @@ bool SwTxtGuess::AlternativeSpelling( const SwTxtFormatInfo &rInf,
Boundary aBound =
g_pBreakIt->GetBreakIter()->getWordBoundary( rInf.GetTxt(), nPos,
g_pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ),
WordType::DICTIONARY_WORD, sal_True );
WordType::DICTIONARY_WORD, true );
nBreakStart = aBound.startPos;
sal_Int32 nWordLen = aBound.endPos - nBreakStart;
......
......@@ -47,7 +47,7 @@ public:
~SwTxtGuess() { delete pHanging; }
// true, if current portion still fits to current line
sal_Bool Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
bool Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
const KSHORT nHeight );
bool AlternativeSpelling( const SwTxtFormatInfo &rInf, const sal_Int32 nPos );
......
......@@ -295,16 +295,16 @@ static bool lcl_HasContent( const SwFldPortion& rFld, SwTxtFormatInfo &rInf )
return rFld.GetExpTxt( rInf, aTxt ) && !aTxt.isEmpty();
}
sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
{
// 5744: If only the hypen does not fit anymore, we still need to wrap
// the word, or else return sal_True!
// the word, or else return true!
if( rInf.IsUnderFlow() && rInf.GetSoftHyphPos() )
{
// soft hyphen portion has triggered an underflow event because
// of an alternative spelling position
sal_Bool bFull = sal_False;
const sal_Bool bHyph = rInf.ChgHyph( sal_True );
bool bFull = false;
const bool bHyph = rInf.ChgHyph( true );
if( rInf.IsHyphenate() )
{
SwTxtGuess aGuess;
......@@ -320,7 +320,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
}
SwTxtGuess aGuess;
const sal_Bool bFull = !aGuess.Guess( *this, rInf, Height() );
const bool bFull = !aGuess.Guess( *this, rInf, Height() );
// these are the possible cases:
// A Portion fits to current line
......@@ -372,9 +372,9 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
{
CreateHyphen( rInf, aGuess );
if ( rInf.GetFly() )
rInf.GetRoot()->SetMidHyph( sal_True );
rInf.GetRoot()->SetMidHyph( true );
else
rInf.GetRoot()->SetEndHyph( sal_True );
rInf.GetRoot()->SetEndHyph( true );
}
// case C1
// - Footnote portions with fake line start (i.e., not at beginning of line)
......@@ -441,7 +441,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() ||
rInf.IsFirstMulti() ) &&
( !rInf.GetLast()->IsBlankPortion() || ((SwBlankPortion*)
rInf.GetLast())->MayUnderFlow( rInf, rInf.GetIdx()-1, sal_True )))
rInf.GetLast())->MayUnderFlow( rInf, rInf.GetIdx()-1, true )))
{ // case C1 (former BreakUnderflow())
BreakUnderflow( rInf );
}
......
......@@ -34,7 +34,7 @@ class SwTxtPortion : public SwLinePortion
{
void BreakCut( SwTxtFormatInfo &rInf, const SwTxtGuess &rGuess );
void BreakUnderflow( SwTxtFormatInfo &rInf );
sal_Bool _Format( SwTxtFormatInfo &rInf );
bool _Format( SwTxtFormatInfo &rInf );
public:
inline SwTxtPortion(){ SetWhichPor( POR_TXT ); }
......
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