summaryrefslogtreecommitdiff
path: root/sw/source/core
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 /sw/source/core
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 'sw/source/core')
-rw-r--r--sw/source/core/crsr/callnk.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx6
-rw-r--r--sw/source/core/crsr/viscrs.cxx4
-rw-r--r--sw/source/core/doc/DocumentStatisticsManager.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx2
-rw-r--r--sw/source/core/doc/docbm.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx2
-rw-r--r--sw/source/core/doc/fmtcol.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx4
-rw-r--r--sw/source/core/fields/expfld.cxx2
-rw-r--r--sw/source/core/fields/reffld.cxx4
-rw-r--r--sw/source/core/graphic/ndgrf.cxx2
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx2
-rw-r--r--sw/source/core/layout/flycnt.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/layout/layact.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx18
-rw-r--r--sw/source/core/layout/tabfrm.cxx4
-rw-r--r--sw/source/core/layout/wsfrm.cxx4
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/swg/swblocks.cxx2
-rw-r--r--sw/source/core/table/swtable.cxx2
-rw-r--r--sw/source/core/text/frmform.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/text/itrcrsr.cxx5
-rw-r--r--sw/source/core/text/portxt.cxx15
-rw-r--r--sw/source/core/txtnode/atrftn.cxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx4
-rw-r--r--sw/source/core/view/vprint.cxx2
29 files changed, 54 insertions, 56 deletions
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 292099c5e316..3b0ca8fcc21a 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -203,7 +203,7 @@ SwCallLink::~SwCallLink() COVERITY_NOEXCEPT_FALSE
if (!pFrame)
return;
pFlyFrame = pFrame->FindFlyFrame();
- if ( !(pFlyFrame && !m_rShell.IsTableMode()) )
+ if ( !pFlyFrame || m_rShell.IsTableMode() )
return;
const SwNodeIndex* pIndex = pFlyFrame->GetFormat()->GetContent().GetContentIdx();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index a2a169339bae..26ed4473924e 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3702,7 +3702,7 @@ void SwCursorShell::GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes,
SwPaM* pCursor = GetCursor();
SwPosition aPos( *pCursor->GetPoint() );
SwTextNode *pNode = aPos.nNode.GetNode().GetTextNode();
- if ( !(pNode && !pNode->IsInProtectSect()) )
+ if ( !pNode || pNode->IsInProtectSect() )
return;
const SwWrongList *pSmartTagList = pNode->GetSmartTags();
@@ -3713,7 +3713,7 @@ void SwCursorShell::GetSmartTagTerm( std::vector< OUString >& rSmartTagTypes,
sal_Int32 nBegin = nCurrent;
sal_Int32 nLen = 1;
- if (!(pSmartTagList->InWrongWord(nBegin, nLen) && !pNode->IsSymbolAt(nBegin)))
+ if (!pSmartTagList->InWrongWord(nBegin, nLen) || pNode->IsSymbolAt(nBegin))
return;
const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
@@ -3754,7 +3754,7 @@ void SwCursorShell::GetSmartTagRect( const Point& rPt, SwRect& rSelectRect )
sal_Int32 nBegin = aPos.nContent.GetIndex();
sal_Int32 nLen = 1;
- if (!(pSmartTagList->InWrongWord(nBegin, nLen) && !pNode->IsSymbolAt(nBegin)))
+ if (!pSmartTagList->InWrongWord(nBegin, nLen) || pNode->IsSymbolAt(nBegin))
return;
// get smarttag word
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index cf544c08a536..3479e62c2c37 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -300,7 +300,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell)
}
}
- if ( !(!m_pCursorShell->IsCursorReadonly() || m_pCursorShell->GetViewOptions()->IsSelectionInReadonly()) )
+ if ( m_pCursorShell->IsCursorReadonly() && !m_pCursorShell->GetViewOptions()->IsSelectionInReadonly() )
return;
if ( m_pCursorShell->GetDrawView() )
@@ -450,7 +450,7 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
// talks about "the" cursor at the moment. As long as that's true,
// don't say anything about the Writer cursor till a draw object is
// being edited.
- if (!(comphelper::LibreOfficeKit::isActive() && !pView->GetTextEditObject()))
+ if (!comphelper::LibreOfficeKit::isActive() || pView->GetTextEditObject())
return;
// If pSelectionRectangles is set, we're just collecting the text selections -> don't emit start/end.
diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx
index 03e00df6ceee..5d9a6faa94f4 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -86,7 +86,7 @@ void DocumentStatisticsManager::SetDocStat( const SwDocStat& rStat )
void DocumentStatisticsManager::UpdateDocStat( bool bCompleteAsync, bool bFields )
{
- if( !(mpDocStat->bModified || !mbInitialized))
+ if( !mpDocStat->bModified && mbInitialized)
return;
if (!bCompleteAsync)
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 69dcd0f98039..005927fbee51 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1221,7 +1221,7 @@ const SwFormatINetFormat* SwDoc::FindINetAttr( const OUString& rName ) const
void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress )
{
const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds();
- if( !(pExtDoc && !rOutNds.empty()) )
+ if( !pExtDoc || rOutNds.empty() )
return;
::StartProgress( STR_STATSTR_SUMMARY, 0, rOutNds.size(), GetDocShell() );
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index a6ecd452e576..385afa6846ea 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1759,8 +1759,8 @@ void SaveBookmark::SetInDoc(
else
aPam.GetPoint()->nContent.Assign(aPam.GetContentNode(), m_nContent1);
- if(!(!aPam.HasMark()
- || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, true)))
+ if(aPam.HasMark()
+ && !CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, true))
return;
::sw::mark::IBookmark* const pBookmark = dynamic_cast<::sw::mark::IBookmark*>(
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index b3eba9df2dbd..d5d16626650e 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1840,7 +1840,7 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd,
}
// The main entries should get their character style
- if (!(xCharStyleIdx && !xCharStyleIdx->empty() && !GetMainEntryCharStyle().isEmpty()))
+ if (!xCharStyleIdx || xCharStyleIdx->empty() || GetMainEntryCharStyle().isEmpty())
return;
// eventually the last index must me appended
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 4ef745fc1926..f59efb8b10a4 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -51,8 +51,8 @@ namespace TextFormatCollFunc
}
// #i73790#
- if ( !(!pTextFormatColl->StayAssignedToListLevelOfOutlineStyle() &&
- pTextFormatColl->IsAssignedToListLevelOfOutlineStyle()) )
+ if ( pTextFormatColl->StayAssignedToListLevelOfOutlineStyle() ||
+ !pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
return;
if (!pNewNumRuleItem)
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 437ec985e9be..8022218db3db 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1455,8 +1455,8 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// left or right. Here we calculate their width.
m_nInhAbsLeftSpace = 0;
m_nInhAbsRightSpace = 0;
- if( !(!IsTopTable() && (m_nRelLeftFill>0 || m_nRelRightFill>0 ||
- nAbsTabWidth<nAbsAvail)) )
+ if( IsTopTable() ||
+ !(m_nRelLeftFill>0 || m_nRelRightFill>0 || nAbsTabWidth<nAbsAvail) )
return;
// Calculate the width of additional cells we use for
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 6860d57a0fa8..ea8bd57e796f 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -912,7 +912,7 @@ void SwSetExpField::SetValue(const double& rValue, SwRootFrame const*const pLayo
{
SetValue(rValue);
}
- if (!(!pLayout || pLayout->IsHideRedlines()))
+ if (pLayout && !pLayout->IsHideRedlines())
return;
m_fValueRLHidden = rValue;
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 7b8adb96bbd0..ab5537502d18 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -327,8 +327,8 @@ static void lcl_formatReferenceLanguage( OUString& rRefText,
}
}
// not a title text starting already with a definitive article
- if ( !(!sNumbering.startsWith("A ") && !sNumbering.startsWith("Az ") &&
- !sNumbering.startsWith("a ") && !sNumbering.startsWith("az ")) )
+ if ( sNumbering.startsWith("A ") || sNumbering.startsWith("Az ") ||
+ sNumbering.startsWith("a ") || sNumbering.startsWith("az ") )
return;
// lowercase, if rReferenceLanguage == "hu", not "Hu"
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 33bfd4ede834..55ced4c704bc 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -839,7 +839,7 @@ void SwGrfNode::ApplyInputStream(
void SwGrfNode::UpdateLinkWithInputStream()
{
// do not work on link, if a <SwapIn> has been triggered.
- if ( !(!mbInSwapIn && IsLinkedFile()) )
+ if ( mbInSwapIn || !IsLinkedFile() )
return;
GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly );
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 23334a44a01b..0d7a8658b46e 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -523,7 +523,7 @@ void SwAnchoredDrawObject::SetDrawObjAnchor()
*/
void SwAnchoredDrawObject::InvalidatePage_( SwPageFrame* _pPageFrame )
{
- if ( !(_pPageFrame && !_pPageFrame->GetFormat()->GetDoc()->IsInDtor()) )
+ if ( !_pPageFrame || _pPageFrame->GetFormat()->GetDoc()->IsInDtor() )
return;
if ( !_pPageFrame->GetUpper() )
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index ce6abc998735..953b527ee65b 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -329,7 +329,7 @@ void SwFlyAtContentFrame::MakeAll(vcl::RenderContext* pRenderContext)
return;
}
- if ( !(!SwOszControl::IsInProgress( this ) && !IsLocked() && !IsColLocked()) )
+ if ( SwOszControl::IsInProgress( this ) || IsLocked() || IsColLocked() )
return;
// #i28701# - use new method <GetPageFrame()>
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2a56f8e5cb04..0ade3a3315ed 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -388,7 +388,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE
// #i61999#
// no invalidation of columned Writer fly frames, because automatic
// width doesn't make sense for such Writer fly frames.
- if ( !(pFly->Lower() && !pFly->Lower()->IsColumnFrame()) )
+ if ( !pFly->Lower() || pFly->Lower()->IsColumnFrame() )
return;
const SwFormatFrameSize &rFrameSz = pFly->GetFormat()->GetFrameSize();
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index d506251278ff..93076422c5dd 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -228,7 +228,7 @@ void SwLayAction::PaintContent( const SwContentFrame *pCnt,
PaintContent_( pCnt, pPage, aPaintRect );
}
- if ( !(pCnt->IsRetouche() && !pCnt->GetNext()) )
+ if ( !pCnt->IsRetouche() || pCnt->GetNext() )
return;
const SwFrame *pTmp = pCnt;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a3454140ed82..9dbd735fabe9 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3543,10 +3543,10 @@ static drawinglayer::primitive2d::Primitive2DContainer lcl_CreateDashedIndicator
void SwPageFrame::PaintBreak( ) const
{
- if ( !(gProp.pSGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER &&
- !gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() &&
- !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
- !gProp.pSGlobalShell->IsPreview()) )
+ if ( gProp.pSGlobalShell->GetOut()->GetOutDevType() == OUTDEV_PRINTER ||
+ gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() ||
+ gProp.pSGlobalShell->GetViewOptions()->IsReadonly() ||
+ gProp.pSGlobalShell->IsPreview() )
return;
const SwFrame* pBodyFrame = Lower();
@@ -3580,10 +3580,10 @@ void SwPageFrame::PaintBreak( ) const
void SwColumnFrame::PaintBreak( ) const
{
- if ( !(gProp.pSGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER &&
- !gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() &&
- !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() &&
- !gProp.pSGlobalShell->IsPreview()) )
+ if ( gProp.pSGlobalShell->GetOut()->GetOutDevType() == OUTDEV_PRINTER ||
+ gProp.pSGlobalShell->GetViewOptions()->IsPDFExport() ||
+ gProp.pSGlobalShell->GetViewOptions()->IsReadonly() ||
+ gProp.pSGlobalShell->IsPreview() )
return;
const SwFrame* pBodyFrame = Lower();
@@ -5657,7 +5657,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
void SwPageFrame::PaintMarginArea( const SwRect& _rOutputRect,
SwViewShell const * _pViewShell ) const
{
- if ( !(_pViewShell->GetWin() && !_pViewShell->GetViewOptions()->getBrowseMode()) )
+ if ( !_pViewShell->GetWin() || _pViewShell->GetViewOptions()->getBrowseMode() )
return;
// Simplified paint with DrawingLayer FillStyle
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index a81b7f1c198c..288ac0e760c8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1360,7 +1360,7 @@ void SwTabFrame::Join()
SwTabFrame *pFoll = GetFollow();
- if (!(pFoll && !pFoll->IsJoinLocked()))
+ if (!pFoll || pFoll->IsJoinLocked())
return;
SwRectFnSet aRectFnSet(this);
@@ -3747,7 +3747,7 @@ void SwTabFrame::Paste( SwFrame* pParent, SwFrame* pSibling )
// b) The new follower was previously the first in a chain
GetNext()->InvalidatePrt_();
- if ( !(pPage && !IsFollow()) )
+ if ( !pPage || IsFollow() )
return;
if ( pPage->GetUpper() )
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 04035710861a..9c342a384770 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -4227,10 +4227,10 @@ void AddRemoveFlysAnchoredToFrameStartingAtNode(
std::set<sal_uLong> *const pSkipped)
{
auto const pMerged(rFrame.GetMergedPara());
- if (!(pMerged
+ if (!pMerged
// do this only *once*, for the *last* frame
// otherwise AppendObj would create multiple frames for fly-frames!
- && !rFrame.GetFollow()))
+ || rFrame.GetFollow())
return;
assert(pMerged->pFirstNode->GetIndex() <= rTextNode.GetIndex()
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 50bbe3ebf883..e7840331969c 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -602,7 +602,7 @@ void SwOLENode::DisconnectFileLink_Impl()
void SwOLENode::CheckFileLink_Impl()
{
- if ( !(maOLEObj.m_xOLERef.GetObject().is() && !mpObjectLink) )
+ if ( !maOLEObj.m_xOLERef.GetObject().is() || mpObjectLink )
return;
try
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index 474e9fb4ee5d..e8ca2b1c7623 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -309,7 +309,7 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
void SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString* l )
{
- if( !(m_pImp && !m_pImp->m_bInPutMuchBlocks) )
+ if( !m_pImp || m_pImp->m_bInPutMuchBlocks )
return;
m_pImp->m_nCurrentIndex = USHRT_MAX;
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index b36b62a05a41..45f5fb716633 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -451,7 +451,7 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
else if ( bRefreshHidden )
::lcl_RefreshHidden( rToFill, nPos );
- if ( !(bHidden && !bRefreshHidden) )
+ if ( !bHidden || bRefreshHidden )
return;
// calculate minimum/maximum values for the existing entries:
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 8513f33b078c..1a18447cd6f7 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -116,7 +116,7 @@ void SwTextFrame::ValidateFrame()
static void ValidateBodyFrame_( SwFrame *pFrame )
{
vcl::RenderContext* pRenderContext = pFrame ? pFrame->getRootFrame()->GetCurrShell()->GetOut() : nullptr;
- if( !(pFrame && !pFrame->IsCellFrame()) )
+ if( !pFrame || pFrame->IsCellFrame() )
return;
if( !pFrame->IsBodyFrame() && pFrame->GetUpper() )
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index a167af3ce922..9d3ce8eb2ed4 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1315,7 +1315,7 @@ void SwTextPaintInfo::DrawBorder( const SwLinePortion &rPor ) const
void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
PortionType nWhich ) const
{
- if( !(OnWin() && !IsMulti()) )
+ if( !OnWin() || IsMulti() )
return;
bool bDraw = false;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index cb830f327412..6e9325fa4509 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -228,7 +228,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p
// paras inside cells inside new documents:
( pNode->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ||
!m_pFrame->IsInTab() ||
- ( !nLMWithNum && !(bLabelAlignmentActive && !bListLevelIndentsApplicable) ) ) )
+ ( !nLMWithNum && (!bLabelAlignmentActive || bListLevelIndentsApplicable) ) ) )
{
nLeft = m_pFrame->getFramePrintArea().Left() + m_pFrame->getFrameArea().Left();
if( nLeft >= nRight ) // e.g. with large paragraph indentations in slim table columns
@@ -1444,8 +1444,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con
// #i27615#
if (pCMS && pCMS->m_bInFrontOfLabel)
{
- if (! (2 * nX < nWidth && pPor->InNumberGrp() &&
- !pPor->IsFootnoteNumPortion()))
+ if (2 * nX >= nWidth || !pPor->InNumberGrp() || pPor->IsFootnoteNumPortion())
pCMS->m_bInFrontOfLabel = false;
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 59a180ca0d98..ace126870b54 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -466,14 +466,13 @@ bool SwTextPortion::Format( SwTextFormatInfo &rInf )
// rInf.nIdx points to the next word, nIdx-1 is the portion's last char
void SwTextPortion::FormatEOL( SwTextFormatInfo &rInf )
{
- if( !(
- ( !GetNextPortion() || ( GetNextPortion()->IsKernPortion() &&
- !GetNextPortion()->GetNextPortion() ) ) &&
- GetLen() &&
- rInf.GetIdx() < TextFrameIndex(rInf.GetText().getLength()) &&
- TextFrameIndex(1) < rInf.GetIdx() &&
- ' ' == rInf.GetChar(rInf.GetIdx() - TextFrameIndex(1)) &&
- !rInf.GetLast()->IsHolePortion()) )
+ if( ( GetNextPortion() &&
+ ( !GetNextPortion()->IsKernPortion() || GetNextPortion()->GetNextPortion() ) ) ||
+ !GetLen() ||
+ rInf.GetIdx() >= TextFrameIndex(rInf.GetText().getLength()) ||
+ TextFrameIndex(1) >= rInf.GetIdx() ||
+ ' ' != rInf.GetChar(rInf.GetIdx() - TextFrameIndex(1)) ||
+ rInf.GetLast()->IsHolePortion() )
return;
// calculate number of blanks
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 913167342939..2d515cb98ca3 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -490,7 +490,7 @@ void SwTextFootnote::DelFrames(SwRootFrame const*const pRoot)
}
//JP 13.05.97: if the layout is deleted before the footnotes are deleted,
// try to delete the footnote's frames by another way
- if ( !(!bFrameFnd && m_pStartNode) )
+ if ( bFrameFnd || !m_pStartNode )
return;
SwNodeIndex aIdx( *m_pStartNode );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index df046a6f8e6a..3e0f8b16c254 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1535,7 +1535,7 @@ void SwTextNode::Update(
// Inform LOK clients about change in position of redlines (if any)
// Don't emit notifications during save: redline flags are temporarily changed during save, but
// it's not useful to let clients know about such changes.
- if (!(comphelper::LibreOfficeKit::isActive() && !GetDoc()->IsInWriting()))
+ if (!comphelper::LibreOfficeKit::isActive() || GetDoc()->IsInWriting())
return;
const SwRedlineTable& rTable = GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
@@ -4163,7 +4163,7 @@ void SwTextNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber
? GetAttrListRestartValue() != nNumber
: nNumber != USHRT_MAX );
- if ( !(bChanged || !HasAttrListRestartValue()) )
+ if ( !bChanged && HasAttrListRestartValue() )
return;
if ( nNumber == USHRT_MAX )
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 1e80073ee479..fe3820f6c461 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -102,7 +102,7 @@ void SwPaintQueue::Add( SwViewShell *pNew, const SwRect &rNew )
void SwPaintQueue::Repaint()
{
- if (!(!SwRootFrame::IsInPaint() && s_pPaintQueue))
+ if (SwRootFrame::IsInPaint() || !s_pPaintQueue)
return;
SwQueuedPaint *pPt = s_pPaintQueue;