summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx2
-rw-r--r--editeng/source/editeng/editdoc.cxx5
-rw-r--r--editeng/source/editeng/editdoc.hxx7
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/editobj.cxx4
-rw-r--r--editeng/source/editeng/edtspell.cxx2
-rw-r--r--editeng/source/editeng/eehtml.cxx2
-rw-r--r--editeng/source/editeng/eertfpar.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx4
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx19
-rw-r--r--editeng/source/editeng/impedit3.cxx8
-rw-r--r--editeng/source/editeng/impedit4.cxx15
-rw-r--r--editeng/source/items/bulitem.cxx2
-rw-r--r--editeng/source/items/numitem.cxx2
-rw-r--r--editeng/source/items/paperinf.cxx2
-rw-r--r--editeng/source/items/paraitem.cxx5
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx4
-rw-r--r--editeng/source/misc/txtrange.cxx2
-rw-r--r--editeng/source/outliner/outliner.cxx2
-rw-r--r--editeng/source/outliner/paralist.cxx6
-rw-r--r--include/editeng/svxacorr.hxx2
23 files changed, 50 insertions, 55 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 53ca25fdb06b..f2714fb01023 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1625,7 +1625,7 @@ namespace accessibility
if (rRes.Name == "NumberingRules")
{
SfxItemSet aAttribs = rCacheTF.GetParaAttribs(GetParagraphIndex());
- bool bVis = static_cast<const SfxUInt16Item&>(aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? true : false;
+ bool bVis = static_cast<const SfxUInt16Item&>(aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() != 0;
if(bVis)
{
rRes.Value <<= (sal_Int16)-1;
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 5ca790b829c3..c8f5f3d2412e 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1973,7 +1973,7 @@ EditDoc::EditDoc( SfxItemPool* pPool ) :
nDefTab(DEFTAB),
bIsVertical(false),
bIsFixedCellHeight(false),
- bOwnerOfPool(pPool ? false : true),
+ bOwnerOfPool(pPool == nullptr),
bModified(false)
{
// Don't create a empty node, Clear() will be called in EditEngine-CTOR
@@ -3084,8 +3084,7 @@ SvStream& EditEngineItemPool::Store( SvStream& rStream ) const
// stored until then...
long nVersion = rStream.GetVersion();
- bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) )
- ? true : false;
+ bool b31Format = nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 );
EditEngineItemPool* pThis = const_cast<EditEngineItemPool*>(this);
if ( b31Format )
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index bfc2df22e55c..136d94d04dfd 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -69,13 +69,12 @@ struct EPaM
inline bool EPaM::operator < ( const EPaM& r ) const
{
- return ( ( nPara < r.nPara ) ||
- ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? true : false;
+ return ( nPara < r.nPara ) || ( ( nPara == r.nPara ) && nIndex < r.nIndex );
}
inline bool EPaM::operator == ( const EPaM& r ) const
{
- return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? true : false;
+ return ( nPara == r.nPara ) && ( nIndex == r.nIndex );
}
struct ScriptTypePosInfo
@@ -546,7 +545,7 @@ public:
void SetInvalid() { bInvalid = true; }
void SetValid() { bInvalid = false; }
- bool IsEmpty() const { return (nEnd > nStart) ? false : true; }
+ bool IsEmpty() const { return nEnd <= nStart; }
CharPosArrayType& GetCharPosArray() { return aPositions;}
const CharPosArrayType& GetCharPosArray() const { return aPositions;}
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 70a012bb85e8..e1b0cd615b7a 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1123,7 +1123,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
sal_Int32 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode );
SfxBoolItem aBulletState( static_cast<const SfxBoolItem&>( pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ) );
- bool bBulletIsVisible = aBulletState.GetValue() ? true : false;
+ bool bBulletIsVisible = aBulletState.GetValue();
// just toggling EE_PARA_BULLETSTATE should be fine for both cases...
aBulletState.SetValue( !bBulletIsVisible );
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index c62dbb68458a..d5ccaa67ebbd 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -395,7 +395,7 @@ bool EditTextObject::Store( SvStream& rOStream ) const
rOStream.WriteUInt32( nStructSz );
rOStream.Seek( nEndPos );
- return rOStream.GetError() ? false : true;
+ return rOStream.GetError() == 0;
}
EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool )
@@ -756,7 +756,7 @@ void EditTextObjectImpl::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttr
bool EditTextObjectImpl::IsFieldObject() const
{
- return GetField() ? true : false;
+ return GetField() != nullptr;
}
const SvxFieldItem* EditTextObjectImpl::GetField() const
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 8993d3448b33..8b50d9f58e55 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -701,7 +701,7 @@ OUString const* EdtAutoCorrDoc::GetPrevPara(bool const)
// Special case: Bullet => Paragraph start => simply return NULL...
const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>(
mpEditEngine->GetParaAttrib( nPos, EE_PARA_BULLETSTATE ));
- bool bBullet = rBulletState.GetValue() ? true : false;
+ bool bBullet = rBulletState.GetValue();
if ( !bBullet && (mpEditEngine->GetControlWord() & EEControlBits::OUTLINER) )
{
// The Outliner has still a Bullet at Level 0.
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 15d8c59f54cd..2ef23c72046c 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -759,7 +759,7 @@ bool EditHTMLParser::ThrowAwayBlank()
bool EditHTMLParser::HasTextInCurrentPara()
{
- return aCurSel.Max().GetNode()->Len() ? true : false;
+ return aCurSel.Max().GetNode()->Len() != 0;
}
void EditHTMLParser::AnchorStart()
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index db79813c9b41..4af756cbf0c1 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() ? false : true;
+ bool bSpecialBackward = aStart1PaM.GetNode()->Len() == 0;
if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() )
mpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() );
aCurSel.Min() = mpEditEngine->ConnectParagraphs(
aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward );
- bSpecialBackward = aEnd1PaM.GetNode()->Len() ? true : false;
+ bSpecialBackward = aEnd1PaM.GetNode()->Len() != 0;
// 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 e8dd94a96f22..6805c60de4ff 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 ? true : false );
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, (nShowCursorFlags & GETCRSR_PREFERPORTIONSTART) != 0 );
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 ? false : true ) && !pEditEngine->pImpEditEngine->IsInSelectionMode();
+ bool bForceCursor = pDragAndDropInfo == nullptr && !pEditEngine->pImpEditEngine->IsInSelectionMode();
ShowCursor( bGotoCursor, bForceCursor );
return true;
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 328f62218ee9..23ac30e6538d 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 ? true : false; }
+ bool HasUndoManager() const { return pUndoManager != nullptr; }
EditUndoSetAttribs* CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 1de08af8e87e..732264986921 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() ? true : false;
+ bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1();
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) ? true : false;
+ bool bPortionRTL = (nRTLLevel%2) != 0;
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 ? false : true );
+ sal_Int32 nNextTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, !bLogicalBackward );
const TextPortion* pNextTextPortion = pParaPortion->GetTextPortions()[nNextTextPortion];
nRTLLevelNextPortion = pNextTextPortion->GetRightToLeft();
}
@@ -2373,8 +2373,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n
return ImpDeleteSelection( EditSelection( aDelStart, aDelEnd ) );
// Decide now if to delete selection (RESTOFCONTENTS)
- bool bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) )
- ? true : false;
+ bool bSpecialBackward = ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE );
if ( aStatus.IsAnyOutliner() )
bSpecialBackward = false;
@@ -2549,8 +2548,8 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel,
EditPaM aPaM( rCurSel.Min() );
- bool bDoOverwrite = ( bOverwrite &&
- ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? true : false;
+ bool bDoOverwrite = bOverwrite &&
+ ( aPaM.GetIndex() < aPaM.GetNode()->Len() );
bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
@@ -2626,7 +2625,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel,
if ( IsUndoEnabled() && !IsInUndo() )
{
EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c));
- bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? true : false;
+ bool bTryMerge = !bDoOverwrite && ( c != ' ' );
InsertUndo( pNewUndo, bTryMerge );
}
@@ -4151,7 +4150,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex,
if (nLineCount == 0)
return Rectangle();
const EditLine* pLine = NULL;
- bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? true : false;
+ bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) != 0;
for (sal_Int32 nLine = 0; nLine < nLineCount; ++nLine)
{
const EditLine* pTmpLine = pPortion->GetLines()[nLine];
@@ -4199,7 +4198,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex,
}
else
{
- nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) ? true : false );
+ nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) != 0 );
}
aEditCursor.Left() = aEditCursor.Right() = nX;
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 0cc08265e92a..9dca951d8208 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 ) ? true : false;
+ bHangingPunctuation = nBreakPos > nMaxBreakPos;
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 ) ? true : false;
+ bool bUseCharAttribs = bool(aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS);
GetEditDoc().CreateDefFont( bUseCharAttribs );
if ( IsFormatted() )
{
@@ -2967,7 +2967,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
// Remember whether a bullet was painted.
const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>(
pEditEngine->GetParaAttrib(n, EE_PARA_BULLETSTATE));
- bPaintBullet = rBulletState.GetValue() ? true : false;
+ bPaintBullet = rBulletState.GetValue();
}
@@ -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) ? true : false;
+ bR2L = (GetRightToLeft( nPara, nIndex + 1) % 2) != 0;
// it also works for issue 55927
}
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 5effa6ebd3ef..39c147ef2747 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() ? true : false );
+ return rLst.Count() != 0;
}
static void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_Int32 nIndex, sal_uInt16 nScriptType )
@@ -1029,9 +1029,8 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool
nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
- bool bOnlyFullParagraphs = ( aSel.Min().GetIndex() ||
- ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ) ?
- false : true;
+ bool bOnlyFullParagraphs = !( aSel.Min().GetIndex() ||
+ ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) );
// Templates are not saved!
// (Only the name and family, template itself must be in App!)
@@ -1053,7 +1052,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool
sal_Int32 nStartPos = 0;
sal_Int32 nEndPos = pNode->Len();
- bool bEmptyPara = nEndPos ? false : true;
+ bool bEmptyPara = nEndPos == 0;
if ( ( nNode == nStartNode ) && !bOnlyFullParagraphs )
nStartPos = aSel.Min().GetIndex();
@@ -1233,7 +1232,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() ? false: true;
+ bool bNewContent = aPaM.GetNode()->Len() == 0;
const sal_Int32 nStartPos = aPaM.GetIndex();
aPaM = ImpFastInsertText( aPaM, pC->GetText() );
@@ -1243,7 +1242,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
pPortion->MarkInvalid( nStartPos, pC->GetText().getLength() );
// Character attributes ...
- bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? true : false;
+ bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() != 0;
size_t nNewAttribs = pC->GetAttribs().size();
if ( nNewAttribs )
{
@@ -1302,7 +1301,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
{
// only style and ParaAttribs when new paragraph, or
// completely internal ...
- bParaAttribs = pC->GetParaAttribs().Count() ? true : false;
+ bParaAttribs = pC->GetParaAttribs().Count() != 0;
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 f02266a20c53..b86a5a64ce37 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() ? true : false;
+ bool bOldError = rStrm.GetError() != 0;
ReadDIB(aBmp, rStrm, true);
if ( !bOldError && rStrm.GetError() )
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 0e4e0f8d3ecf..be252b460e6e 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -796,7 +796,7 @@ void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, bool bI
if (!bReplace)
{
const SvxNumberFormat *pFmt = Get(i);
- bReplace = pFmt ? rNumFmt != *pFmt : true;
+ bReplace = pFmt == nullptr || rNumFmt != *pFmt;
}
if (bReplace)
diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx
index 398c8aa11121..dd83f990647b 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() ? false : true;
+ return !pPtr->GetName().isEmpty();
}
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 2f826de3f75a..758e2480ccda 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -86,7 +86,7 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
const SvxLineSpacingItem& rLineSpace = static_cast<const SvxLineSpacingItem&>(rAttr);
- return (
+ return
// Same Linespacing Rule?
(eLineSpace == rLineSpace.eLineSpace)
// For maximum and minimum Linespacing be the size must coincide.
@@ -99,8 +99,7 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const
|| (eInterLineSpace == SVX_INTER_LINE_SPACE_PROP
&& nPropLineSpace == rLineSpace.nPropLineSpace)
|| (eInterLineSpace == SVX_INTER_LINE_SPACE_FIX
- && (nInterLineSpace == rLineSpace.nInterLineSpace)))) ?
- true : false;
+ && (nInterLineSpace == rLineSpace.nInterLineSpace)));
}
/* Who does still know why the LineSpacingItem is so complicated?
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index f96974a5b124..ea6c1f0eee61 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -247,7 +247,7 @@ namespace editeng
, m_nConvOptions(_nOptions)
, m_bIsInteractive( _bIsInteractive )
, m_pAntiImpl( _pAntiImpl )
- , m_bByCharacter((_nOptions & CHARACTER_BY_CHARACTER) ? true : false)
+ , m_bByCharacter((_nOptions & CHARACTER_BY_CHARACTER) != 0)
, m_eConversionFormat( HHC::eSimpleConversion)
, m_ePrimaryConversionDirection( HHC::eHangulToHanja) // used for eConvHangulHanja
, m_eCurrentConversionDirection( HHC::eHangulToHanja) // used for eConvHangulHanja
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 1397bbfb54b1..59b0463d687a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1488,7 +1488,7 @@ bool SvxAutoCorrect::AddCplSttException( const OUString& rNew,
pLists = pLangTable->find(aLangTagUndetermined)->second;
}
OSL_ENSURE(pLists, "No auto correction data");
- return pLists ? pLists->AddToCplSttExceptList(rNew) : false;
+ return pLists && pLists->AddToCplSttExceptList(rNew);
}
// Adds a single word. The list will immediately be written to the file!
@@ -1510,7 +1510,7 @@ bool SvxAutoCorrect::AddWrtSttException( const OUString& rNew,
pLists = pLangTable->find(aLangTagUndetermined)->second;
}
OSL_ENSURE(pLists, "No auto correction file!");
- return pLists ? pLists->AddToWrdSttExceptList(rNew) : false;
+ return pLists && pLists->AddToWrdSttExceptList(rNew);
}
bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc,
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index 6293cbb366a5..b2964f15a5ee 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) ? true : false;
+ bool bOdd = (nIdx % 2) != 0;
// No overlap with existing intervals?
if( nIdx == nCount || ( !bOdd && nMax < (*pLongArr)[ nIdx ] ) )
{ // Then a new one is inserted ...
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 724a14910b71..50c88f0d9376 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -925,7 +925,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
if (pEditEngine)
{
const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) );
- bDrawBullet = rBulletState.GetValue() ? true : false;
+ bDrawBullet = rBulletState.GetValue();
}
if (bDrawBullet && ImplHasNumberFormat(nPara))
diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx
index 576643362cff..de8ded1da0cf 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() ) ) ? true : false;
+ return pNext && ( pNext->GetDepth() > pParagraph->GetDepth() );
}
bool ParagraphList::HasHiddenChildren( Paragraph* pParagraph ) const
{
sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pNext = GetParagraph( ++n );
- return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? true : false;
+ return pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible();
}
bool ParagraphList::HasVisibleChildren( Paragraph* pParagraph ) const
{
sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pNext = GetParagraph( ++n );
- return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? true : false;
+ return pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible();
}
sal_Int32 ParagraphList::GetChildCount( Paragraph* pParent ) const
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 93b2a74c0f00..4724843e3c40 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -329,7 +329,7 @@ public:
long GetFlags() const { return nFlags; }
inline SvxSwAutoFmtFlags& GetSwFlags() { return aSwFlags;}
bool IsAutoCorrFlag( long nFlag ) const
- { return nFlags & nFlag ? true : false; }
+ { return (nFlags & nFlag) != 0; }
void SetAutoCorrFlag( long nFlag, bool bOn = true );
// Load, Set, Get - the replacement list