summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-24 09:25:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-24 10:27:12 +0200
commit2c56d461633ff1a1b364685df79b521f8802c4ec (patch)
treeb419b70f891398d39decdc17b7e4f5ae82d478fa
parenta975225678c00272fc6e2ee2c85e6fe00a2204f1 (diff)
clang-tidy readability-simplify-boolean-expr in sw
Change-Id: Ib3ec37b8280c527fa712192db043b348c3427c50 Reviewed-on: https://gerrit.libreoffice.org/36877 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/crsr/swcrsr.cxx8
-rw-r--r--sw/source/core/doc/textboxhelper.cxx5
-rw-r--r--sw/source/core/edit/edws.cxx5
-rw-r--r--sw/source/core/fields/macrofld.cxx6
-rw-r--r--sw/source/core/layout/calcmove.cxx11
-rw-r--r--sw/source/core/layout/dbg_lay.cxx4
-rw-r--r--sw/source/core/layout/hffrm.cxx5
-rw-r--r--sw/source/core/layout/layact.cxx10
-rw-r--r--sw/source/core/layout/softpagebreak.cxx4
-rw-r--r--sw/source/core/layout/sortedobjs.cxx12
-rw-r--r--sw/source/core/text/wrong.cxx6
-rw-r--r--sw/source/core/tox/ToxTabStopTokenHandler.cxx5
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx5
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx5
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx5
-rw-r--r--sw/source/filter/ww8/ww8par.cxx5
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx5
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx13
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx7
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx5
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx4
-rw-r--r--sw/source/ui/fldui/fldref.cxx4
-rw-r--r--sw/source/ui/frmdlg/column.cxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx7
-rw-r--r--sw/source/ui/misc/bookmark.cxx4
-rw-r--r--sw/source/ui/vba/vbafind.cxx8
-rw-r--r--sw/source/ui/vba/vbaheaderfooterhelper.cxx4
-rw-r--r--sw/source/ui/vba/vbaselection.cxx8
-rw-r--r--sw/source/ui/vba/vbatables.cxx4
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx4
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx5
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx5
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx14
-rw-r--r--sw/source/uibase/uiview/formatclipboard.cxx7
35 files changed, 51 insertions, 164 deletions
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 3014a36324f0..de3452b4f988 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -707,11 +707,9 @@ bool SwCursor::IsAtValidPos( bool bPoint ) const
return false;
const SwSectionNode* pSectNd = pNd->FindSectionNode();
- if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() ||
- ( !bCursorInReadOnly && pSectNd->GetSection().IsProtectFlag() )))
- return false;
-
- return true;
+ return !pSectNd
+ || !(pSectNd->GetSection().IsHiddenFlag() ||
+ ( !bCursorInReadOnly && pSectNd->GetSection().IsProtectFlag() ));
}
void SwCursor::SaveTableBoxContent( const SwPosition* ) {}
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 2eb223dc66a1..9a88ba9dea4e 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -143,10 +143,7 @@ bool SwTextBoxHelper::isTextBox(const SwFrameFormat* pShape, sal_uInt16 nType)
return false;
const SwFormatContent& rContent = pShape->GetContent();
- if (!pFormat->GetAttrSet().HasItem(RES_CNTNT) || pFormat->GetContent() != rContent)
- return false;
-
- return true;
+ return pFormat->GetAttrSet().HasItem(RES_CNTNT) && pFormat->GetContent() == rContent;
}
bool SwTextBoxHelper::isTextBox(const SdrObject* pObject)
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index f96fd03d14cf..cbda86ddf3eb 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -140,10 +140,7 @@ bool SwEditShell::HasOtherCnt() const
return true;
pNd = &rNds.GetEndOfAutotext();
- if ( 1 != (pNd->GetIndex() - pNd->StartOfSectionIndex()) )
- return true;
-
- return false;
+ return 1 != (pNd->GetIndex() - pNd->StartOfSectionIndex());
}
SwActContext::SwActContext(SwEditShell *pShell)
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index 1ace82b854ae..bb0756ff35a7 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -216,11 +216,7 @@ bool SwMacroField::isScriptURL( const OUString& str )
uno::Reference< uri::XVndSunStarScriptUrl >
xUrl( xFactory->parse( str ), uno::UNO_QUERY );
- if ( xUrl.is() )
- {
- return true;
- }
- return false;
+ return xUrl.is();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 65fab03a33c8..6d9721748cb5 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1687,15 +1687,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
// for MoveBwd. Robust: We also check the bMovedBwd flag again.
// If pOldUp was a footnote frame, it has been deleted inside MoveFwd.
// Therefore we only check for growing body frames.
- if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() &&
- aRectFnSet.GetHeight(pOldUp->Frame()) > nOldBodyHeight )
- {
- bMovedFwd = false;
- }
- else
- {
- bMovedFwd = true;
- }
+ bMovedFwd = !bCheckForGrownBody || bMovedBwd || pOldUp == GetUpper() ||
+ aRectFnSet.GetHeight(pOldUp->Frame()) <= nOldBodyHeight;
bFormatted = false;
if ( bMoveOrFit && GetUpper() == pOldUp )
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 03fca243050f..27b32f64cb92 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -716,9 +716,7 @@ bool SwImplProtocol::DeleteFrame( sal_uInt16 nId )
{
if( !pFrameIds )
return false;
- if ( pFrameIds->erase(nId) )
- return true;
- return false;
+ return pFrameIds->erase(nId) != 0;
}
/* SwEnterLeave::Ctor(..) is called from the (inline-)CTor if the function should
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 28a932af1951..35835e61148b 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -633,10 +633,7 @@ bool SwHeadFootFrame::GetEatSpacing() const
const SwFrameFormat * pFormat = GetFormat();
OSL_ENSURE(pFormat, "SwHeadFootFrame: no format?");
- if (pFormat->GetHeaderAndFooterEatSpacing().GetValue())
- return true;
-
- return false;
+ return pFormat->GetHeaderAndFooterEatSpacing().GetValue();
}
void DelFlys( SwLayoutFrame *pFrame, SwPageFrame *pPage )
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index db26a6f99cbb..aa84e25c5cd8 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -860,14 +860,8 @@ bool SwLayAction::TurboAction()
static bool lcl_IsInvaLay( const SwFrame *pFrame, long nBottom )
{
- if (
- !pFrame->IsValid() ||
- (pFrame->IsCompletePaint() && ( pFrame->Frame().Top() < nBottom ) )
- )
- {
- return true;
- }
- return false;
+ return !pFrame->IsValid() ||
+ (pFrame->IsCompletePaint() && ( pFrame->Frame().Top() < nBottom ) );
}
static const SwFrame *lcl_FindFirstInvaLay( const SwFrame *pFrame, long nBottom )
diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx
index ce792711641d..394c0116fd65 100644
--- a/sw/source/core/layout/softpagebreak.cxx
+++ b/sw/source/core/layout/softpagebreak.cxx
@@ -131,9 +131,7 @@ bool SwTableLine::hasSoftPageBreak() const
if( pRow == pLast )
{
// The last check: no soft page break for "follow" table lines
- if( pTab->IsFollow() && pTab->FindMaster()->HasFollowFlowLine() )
- return false;
- return true;
+ return !pTab->IsFollow() || !pTab->FindMaster()->HasFollowFlowLine();
}
return false;
}
diff --git a/sw/source/core/layout/sortedobjs.cxx b/sw/source/core/layout/sortedobjs.cxx
index a3e2a9fad81f..9382ac051dd8 100644
--- a/sw/source/core/layout/sortedobjs.cxx
+++ b/sw/source/core/layout/sortedobjs.cxx
@@ -169,10 +169,7 @@ struct ObjAnchorOrder
_pNewAnchoredObj->GetDrawObj()->GetLayer() == nInvisibleHellId;
if ( bWrapThroughOrHellListed != bWrapThroughOrHellNew )
{
- if ( bWrapThroughOrHellListed )
- return false;
- else
- return true;
+ return !bWrapThroughOrHellListed;
}
else if ( bWrapThroughOrHellListed && bWrapThroughOrHellNew )
{
@@ -190,11 +187,8 @@ struct ObjAnchorOrder
pWrapInfluenceOnObjPosNew->GetWrapInfluenceOnObjPos( true ) )
{
// #i35017# - constant name has changed
- if ( pWrapInfluenceOnObjPosListed->GetWrapInfluenceOnObjPos( true )
- == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE )
- return true;
- else
- return false;
+ return pWrapInfluenceOnObjPosListed->GetWrapInfluenceOnObjPos( true )
+ == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE;
}
// objects anchored at the same content position/page/fly with same
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 34b12ad6a8b9..e7f4b0d85b47 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -623,9 +623,9 @@ bool SwWrongList::LookForEntry( sal_Int32 nBegin, sal_Int32 nEnd ) {
std::vector<SwWrongArea>::iterator aIter = maList.begin();
while( aIter != maList.end() && (*aIter).mnPos < nBegin )
++aIter;
- if( aIter != maList.end() && nBegin == (*aIter).mnPos && nEnd == (*aIter).mnPos +(*aIter).mnLen )
- return true;
- return false;
+ return aIter != maList.end()
+ && nBegin == (*aIter).mnPos
+ && nEnd == (*aIter).mnPos + (*aIter).mnLen;
}
void SwWrongList::Insert( const OUString& rType,
diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
index f31e0456fcc3..f3f6a738dfa7 100644
--- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx
+++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
@@ -115,10 +115,7 @@ DefaultToxTabStopTokenHandler::CanUseLayoutRectangle(const SwTextNode& targetNod
return false;
}
const SwPageFrame* pageFrame = static_cast<const SwPageFrame*>(pFrame);
- if (pageDescription != pageFrame->GetPageDesc()) {
- return false;
- }
- return true;
+ return pageDescription == pageFrame->GetPageDesc();
}
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 367020c4bf41..2ae3720dd6ae 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -4172,10 +4172,7 @@ bool SwTextNode::IsHidden() const
return true;
const SwSectionNode* pSectNd = FindSectionNode();
- if ( pSectNd && pSectNd->GetSection().IsHiddenFlag() )
- return true;
-
- return false;
+ return pSectNd && pSectNd->GetSection().IsHiddenFlag();
}
namespace {
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index eb0bc7cc3b52..9eba6043bff1 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -638,9 +638,7 @@ namespace sw
else if (const SwContentNode *pNd = rNd.GetContentNode())
pBreak = &(ItemGet<SvxFormatBreakItem>(*pNd, RES_BREAK));
- if (pBreak && pBreak->GetBreak() == SvxBreak::PageBefore)
- return true;
- return false;
+ return pBreak && pBreak->GetBreak() == SvxBreak::PageBefore;
}
tools::Polygon PolygonFromPolyPolygon(const tools::PolyPolygon &rPolyPoly)
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index d931cb8fab5f..4a01c61039de 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2929,10 +2929,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const ww8::Frame& rFormat, const P
if (rFormat.IsInline())
{
ww8::Frame::WriterSource eType = rFormat.GetWriterType();
- if ((eType == ww8::Frame::eGraphic) || (eType == ww8::Frame::eOle))
- bUseEscher = false;
- else
- bUseEscher = true;
+ bUseEscher = eType != ww8::Frame::eGraphic && eType != ww8::Frame::eOle;
/*
A special case for converting some inline form controls to form fields
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 4c46be68f905..7da2c6f353cc 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -346,10 +346,7 @@ bool MSWordExportBase::FormatHdFtContainsChapterField(const SwFrameFormat &rForm
return true;
pFormat = rFormat.GetFooter().GetFooterFormat();
- if ( pFormat && ContentContainsChapterField( pFormat->GetContent() ) )
- return true;
-
- return false;
+ return pFormat && ContentContainsChapterField( pFormat->GetContent() );
}
bool MSWordExportBase::SetAktPageDescFromNode(const SwNode &rNd)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index fdd95eeb040f..1cb9d41845ad 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -6432,10 +6432,7 @@ bool SwWW8ImplReader::InEqualOrHigherApo(int nLvl) const
return false;
}
mycApoIter aIter = std::find(m_aApos.begin() + nLvl, m_aApos.end(), true);
- if (aIter != m_aApos.end())
- return true;
- else
- return false;
+ return aIter != m_aApos.end();
}
bool SwWW8ImplReader::InEqualApo(int nLvl) const
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 3aada795060c..d29de42f1ef7 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2924,10 +2924,7 @@ bool WW8TabDesc::InFirstParaInCell() const
if (!IsValidCell(GetAktCol()))
return false;
- if (m_pIo->m_pPaM->GetPoint()->nNode == m_pTabBox->GetSttIdx() + 1)
- return true;
-
- return false;
+ return m_pIo->m_pPaM->GetPoint()->nNode == m_pTabBox->GetSttIdx() + 1;
}
void WW8TabDesc::StartMiserableHackForUnsupportedDirection(short nWwCol)
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index ae0b67c52613..f430a140ccab 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -199,9 +199,7 @@ void wwSection::SetDirection()
bool wwSection::IsVertical() const
{
- if (meDir == SvxFrameDirection::Vertical_RL_TB || meDir == SvxFrameDirection::Vertical_LR_TB)
- return true;
- return false;
+ return meDir == SvxFrameDirection::Vertical_RL_TB || meDir == SvxFrameDirection::Vertical_LR_TB;
}
/*
@@ -1775,9 +1773,7 @@ bool WW8FlyPara::IsEmpty() const
OSL_ENSURE(aEmpty.nSp37 == 2, "this is not what we expect for nSp37");
if (this->nSp37 == 0)
aEmpty.nSp37 = 0;
- if (aEmpty == *this)
- return true;
- return false;
+ return aEmpty == *this;
}
// #i18732# - changes made on behalf of CMC
@@ -4616,10 +4612,7 @@ void SwWW8ImplReader::Read_TextAnim(sal_uInt16 /*nId*/, const sal_uInt8* pData,
// 2 background blink 3 sparkle text
// 4 marching ants 5 marching red ants
// 6 shimmer
- if (*pData > 0 && *pData < 7 )
- bBlink = true;
- else
- bBlink = false;
+ bBlink = *pData > 0 && *pData < 7;
NewAttr(SvxBlinkItem(bBlink, RES_CHRATR_BLINK));
}
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 49a2f46f227d..d23385cb7762 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -3731,12 +3731,7 @@ bool WW8PLCFx_FLD::StartPosIsFieldStart()
{
void* pData;
sal_Int32 nTest;
- if (
- (!pPLCF || !pPLCF->Get(nTest, pData) ||
- ((static_cast<sal_uInt8*>(pData)[0] & 0x1f) != 0x13))
- )
- return false;
- return true;
+ return pPLCF && pPLCF->Get(nTest, pData) && ((static_cast<sal_uInt8*>(pData)[0] & 0x1f) == 0x13);
}
bool WW8PLCFx_FLD::EndPosIsFieldEnd(WW8_CP& nCP)
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 8ccffebdccff..df2f530b7c88 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -369,10 +369,7 @@ bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl(
nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD | SfxCallMode::MODAL,
pItems );
- if ( !pItem )
- return false;
-
- return true;
+ return pItem != nullptr;
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index af25e2d3b878..16c6a6c9069a 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -155,9 +155,7 @@ void SwMailMergeAddressBlockPage::ActivatePage()
bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
- if ( ::svt::WizardTypes::eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() )
- return false;
- return true;
+ return ::svt::WizardTypes::eTravelForward != _eReason || m_pWizard->GetConfigItem().GetResultSet().is();
}
IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl, Button*, void)
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 0d4f83961459..38664a2a285a 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -736,9 +736,7 @@ bool SwFieldRefPage::MatchSubstring( const OUString& rListString, const OUString
return true;
OUString aListString = rListString.toAsciiLowerCase();
OUString aSubstr = rSubstr.toAsciiLowerCase();
- if(aListString.indexOf(aSubstr) >= 0)
- return true;
- return false;
+ return aListString.indexOf(aSubstr) >= 0;
}
sal_Int32 SwFieldRefPage::FillFormatLB(sal_uInt16 nTypeId)
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 88f3ecbbea36..602227c588a3 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -861,7 +861,7 @@ void SwColumnPage::UpdateCols()
const bool bEdit = !m_pAutoWidthBox->IsChecked();
if ( m_nCols > nVisCols )
{
- bEnableBtns = true && !m_bHtmlMode;
+ bEnableBtns = !m_bHtmlMode;
bEnable12 = bEnable3 = bEdit;
}
else if( bEdit )
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index abb17ee90f7a..d8e4b1d18831 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -522,11 +522,8 @@ bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const OUString& rName)
const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(
rName, SwGetPoolIdFromName::TxtColl);
- if(nId != USHRT_MAX &&
- ! rSh.GetTextCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle())
- return true;
-
- return false;
+ return nId != USHRT_MAX &&
+ ! rSh.GetTextCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle();
}
class SwIndexTreeLB : public SvSimpleTable
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 95b4fea7fbd0..4a52dd50f184 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -265,9 +265,7 @@ bool SwInsertBookmarkDlg::HaveBookmarksChanged()
}
}
// less bookmarks then expected
- if (aListIter != aTableBookmarks.end())
- return true;
- return false;
+ return aListIter != aTableBookmarks.end();
}
void SwInsertBookmarkDlg::PopulateTable()
diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx
index 3556673b0b9a..2620b441f365 100644
--- a/sw/source/ui/vba/vbafind.cxx
+++ b/sw/source/ui/vba/vbafind.cxx
@@ -45,17 +45,13 @@ SwVbaFind::~SwVbaFind()
bool SwVbaFind::InRange( const uno::Reference< text::XTextRange >& xCurrentRange )
{
uno::Reference< text::XTextRangeCompare > xTRC( mxTextRange->getText(), uno::UNO_QUERY_THROW );
- if( xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) >= 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) <= 0 )
- return true;
- return false;
+ return xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) >= 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) <= 0;
}
bool SwVbaFind::InEqualRange( const uno::Reference< text::XTextRange >& xCurrentRange )
{
uno::Reference< text::XTextRangeCompare > xTRC( mxTextRange->getText(), uno::UNO_QUERY_THROW );
- if( xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) == 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) == 0 )
- return true;
- return false;
+ return xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) == 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) == 0;
}
void SwVbaFind::SetReplaceWith( const OUString& rText )
diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.cxx b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
index 3c873b2769cb..62a75141612a 100644
--- a/sw/source/ui/vba/vbaheaderfooterhelper.cxx
+++ b/sw/source/ui/vba/vbaheaderfooterhelper.cxx
@@ -43,9 +43,7 @@ bool HeaderFooterHelper::isHeaderFooter( const uno::Reference< text::XText >& xT
{
uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW );
OUString aImplName = xServiceInfo->getImplementationName();
- if ( aImplName == "SwXHeadFootText" )
- return true;
- return false;
+ return aImplName == "SwXHeadFootText";
}
bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xModel )
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index b3334a13766c..22c38459060d 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -956,9 +956,7 @@ uno::Reference< text::XTextTable > SwVbaSelection::GetXTextTable()
bool SwVbaSelection::IsInTable()
{
uno::Reference< text::XTextTable > xTextTable = GetXTextTable();
- if( xTextTable.is() )
- return true;
- return false;
+ return xTextTable.is();
}
bool SwVbaSelection::HasSelection()
@@ -966,9 +964,7 @@ bool SwVbaSelection::HasSelection()
uno::Reference< text::XTextRange > xStart = mxTextViewCursor->getStart();
uno::Reference< text::XTextRange > xEnd = mxTextViewCursor->getEnd();
uno::Reference< text::XTextRangeCompare > xTRC( mxTextViewCursor->getText(), uno::UNO_QUERY_THROW );
- if( xTRC->compareRegionStarts( xStart, xEnd ) == 0 && xTRC->compareRegionEnds( xStart, xEnd ) == 0 )
- return false;
- return true;
+ return xTRC->compareRegionStarts( xStart, xEnd ) != 0 || xTRC->compareRegionEnds( xStart, xEnd ) != 0;
}
void SwVbaSelection::GetSelectedCellRange( OUString& sTLName, OUString& sBRName )
diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx
index 545f99fc4c1b..932e416d460e 100644
--- a/sw/source/ui/vba/vbatables.cxx
+++ b/sw/source/ui/vba/vbatables.cxx
@@ -55,9 +55,7 @@ static bool lcl_isInHeaderFooter( const uno::Reference< text::XTextTable >& xTab
uno::Reference< text::XText > xText = xTextContent->getAnchor()->getText();
uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW );
OUString aImplName = xServiceInfo->getImplementationName();
- if ( aImplName == "SwXHeadFootText" )
- return true;
- return false;
+ return aImplName == "SwXHeadFootText";
}
typedef std::vector< uno::Reference< text::XTextTable > > XTextTableVec;
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 5661818f9ddf..54dde02de306 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -79,9 +79,7 @@ bool CheckMailAddress( const OUString& rMailAddress )
if (nPosAt<0 || rMailAddress.lastIndexOf('@')!=nPosAt)
return false;
const sal_Int32 nPosDot = rMailAddress.indexOf('.', nPosAt);
- if (nPosDot<0 || nPosDot-nPosAt<3 || rMailAddress.getLength()-nPosDot<3)
- return false;
- return true;
+ return !(nPosDot<0 || nPosDot-nPosAt<3 || rMailAddress.getLength()-nPosDot<3);
}
uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 635bf6fa0996..897583f5e7dd 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -247,10 +247,7 @@ bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
return true;
::tools::Rectangle aLineRect(m_pLine->GetPosPixel(), m_pLine->GetSizePixel());
- if (aLineRect.IsInside(rDocPt))
- return true;
-
- return false;
+ return aLineRect.IsInside(rDocPt);
}
void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&)
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 7aea3c768ac3..103bb496af75 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -404,10 +404,7 @@ bool SwPageBreakWin::Contains( const Point &rDocPt ) const
return true;
::tools::Rectangle aLineRect( m_pLine->GetPosPixel(), m_pLine->GetSizePixel() );
- if ( aLineRect.IsInside( rDocPt ) )
- return true;
-
- return false;
+ return aLineRect.IsInside( rDocPt );
}
void SwPageBreakWin::SetReadonly( bool bReadonly )
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 355629a7f051..79570a9b5ee0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1175,14 +1175,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb )
bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId);
if(bSetPos && bWeb)
{
- if (RndStdIds::FLY_AT_PAGE != eAnchorId)
- {
- bSetPos = false;
- }
- else
- {
- bSetPos = true;
- }
+ bSetPos = RndStdIds::FLY_AT_PAGE == eAnchorId;
}
if( bSetPos )
rSh.SetFlyPos( aTmp.Pos() );
@@ -1822,10 +1815,7 @@ KEYINPUT_CHECKTABLE:
goto KEYINPUT_CHECKTABLE_INSDEL;
KEYINPUT_CHECKTABLE_INSDEL:
- if( rSh.IsTableMode() || !rSh.GetTableFormat() ||
- !m_bTableInsDelMode ||
- false /* table protected */
- )
+ if( rSh.IsTableMode() || !rSh.GetTableFormat() || !m_bTableInsDelMode )
{
const SelectionType nSelectionType = rSh.GetSelectionType();
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index de2fdec67d33..f1d9e1a02112 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -268,10 +268,9 @@ bool SwFormatClipboard::HasContentForThisType( SelectionType nSelectionType ) co
bool SwFormatClipboard::CanCopyThisType( SelectionType nSelectionType )
{
- if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic
- | SelectionType::Text | SelectionType::DrawObject | SelectionType::Table | SelectionType::TableCell ) )
- return true;
- return false;
+ return bool(nSelectionType
+ & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic
+ | SelectionType::Text | SelectionType::DrawObject | SelectionType::Table | SelectionType::TableCell ));
}
void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bPersistentCopy )