diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-23 18:30:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-23 18:39:07 +0200 |
commit | 22401181774dfb3882e7ad0335f1267d7885ff48 (patch) | |
tree | cc31d4ef17eef1e76458e47cef8675458c8719ea /editeng/source | |
parent | 6425f7ff616f9aaad8b4e279385ed3f5ab65bfe2 (diff) |
Improved loplugin:literaltoboolconversion looking into cond. exprs.
...automatic rewriter fixes
Change-Id: I6b04ca80f08f8a71ff94e309fd52f44d736751ee
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 16 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 12 | ||||
-rw-r--r-- | editeng/source/items/bulitem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/paperinf.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/paraitem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/misc/txtrange.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/paralist.cxx | 6 |
13 files changed, 33 insertions, 33 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 4d67332c4829..5ca790b829c3 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -3085,7 +3085,7 @@ SvStream& EditEngineItemPool::Store( SvStream& rStream ) const long nVersion = rStream.GetVersion(); bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) - ? sal_True : sal_False; + ? true : false; EditEngineItemPool* pThis = const_cast<EditEngineItemPool*>(this); if ( b31Format ) diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 61e8a34854cd..bfc2df22e55c 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -70,12 +70,12 @@ struct EPaM inline bool EPaM::operator < ( const EPaM& r ) const { return ( ( nPara < r.nPara ) || - ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? sal_True : sal_False; + ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? true : false; } inline bool EPaM::operator == ( const EPaM& r ) const { - return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? sal_True : sal_False; + return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? true : false; } struct ScriptTypePosInfo @@ -546,7 +546,7 @@ public: void SetInvalid() { bInvalid = true; } void SetValid() { bInvalid = false; } - bool IsEmpty() const { return (nEnd > nStart) ? sal_False : sal_True; } + bool IsEmpty() const { return (nEnd > nStart) ? false : true; } CharPosArrayType& GetCharPosArray() { return aPositions;} const CharPosArrayType& GetCharPosArray() const { return aPositions;} diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index e3ab1dbe398f..db79813c9b41 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -127,12 +127,12 @@ SvParserState EditRTFParser::CallParser() // Problem: Paragraph attributes may not possibly be taken over // => Do Character attributes. - bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True; + bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? false : true; if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() ) mpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() ); aCurSel.Min() = mpEditEngine->ConnectParagraphs( aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward ); - bSpecialBackward = aEnd1PaM.GetNode()->Len() ? sal_True : sal_False; + bSpecialBackward = aEnd1PaM.GetNode()->Len() ? true : false; // when bOnlyOnePara, then the node is gone on Connect. if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() ) mpEditEngine->ParaAttribsToCharAttribs( aEnd2PaM.GetNode() ); diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 118fc01d27d1..e8dd94a96f22 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -945,7 +945,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 unsigned char nCursorDir = CURSOR_DIRECTION_NONE; if ( IsInsertMode() && !aEditSelection.HasRange() && ( pEditEngine->pImpEditEngine->HasDifferentRTLLevels( aPaM.GetNode() ) ) ) { - sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, nShowCursorFlags & GETCRSR_PREFERPORTIONSTART ? sal_True : sal_False ); + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, nShowCursorFlags & GETCRSR_PREFERPORTIONSTART ? true : false ); const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; sal_uInt16 nRTLLevel = pTextPortion->GetRightToLeft(); if ( nRTLLevel%2 ) @@ -1556,7 +1556,7 @@ bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) SetEditSelection( aNewEditSelection ); } - bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); + bool bForceCursor = ( pDragAndDropInfo ? false : true ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); ShowCursor( bGotoCursor, bForceCursor ); return true; } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 45dc28a27123..328f62218ee9 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -525,7 +525,7 @@ private: void InsertUndo( EditUndo* pUndo, bool bTryMerge = false ); void ResetUndoManager(); - bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } + bool HasUndoManager() const { return pUndoManager ? true : false; } EditUndoSetAttribs* CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index b0593cde7b6b..1de08af8e87e 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -763,7 +763,7 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection ); - bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; + bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? true : false; sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); if ( DoVisualCursorTraveling( aPaM.GetNode() ) ) @@ -954,7 +954,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, true ); const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; sal_Int32 nRTLLevel = pTextPortion->GetRightToLeft(); - bool bPortionRTL = (nRTLLevel%2) ? sal_True : sal_False; + bool bPortionRTL = (nRTLLevel%2) ? true : false; if ( bStart ) { @@ -1026,7 +1026,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM if ( bPortionBoundary && aPaM.GetIndex() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) { sal_Int32 nTmp; - sal_Int32 nNextTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, bLogicalBackward ? sal_False : sal_True ); + sal_Int32 nNextTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, bLogicalBackward ? false : true ); const TextPortion* pNextTextPortion = pParaPortion->GetTextPortions()[nNextTextPortion]; nRTLLevelNextPortion = pNextTextPortion->GetRightToLeft(); } @@ -2374,7 +2374,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n // Decide now if to delete selection (RESTOFCONTENTS) bool bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) - ? sal_True : sal_False; + ? true : false; if ( aStatus.IsAnyOutliner() ) bSpecialBackward = false; @@ -2550,7 +2550,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, EditPaM aPaM( rCurSel.Min() ); bool bDoOverwrite = ( bOverwrite && - ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? sal_True : sal_False; + ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? true : false; bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); @@ -2626,7 +2626,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c)); - bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; + bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? true : false; InsertUndo( pNewUndo, bTryMerge ); } @@ -4151,7 +4151,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, if (nLineCount == 0) return Rectangle(); const EditLine* pLine = NULL; - bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? sal_True : sal_False; + bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? true : false; for (sal_Int32 nLine = 0; nLine < nLineCount; ++nLine) { const EditLine* pTmpLine = pPortion->GetLines()[nLine]; @@ -4199,7 +4199,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, } else { - nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) ? sal_True : sal_False ); + nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) ? true : false ); } aEditCursor.Left() = aEditCursor.Right() = nX; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index eb9f2ebb9265..0cc08265e92a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1818,7 +1818,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te nBreakPos++; } - bHangingPunctuation = ( nBreakPos > nMaxBreakPos ) ? sal_True : sal_False; + bHangingPunctuation = ( nBreakPos > nMaxBreakPos ) ? true : false; pLine->SetHangingPunctuation( bHangingPunctuation ); // Whether a separator or not, push the word after the separator through @@ -2526,7 +2526,7 @@ void ImpEditEngine::SetVertical( bool bVertical ) if ( IsVertical() != bVertical ) { GetEditDoc().SetVertical( bVertical ); - bool bUseCharAttribs = ( aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS ) ? sal_True : sal_False; + bool bUseCharAttribs = ( aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS ) ? true : false; GetEditDoc().CreateDefFont( bUseCharAttribs ); if ( IsFormatted() ) { @@ -4327,7 +4327,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, short nScriptType = GetI18NScriptType( EditPaM( pNode, nIndex+1 ) ); bCTL = nScriptType == i18n::ScriptType::COMPLEX; // this change was discussed in issue 37190 - bR2L = (GetRightToLeft( nPara, nIndex + 1) % 2) ? sal_True : sal_False; + bR2L = (GetRightToLeft( nPara, nIndex + 1) % 2) ? true : false; // it also works for issue 55927 } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 6067a908d88c..5effa6ebd3ef 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -270,7 +270,7 @@ bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_I WriteItemAsRTF( *pAttrItem, rOutput, nPara, nPos,rFontTable, rColorList ); pAttrItem = rLst.Next(); } - return ( rLst.Count() ? sal_True : sal_False ); + return ( rLst.Count() ? true : false ); } static void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_Int32 nIndex, sal_uInt16 nScriptType ) @@ -1031,7 +1031,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool bool bOnlyFullParagraphs = ( aSel.Min().GetIndex() || ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ) ? - sal_False : sal_True; + false : true; // Templates are not saved! // (Only the name and family, template itself must be in App!) @@ -1053,7 +1053,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool sal_Int32 nStartPos = 0; sal_Int32 nEndPos = pNode->Len(); - bool bEmptyPara = nEndPos ? sal_False : sal_True; + bool bEmptyPara = nEndPos ? false : true; if ( ( nNode == nStartNode ) && !bOnlyFullParagraphs ) nStartPos = aSel.Min().GetIndex(); @@ -1233,7 +1233,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject for (sal_Int32 n = 0; n < nContents; ++n, ++nPara) { const ContentInfo* pC = &rTextObject.mpImpl->GetContents()[n]; - bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True; + bool bNewContent = aPaM.GetNode()->Len() ? false: true; const sal_Int32 nStartPos = aPaM.GetIndex(); aPaM = ImpFastInsertText( aPaM, pC->GetText() ); @@ -1243,7 +1243,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject pPortion->MarkInvalid( nStartPos, pC->GetText().getLength() ); // Character attributes ... - bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? sal_True : sal_False; + bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? true : false; size_t nNewAttribs = pC->GetAttribs().size(); if ( nNewAttribs ) { @@ -1302,7 +1302,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject { // only style and ParaAttribs when new paragraph, or // completely internal ... - bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False; + bParaAttribs = pC->GetParaAttribs().Count() ? true : false; if ( GetStyleSheetPool() && pC->GetStyle().getLength() ) { SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() )); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index b06466729bf4..f02266a20c53 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -127,7 +127,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) const sal_Size nOldPos = rStrm.Tell(); // Ignore Errorcode when reading Bitmap, // see comment in SvxBulletItem::Store() - bool bOldError = rStrm.GetError() ? sal_True : sal_False; + bool bOldError = rStrm.GetError() ? true : false; ReadDIB(aBmp, rStrm, true); if ( !bOldError && rStrm.GetError() ) diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 579c7ae4a88f..398c8aa11121 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -29,7 +29,7 @@ inline bool IsValidPrinter( const Printer* pPtr ) { - return pPtr->GetName().isEmpty() ? sal_False : sal_True; + return pPtr->GetName().isEmpty() ? false : true; } diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 2f9ed1619b57..2f826de3f75a 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -100,7 +100,7 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const && nPropLineSpace == rLineSpace.nPropLineSpace) || (eInterLineSpace == SVX_INTER_LINE_SPACE_FIX && (nInterLineSpace == rLineSpace.nInterLineSpace)))) ? - 1 : 0; + true : false; } /* Who does still know why the LineSpacingItem is so complicated? diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index 6d7d67deb365..6293cbb366a5 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -257,7 +257,7 @@ void SvxBoundArgs::NoteRange( bool bToggle ) DBG_ASSERT( nCount == 2 * aBoolArr.size(), "NoteRange: Incompatible Sizes" ); while( nIdx < nCount && (*pLongArr)[ nIdx ] < nMin ) ++nIdx; - bool bOdd = (nIdx % 2) ? sal_True : sal_False; + bool bOdd = (nIdx % 2) ? true : false; // No overlap with existing intervals? if( nIdx == nCount || ( !bOdd && nMax < (*pLongArr)[ nIdx ] ) ) { // Then a new one is inserted ... diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx index d4a9e13fe9f7..576643362cff 100644 --- a/editeng/source/outliner/paralist.cxx +++ b/editeng/source/outliner/paralist.cxx @@ -166,21 +166,21 @@ bool ParagraphList::HasChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? sal_True : sal_False; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? true : false; } bool ParagraphList::HasHiddenChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? sal_True : sal_False; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? true : false; } bool ParagraphList::HasVisibleChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? sal_True : sal_False; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? true : false; } sal_Int32 ParagraphList::GetChildCount( Paragraph* pParent ) const |