summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-02-02 18:34:46 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-02-03 22:56:54 +0100
commitb3059732a31e0b0a01c9bf69ebd89a8fe4439705 (patch)
tree41ca2bda81cf9f071be81e5ddac858aa553b7905 /sw/source/core
parentc25ebf75e0628c660b1e051a863429b9e5320acc (diff)
sal_Bool to bool
Change-Id: I75ac690e9ad79e08df5682a403296f433a1e7fd5
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/text/itradj.cxx4
-rw-r--r--sw/source/core/text/itrcrsr.cxx16
-rw-r--r--sw/source/core/text/itrtxt.cxx35
-rw-r--r--sw/source/core/text/itrtxt.hxx58
-rw-r--r--sw/source/core/text/txtdrop.cxx4
-rw-r--r--sw/source/core/text/txtftn.cxx2
6 files changed, 59 insertions, 60 deletions
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index b81064a070df..ea9ffe2aaa14 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -47,7 +47,7 @@ void SwTxtAdjuster::FormatBlock( )
const SwLinePortion *pFly = 0;
- sal_Bool bSkip = !IsLastBlock() &&
+ bool bSkip = !IsLastBlock() &&
nStart + pCurr->GetLen() >= GetInfo().GetTxt().getLength();
// Multi-line fields are tricky, because we need to check whether there are
@@ -61,7 +61,7 @@ void SwTxtAdjuster::FormatBlock( )
while( pPor && bSkip )
{
if( pPor->InTxtGrp() )
- bSkip = sal_False;
+ bSkip = false;
pPor = pPor->GetPortion();
}
pLay = bSkip ? pLay->GetNext() : 0;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index e0e681a3a6cf..ffbe4f667450 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -50,7 +50,7 @@
// Not reentrant !!!
// is set in GetCharRect and is interpreted in UnitUp/Down.
-sal_Bool SwTxtCursor::bRightMargin = sal_False;
+bool SwTxtCursor::bRightMargin = false;
/*************************************************************************
@@ -418,11 +418,11 @@ void SwTxtCursor::CtorInitTxtCursor( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
// 1170: Ancient bug: Shift-End forgets the last character ...
-sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const sal_Int32 nOfst,
+bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const sal_Int32 nOfst,
SwCrsrMoveState* pCMS, const long nMax )
{
// 1170: Ambiguity of document positions
- bRightMargin = sal_True;
+ bRightMargin = true;
CharCrsrToLine(nOfst);
// Somehow twisted: nOfst names the position behind the last
@@ -431,7 +431,7 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const sal_Int32 nOfst,
if( nOfst != GetStart() || !pCurr->GetLen() )
{
// 8810: Master line RightMargin, after that LeftMargin
- const sal_Bool bRet = GetCharRect( pOrig, nOfst, pCMS, nMax );
+ const bool bRet = GetCharRect( pOrig, nOfst, pCMS, nMax );
bRightMargin = nOfst >= GetEnd() && nOfst < GetInfo().GetTxt().getLength();
return bRet;
}
@@ -483,7 +483,7 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const sal_Int32 nOfst,
pCMS->aRealHeight.Y() = nPorHeight;
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -899,7 +899,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
pCurr = pOldCurr;
nStart = nOldStart;
nY = nOldY;
- bPrev = sal_False;
+ bPrev = false;
return;
}
@@ -1198,7 +1198,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
* SwTxtCursor::GetCharRect()
*************************************************************************/
-sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
+bool SwTxtCursor::GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
SwCrsrMoveState* pCMS, const long nMax )
{
CharCrsrToLine(nOfst);
@@ -1228,7 +1228,7 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
GetAdjusted();
const Point aCharPos( GetTopLeft() );
- sal_Bool bRet = sal_True;
+ bool bRet = true;
_GetCharRect( pOrig, nFindOfst, pCMS );
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 72d3127f2e4d..d8cba6247063 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -50,10 +50,10 @@ void SwTxtIter::CtorInitTxtIter( SwTxtFrm *pNewFrm, SwTxtInfo *pNewInf )
aLineInf.CtorInitLineInfo( pNode->GetSwAttrSet(), *pNode );
nFrameStart = pFrm->Frm().Pos().Y() + pFrm->Prt().Pos().Y();
SwTxtIter::Init();
- if( pNode->GetSwAttrSet().GetRegister().GetValue() )
- bRegisterOn = pFrm->FillRegister( nRegStart, nRegDiff );
- else
- bRegisterOn = sal_False;
+
+ // Order is important: only execute FillRegister if GetValue!=0
+ bRegisterOn = pNode->GetSwAttrSet().GetRegister().GetValue()
+ && pFrm->FillRegister( nRegStart, nRegDiff );
}
/*************************************************************************
@@ -65,7 +65,7 @@ void SwTxtIter::Init()
pCurr = pInf->GetParaPortion();
nStart = pInf->GetTxtStart();
nY = nFrameStart;
- bPrev = sal_True;
+ bPrev = true;
pPrev = 0;
nLineNr = 1;
}
@@ -87,7 +87,7 @@ void SwTxtIter::CalcAscentAndHeight( KSHORT &rAscent, KSHORT &rHeight ) const
SwLineLayout *SwTxtIter::_GetPrev()
{
pPrev = 0;
- bPrev = sal_True;
+ bPrev = true;
SwLineLayout *pLay = pInf->GetParaPortion();
if( pCurr == pLay )
return 0;
@@ -117,7 +117,7 @@ const SwLineLayout *SwTxtIter::Prev()
_GetPrev();
if( pPrev )
{
- bPrev = sal_False;
+ bPrev = false;
pCurr = pPrev;
nStart = nStart - pCurr->GetLen();
nY = nY - GetLineHeight();
@@ -138,7 +138,7 @@ const SwLineLayout *SwTxtIter::Next()
if(pCurr->GetNext())
{
pPrev = pCurr;
- bPrev = sal_True;
+ bPrev = true;
nStart = nStart + pCurr->GetLen();
nY += GetLineHeight();
if( pCurr->GetLen() || ( nLineNr>1 && !pCurr->IsDummy() ) )
@@ -259,11 +259,11 @@ const SwLineLayout *SwTxtCursor::CharCrsrToLine( const sal_Int32 nPosition )
{
CharToLine( nPosition );
if( nPosition != nStart )
- bRightMargin = sal_False;
- sal_Bool bPrevious = bRightMargin && pCurr->GetLen() && GetPrev() &&
+ bRightMargin = false;
+ bool bPrevious = bRightMargin && pCurr->GetLen() && GetPrev() &&
GetPrev()->GetLen();
if( bPrevious && nPosition && CH_BREAK == GetInfo().GetChar( nPosition-1 ) )
- bPrevious = sal_False;
+ bPrevious = false;
return bPrevious ? PrevLine() : pCurr;
}
@@ -274,7 +274,7 @@ const SwLineLayout *SwTxtCursor::CharCrsrToLine( const sal_Int32 nPosition )
sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
const SwLinePortion* pPor,
sal_uInt16 nPorHeight, sal_uInt16 nPorAscent,
- const sal_Bool bAutoToCentered ) const
+ const bool bAutoToCentered ) const
{
if ( pPor )
{
@@ -285,12 +285,11 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
sal_uInt16 nOfst = rLine.GetRealHeight() - rLine.Height();
GETGRID( pFrm->FindPageFrm() )
- const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
- if ( bHasGrid )
+ if ( pGrid && GetInfo().SnapToGrid() )
{
const sal_uInt16 nRubyHeight = pGrid->GetRubyHeight();
- const sal_Bool bRubyTop = ! pGrid->GetRubyTextBelow();
+ const bool bRubyTop = ! pGrid->GetRubyTextBelow();
if ( GetInfo().IsMulti() )
// we are inside the GetCharRect recursion for multi portions
@@ -315,7 +314,7 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
// nGridWidth;
nOfst += ( nLineNetto - nPorHeight ) / 2;
if ( bRubyTop )
- nOfst = nOfst + nRubyHeight;
+ nOfst += nRubyHeight;
}
}
}
@@ -368,10 +367,10 @@ const SwLineLayout *SwTxtIter::TwipsToLine( const SwTwips y)
//
// Local helper function to check, if pCurr needs a field rest portion:
//
-static sal_Bool lcl_NeedsFieldRest( const SwLineLayout* pCurr )
+static bool lcl_NeedsFieldRest( const SwLineLayout* pCurr )
{
const SwLinePortion *pPor = pCurr->GetPortion();
- sal_Bool bRet = sal_False;
+ bool bRet = false;
while( pPor && !bRet )
{
bRet = pPor->InFldGrp() && ((SwFldPortion*)pPor)->HasFollow();
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 6a194a02cdde..5f3d27b89e97 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -46,11 +46,11 @@ protected:
sal_Int32 nStart; // Start in the text string, end = pCurr->GetLen()
KSHORT nRegDiff; // Register's line distance
MSHORT nLineNr; // Line number
- sal_Bool bPrev : 1;
- sal_Bool bRegisterOn : 1; // Keep in register
- sal_Bool bOneBlock : 1; // Justified text: Dispose single words
- sal_Bool bLastBlock : 1; // Justified text: Also the last line
- sal_Bool bLastCenter : 1; // Justified text: Center last line
+ bool bPrev : 1;
+ bool bRegisterOn : 1; // Keep in register
+ bool bOneBlock : 1; // Justified text: Dispose single words
+ bool bLastBlock : 1; // Justified text: Also the last line
+ bool bLastCenter : 1; // Justified text: Center last line
SwLineLayout *_GetPrev();
@@ -69,18 +69,18 @@ protected:
, nStart(0)
, nRegDiff(0)
, nLineNr(0)
- , bPrev(sal_False)
- , bRegisterOn(sal_False)
- , bOneBlock(sal_False)
- , bLastBlock(sal_False)
- , bLastCenter(sal_False)
+ , bPrev(false)
+ , bRegisterOn(false)
+ , bOneBlock(false)
+ , bLastBlock(false)
+ , bLastCenter(false)
{}
public:
inline SwTxtIter( SwTxtFrm *pTxtFrm, SwTxtInfo *pTxtInf )
: SwAttrIter( pTxtFrm != NULL ? pTxtFrm->GetTxtNode() : NULL)
- , bOneBlock(sal_False)
- , bLastBlock(sal_False)
- , bLastCenter(sal_False)
+ , bOneBlock(false)
+ , bLastBlock(false)
+ , bLastCenter(false)
{
CtorInitTxtIter( pTxtFrm, pTxtInf );
}
@@ -95,7 +95,7 @@ public:
inline SwTwips RegStart() const { return nRegStart; }
inline KSHORT RegDiff() const { return nRegDiff; }
- inline sal_Bool IsRegisterOn() const { return bRegisterOn; }
+ inline bool IsRegisterOn() const { return bRegisterOn; }
inline SwTxtInfo &GetInfo() { return *pInf; }
inline const SwTxtInfo &GetInfo() const { return *pInf; }
@@ -131,9 +131,9 @@ public:
const SwLineInfo &GetLineInfo() const { return aLineInf; }
inline SwTwips GetFirstPos() const { return nFrameStart; }
- inline sal_Bool SeekAndChg( SwTxtSizeInfo &rInf );
- inline sal_Bool SeekAndChgBefore( SwTxtSizeInfo &rInf );
- inline sal_Bool SeekStartAndChg( SwTxtSizeInfo &rInf, const sal_Bool bPara=sal_False );
+ inline bool SeekAndChg( SwTxtSizeInfo &rInf );
+ inline bool SeekAndChgBefore( SwTxtSizeInfo &rInf );
+ inline bool SeekStartAndChg( SwTxtSizeInfo &rInf, const bool bPara=false );
inline SwTxtFrm *GetTxtFrm() { return pFrm; }
inline const SwTxtFrm *GetTxtFrm() const { return pFrm; }
@@ -193,9 +193,9 @@ public:
SwTwips GetLineStart() const;
inline SwTwips GetLineEnd() const { return GetLineStart() + CurrWidth(); }
inline Point GetTopLeft() const { return Point( GetLineStart(), Y() ); }
- inline sal_Bool IsOneBlock() const { return bOneBlock; }
- inline sal_Bool IsLastBlock() const { return bLastBlock; }
- inline sal_Bool IsLastCenter() const { return bLastCenter; }
+ inline bool IsOneBlock() const { return bOneBlock; }
+ inline bool IsLastBlock() const { return bLastBlock; }
+ inline bool IsLastCenter() const { return bLastCenter; }
inline MSHORT GetAdjust() const { return nAdjust; }
inline KSHORT GetLineWidth() const
{ return KSHORT( Right() - GetLeftMargin() + 1 ); }
@@ -285,7 +285,7 @@ class SwTxtCursor : public SwTxtAdjuster
friend class SwTxtCursorSave;
// Ambiguities
- static sal_Bool bRightMargin;
+ static bool bRightMargin;
void _GetCharRect(SwRect *, const sal_Int32, SwCrsrMoveState* );
protected:
void CtorInitTxtCursor( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
@@ -293,9 +293,9 @@ protected:
public:
inline SwTxtCursor( SwTxtFrm *pTxtFrm, SwTxtSizeInfo *pTxtSizeInf ) : SwTxtAdjuster(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
{ CtorInitTxtCursor( pTxtFrm, pTxtSizeInf ); }
- sal_Bool GetCharRect(SwRect *, const sal_Int32, SwCrsrMoveState* = 0,
+ bool GetCharRect(SwRect *, const sal_Int32, SwCrsrMoveState* = 0,
const long nMax = 0 );
- sal_Bool GetEndCharRect(SwRect *, const sal_Int32, SwCrsrMoveState* = 0,
+ bool GetEndCharRect(SwRect *, const sal_Int32, SwCrsrMoveState* = 0,
const long nMax = 0 );
sal_Int32 GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
const MSHORT nChgNode, SwCrsrMoveState* = 0 ) const;
@@ -306,10 +306,10 @@ public:
// bAutoToCentered indicates, if AUTOMATIC mode means CENTERED or BASELINE
sal_uInt16 AdjustBaseLine( const SwLineLayout& rLine, const SwLinePortion* pPor,
sal_uInt16 nPorHeight = 0, sal_uInt16 nAscent = 0,
- const sal_Bool bAutoToCentered = sal_False ) const;
+ const bool bAutoToCentered = false ) const;
- static inline void SetRightMargin( const sal_Bool bNew ){ bRightMargin = bNew; }
- static inline sal_Bool IsRightMargin() { return bRightMargin; }
+ static inline void SetRightMargin( const bool bNew ){ bRightMargin = bNew; }
+ static inline bool IsRightMargin() { return bRightMargin; }
};
/*************************************************************************
@@ -333,12 +333,12 @@ public:
* Inline implementation
*************************************************************************/
-inline sal_Bool SwTxtIter::SeekAndChg( SwTxtSizeInfo &rInf )
+inline bool SwTxtIter::SeekAndChg( SwTxtSizeInfo &rInf )
{
return SeekAndChgAttrIter( rInf.GetIdx(), rInf.GetOut() );
}
-inline sal_Bool SwTxtIter::SeekAndChgBefore( SwTxtSizeInfo &rInf )
+inline bool SwTxtIter::SeekAndChgBefore( SwTxtSizeInfo &rInf )
{
if ( rInf.GetIdx() )
return SeekAndChgAttrIter( rInf.GetIdx()-1, rInf.GetOut() );
@@ -346,7 +346,7 @@ inline sal_Bool SwTxtIter::SeekAndChgBefore( SwTxtSizeInfo &rInf )
return SeekAndChgAttrIter( rInf.GetIdx(), rInf.GetOut() );
}
-inline sal_Bool SwTxtIter::SeekStartAndChg( SwTxtSizeInfo &rInf, const sal_Bool bPara )
+inline bool SwTxtIter::SeekStartAndChg( SwTxtSizeInfo &rInf, const bool bPara )
{
return SeekStartAndChgAttrIter( rInf.GetOut(), bPara );
}
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 23738a6d5387..3686c299c9ab 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -490,8 +490,8 @@ void SwTxtFormatter::CalcDropHeight( const MSHORT nLines )
KSHORT nAscent = 0;
KSHORT nHeight = 0;
KSHORT nDropLns = 0;
- sal_Bool bRegisterOld = IsRegisterOn();
- bRegisterOn = sal_False;
+ const bool bRegisterOld = IsRegisterOn();
+ bRegisterOn = false;
Top();
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 47f3c1354a08..6e66808662d8 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1117,7 +1117,7 @@ sal_Int32 SwTxtFormatter::FormatQuoVadis( const sal_Int32 nOffset )
// Wir initialisieren uns also:
// ResetFont();
FeedInf( rInf );
- SeekStartAndChg( rInf, sal_True );
+ SeekStartAndChg( rInf, true );
if( GetRedln() && pCurr->HasRedline() )
GetRedln()->Seek( *pFnt, nOffset, 0 );