diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2013-05-18 21:32:34 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2013-05-18 21:45:11 +0900 |
commit | 01d839f257056ed2fb6a79fed3f1d33fdbd76b6e (patch) | |
tree | 83d68add44ae8a274fe9afcc9f53d1b54c0e15a0 /vcl/source/edit | |
parent | e8ad612bf813579f7a3bd4ed32c719ee01c6ce2e (diff) |
sal_Bool to bool
Change-Id: I5bc7eba1ba17162916c016218b8e5f43627ce047
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/textdoc.cxx | 20 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 64 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 4 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 32 | ||||
-rw-r--r-- | vcl/source/edit/xtextedt.cxx | 4 |
5 files changed, 62 insertions, 62 deletions
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index 7c9d28c0ce4b..5ef6cf13dec5 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -73,14 +73,14 @@ void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) const sal_uInt16 nCount = size(); const sal_uInt16 nStart = pAttrib->GetStart(); // maybe better for Comp.Opt. - sal_Bool bInserted = sal_False; + bool bInserted = false; for ( sal_uInt16 x = 0; x < nCount; x++ ) { TextCharAttrib* pCurAttrib = GetAttrib( x ); if ( pCurAttrib->GetStart() > nStart ) { insert( begin() + x, pAttrib ); - bInserted = sal_True; + bInserted = true; break; } } @@ -197,7 +197,7 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) if ( !nNew ) return; - sal_Bool bResort = sal_False; + bool bResort = false; sal_uInt16 nAttribs = maCharAttribs.Count(); for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { @@ -228,7 +228,7 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) pAttrib->Expand( nNew ); } else - bResort = sal_True; + bResort = true; } // 2: attribute starts before and reaches past the index else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -261,13 +261,13 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) if ( !nDeleted ) return; - sal_Bool bResort = sal_False; + bool bResort = false; sal_uInt16 nEndChanges = nIndex+nDeleted; for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); - sal_Bool bDelAttr = sal_False; + bool bDelAttr = false; if ( pAttrib->GetEnd() >= nIndex ) { // move all attributes that are behind the cursor @@ -283,7 +283,7 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) pAttrib->GetEnd() = nIndex; // empty else - bDelAttr = sal_True; + bDelAttr = true; } // 2. attribute starts before, ends inside or after else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -306,7 +306,7 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { - bResort = sal_True; + bResort = true; maCharAttribs.RemoveAttrib( nAttr ); delete pAttrib; nAttr--; @@ -403,7 +403,7 @@ void TextNode::Append( const TextNode& rNode ) for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr ); - sal_Bool bMelted = sal_False; + bool bMelted = false; if ( pAttrib->GetStart() == 0 ) { // potentially merge attributes @@ -419,7 +419,7 @@ void TextNode::Append( const TextNode& rNode ) { pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() + pAttrib->GetLen(); - bMelted = sal_True; + bMelted = true; break; // there can be only one of this type at this position } } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index ce41bfb753e2..7e2186e47da7 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -677,7 +677,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bDoOverwrite = ( bOverwrite && ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False; - sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); + bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); if ( bUndoAction ) UndoActionStart(); @@ -846,7 +846,7 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndin InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) ); TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() ); - sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); + bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len(); TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) ); @@ -1563,7 +1563,7 @@ void TextEngine::FormatDoc() mbHasMultiLineParas = sal_False; long nY = 0; - sal_Bool bGrow = sal_False; + bool bGrow = false; maInvalidRect = Rectangle(); // clear for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ ) @@ -1578,7 +1578,7 @@ void TextEngine::FormatDoc() ImpFormattingParagraph( nPara ); if ( CreateLines( nPara ) ) - bGrow = sal_True; + bGrow = true; // set InvalidRect only once if ( maInvalidRect.IsEmpty() ) @@ -1661,13 +1661,13 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara ) else pTmpLine->SetStartX( mpDoc->GetLeftMargin() ); - sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False; + bool bLineBreak = pNode->GetText().Len() ? true : false; TETextPortion* pDummyPortion = new TETextPortion( 0 ); pDummyPortion->GetWidth() = 0; pTEParaPortion->GetTextPortions().push_back( pDummyPortion ); - if ( bLineBreak == sal_True ) + if ( bLineBreak ) { // -2: The new one is already inserted. OSL_ENSURE( @@ -1715,8 +1715,8 @@ void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, pLine->SetEnd( nBreakPos ); sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos ); - sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) && - ( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False; + bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) && + ( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ); if ( bBlankSeparator ) { // generally suppress blanks at the end of line @@ -1962,7 +1962,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan TextPaM const* pSelEnd = 0; if ( pSelection && pSelection->HasRange() ) { - sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart(); + bool bInvers = pSelection->GetEnd() < pSelection->GetStart(); pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); } @@ -2046,7 +2046,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan } } - sal_Bool bDone = sal_False; + bool bDone = false; if ( pSelStart ) { // is a part of it in the selection? @@ -2089,7 +2089,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } - bDone = sal_True; + bDone = true; } } if ( !bDone ) @@ -2107,7 +2107,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan if ( pSelStart || pPaintRange ) { Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) ); - sal_Bool bDone = sal_False; + bool bDone = false; if ( pSelStart ) { // is the Tab in the Selection??? @@ -2119,7 +2119,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() ); pOutDev->DrawRect( aTabArea ); pOutDev->SetFillColor( aOldColor ); - bDone = sal_True; + bDone = true; } } if ( !bDone ) @@ -2189,7 +2189,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart(); const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff ); - sal_Bool bQuickFormat = sal_False; + bool bQuickFormat = false; if ( pTEParaPortion->GetWritingDirectionInfos().empty() ) ImpInitWritingDirections( nPara ); @@ -2198,14 +2198,14 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) { if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) ) { - bQuickFormat = sal_True; + bQuickFormat = true; } else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) ) { // check if deleting across Portion border sal_uInt16 nStart = nInvalidStart; // duplicate!!! sal_uInt16 nEnd = nStart - nInvalidDiff; // neg. - bQuickFormat = sal_True; + bQuickFormat = true; sal_uInt16 nPos = 0; sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().size(); for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ ) @@ -2215,7 +2215,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) nPos = nPos + pTP->GetLen(); if ( ( nPos > nStart ) && ( nPos < nEnd ) ) { - bQuickFormat = sal_False; + bQuickFormat = false; break; } } @@ -2250,18 +2250,18 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // format all lines starting here size_t nDelFromLine = std::numeric_limits<size_t>::max(); - sal_Bool bLineBreak = sal_False; + bool bLineBreak = false; sal_uInt16 nIndex = pLine->GetStart(); TextLine aSaveLine( *pLine ); Font aFont; - sal_Bool bCalcPortion = sal_True; + bool bCalcPortion = true; while ( nIndex < pNode->GetText().Len() ) { - sal_Bool bEOL = sal_False; + bool bEOL = false; sal_uInt16 nPortionStart = 0; sal_uInt16 nPortionEnd = 0; @@ -2275,8 +2275,8 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // search for Portion that does not fit anymore into line TETextPortion* pPortion = 0; - sal_Bool bBrokenLine = sal_False; - bLineBreak = sal_False; + bool bBrokenLine = false; + bLineBreak = false; while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().size() ) ) { @@ -2294,8 +2294,8 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // adjust Tab pPortion->GetWidth() = nXWidth-1; nTmpWidth = pPortion->GetWidth(); - bEOL = sal_True; - bBrokenLine = sal_True; + bEOL = true; + bBrokenLine = true; } pPortion->GetKind() = PORTIONKIND_TAB; } @@ -2316,25 +2316,25 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) } // this was perhaps one Portion too far - sal_Bool bFixedEnd = sal_False; + bool bFixedEnd = false; if ( nTmpWidth > nXWidth ) { nPortionEnd = nTmpPos; nTmpPos = nTmpPos - pPortion->GetLen(); nPortionStart = nTmpPos; nTmpPortion--; - bEOL = sal_False; + bEOL = false; nTmpWidth -= pPortion->GetWidth(); if ( pPortion->GetKind() == PORTIONKIND_TAB ) { - bEOL = sal_True; - bFixedEnd = sal_True; + bEOL = true; + bFixedEnd = true; } } else { - bEOL = sal_True; + bEOL = true; pLine->SetEnd( nPortionEnd ); OSL_ENSURE(pTEParaPortion->GetTextPortions().size(), "CreateLines: No TextPortions?"); @@ -2410,7 +2410,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) pLine->SetValid(); if ( bCalcPortion && bQuickFormat ) { - bCalcPortion = sal_False; + bCalcPortion = false; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2423,7 +2423,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // the text width does not have to be recalculated. if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) ) { - bCalcPortion = sal_False; + bCalcPortion = false; pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; } @@ -2473,7 +2473,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) DBG_ASSERT( pTEParaPortion->GetLines().size(), "CreateLines: No Line!" ); - if ( bLineBreak == sal_True ) + if ( bLineBreak ) CreateAndInsertEmptyLine( nPara ); pTEParaPortion->SetValid(); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 5b5adde5ef7b..7c370e52ef92 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -129,7 +129,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); - sal_Bool bHTML = GetHTMLStream().Tell() > 0; + bool bHTML = GetHTMLStream().Tell() > 0; uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 ); SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] ); if ( bHTML ) @@ -2186,7 +2186,7 @@ void TextView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDr Point aDocPos = GetDocPos( aMousePos ); mpImpl->mpDDInfo->maDropPos = mpImpl->mpTextEngine->GetPaM( aDocPos ); - sal_Bool bProtected = sal_False; + bool bProtected = false; if(mpImpl->mbSupportProtectAttribute) { const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib( diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index e112fc779597..b83be1d5d652 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -41,7 +41,7 @@ private: ExtTextEngine* mpExtTextEngine; ExtTextView* mpExtTextView; - sal_Bool mbInMBDown; + bool mbInMBDown; sal_Bool mbFocusSelectionHide; sal_Bool mbIgnoreTab; sal_Bool mbActivePopup; @@ -168,14 +168,14 @@ ImpVclMEdit::ImpVclMEdit( VclMultiLineEdit* pEdt, WinBits nWinStyle ) void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) { - const sal_Bool bHaveVScroll = (NULL != mpVScrollBar); - const sal_Bool bHaveHScroll = (NULL != mpHScrollBar); - const sal_Bool bHaveScrollBox = (NULL != mpScrollBox); + const bool bHaveVScroll = (NULL != mpVScrollBar); + const bool bHaveHScroll = (NULL != mpHScrollBar); + const bool bHaveScrollBox = (NULL != mpScrollBox); - sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; - const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; + bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL; + const bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL; - const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; + const bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL; if ( !bNeedVScroll && bAutoVScroll ) { TextEngine& rEngine( *mpTextWindow->GetTextEngine() ); @@ -186,9 +186,9 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) bNeedVScroll = true; } - const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll; + const bool bNeedScrollBox = bNeedVScroll && bNeedHScroll; - sal_Bool bScrollbarsChanged = false; + bool bScrollbarsChanged = false; if ( bHaveVScroll != bNeedVScroll ) { delete mpVScrollBar; @@ -200,7 +200,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) mpVScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) ); } - bScrollbarsChanged = sal_True; + bScrollbarsChanged = true; } if ( bHaveHScroll != bNeedHScroll ) @@ -214,7 +214,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle ) mpHScrollBar->SetScrollHdl( LINK( this, ImpVclMEdit, ScrollHdl ) ); } - bScrollbarsChanged = sal_True; + bScrollbarsChanged = true; } if ( bHaveScrollBox != bNeedScrollBox ) @@ -701,7 +701,7 @@ sal_Bool ImpVclMEdit::HandleCommand( const CommandEvent& rCEvt ) TextWindow::TextWindow( Window* pParent ) : Window( pParent ) { - mbInMBDown = sal_False; + mbInMBDown = false; mbFocusSelectionHide = sal_False; mbIgnoreTab = sal_False; mbActivePopup = sal_False; @@ -742,11 +742,11 @@ void TextWindow::MouseButtonDown( const MouseEvent& rMEvt ) if ( !mbTextSelectable ) return; - mbInMBDown = sal_True; // so that GetFocus does not select everything + mbInMBDown = true; // so that GetFocus does not select everything mpExtTextView->MouseButtonDown( rMEvt ); Window::MouseButtonDown( rMEvt ); GrabFocus(); - mbInMBDown = sal_False; + mbInMBDown = false; } void TextWindow::MouseButtonUp( const MouseEvent& rMEvt ) @@ -1329,8 +1329,8 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& // Border/Background pDev->SetLineColor(); pDev->SetFillColor(); - sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); - sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); + bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER); + bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground(); if ( bBorder || bBackground ) { Rectangle aRect( aPos, aSize ); diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx index a22d88e9f262..ace53c7de387 100644 --- a/vcl/source/edit/xtextedt.cxx +++ b/vcl/source/edit/xtextedt.cxx @@ -139,7 +139,7 @@ sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& TextSelection aSel( rSel ); aSel.Justify(); - sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); TextPaM aStartPaM( aSel.GetEnd() ); if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) ) @@ -301,7 +301,7 @@ sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_ // HideSelection(); TextSelection aSel; - sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); + bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) ); if ( bSearchInSelection ) { aSel = GetSelection(); |