summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 13:32:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-14 18:03:06 +0200
commite67657d5211f6e95ddf8bd621108608573b00d5d (patch)
tree66724101dbd95721714bd40fcb4861663432774c /editeng
parent186def8f48e273c3a3b4d23b3ab2efd0d8664731 (diff)
loplugin:simplifybool more
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx4
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx3
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
-rw-r--r--editeng/source/outliner/outliner.cxx4
-rw-r--r--editeng/source/outliner/outlvw.cxx2
6 files changed, 8 insertions, 9 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index ad32674b4140..666426c8485b 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -871,7 +871,7 @@ void ImpEditView::ResetOutputArea( const tools::Rectangle& rRect )
SetOutputArea(rRect);
// invalidate surrounding areas if update is true
- if(!(!aOldArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode()))
+ if(aOldArea.IsEmpty() || !pEditEngine->pImpEditEngine->GetUpdateMode())
return;
// #i119885# use grown area if needed; do when getting bigger OR smaller
@@ -2101,7 +2101,7 @@ void ImpEditView::HideDDCursor()
void ImpEditView::ShowDDCursor( const tools::Rectangle& rRect )
{
- if ( !(pDragAndDropInfo && !pDragAndDropInfo->bVisCursor) )
+ if ( !pDragAndDropInfo || pDragAndDropInfo->bVisCursor )
return;
if (pOutWin && pOutWin->GetCursor())
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index a94fcf958722..34babbcedc7f 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4141,7 +4141,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion )
}
- if ( !(nPortion && !aStatus.ULSpaceSummation()) )
+ if ( !nPortion || aStatus.ULSpaceSummation() )
return;
ParaPortion* pPrev = GetParaPortions().SafeGetObject( nPortion-1 );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 00a999a5abac..42525141c461 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2068,8 +2068,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView,
// sentence got removed in the dialog
DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized");
- if (!(pSpellInfo &&
- !pSpellInfo->aLastSpellPortions.empty())) // no portions -> no text to be changed
+ if (!pSpellInfo || pSpellInfo->aLastSpellPortions.empty()) // no portions -> no text to be changed
return;
// get current paragraph length to calculate later on how the sentence length changed,
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 840868edbd00..7d09c85c096a 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -277,7 +277,7 @@ namespace editeng
void HangulHanjaConversion_Impl::createDialog()
{
DBG_ASSERT( m_bIsInteractive, "createDialog when the conversion should not be interactive?" );
- if ( !(m_bIsInteractive && !m_pConversionDialog) )
+ if ( !m_bIsInteractive || m_pConversionDialog )
return;
EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create();
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 8cf7132c5a6b..27d86600aa3d 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1049,8 +1049,8 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
}
// In case of collapsed subparagraphs paint a line before the text.
- if( !(pParaList->HasChildren(pPara) && !pParaList->HasVisibleChildren(pPara) &&
- !bStrippingPortions && !nOrientation) )
+ if( !pParaList->HasChildren(pPara) || pParaList->HasVisibleChildren(pPara) ||
+ bStrippingPortions || nOrientation )
return;
long nWidth = pOutDev->PixelToLogic( Size( 10, 0 ) ).Width();
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 8d1127e15ba8..2bd7d8bb9172 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -677,7 +677,7 @@ void OutlinerView::PasteSpecial()
void OutlinerView::Paste( bool bUseSpecial )
{
- if ( !(!ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( this )) )
+ if ( ImpCalcSelectedPages( false ) && !pOwner->ImpCanDeleteSelectedPages( this ) )
return;
pOwner->UndoActionStart( OLUNDO_INSERT );