summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-18 08:27:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-18 09:46:28 +0200
commit5fb66ae5595b7435e8954df31473fad15a74b8c2 (patch)
tree3b3f0ce3eafa10557a7e78b10851c97ee16c7ebf /sw
parent181a1b36ac728e3a43e054496ceb53fd3315abdb (diff)
clang-tidy readability-simplify-boolean-expr
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64 Reviewed-on: https://gerrit.libreoffice.org/61902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/atrfld.cxx7
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx27
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx5
3 files changed, 9 insertions, 30 deletions
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 6741375ee4ad..4fb9dbc606c0 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -306,12 +306,9 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
bool SwFormatField::GetInfo( SfxPoolItem& rInfo ) const
{
const SwTextNode* pTextNd;
- if( RES_AUTOFMT_DOCNODE != rInfo.Which() ||
+ return RES_AUTOFMT_DOCNODE != rInfo.Which() ||
!mpTextField || nullptr == ( pTextNd = mpTextField->GetpTextNode() ) ||
- &pTextNd->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes )
- return true;
-
- return false;
+ &pTextNd->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes;
}
bool SwFormatField::IsFieldInDoc() const
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index a833dbe064f3..ea924809a705 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -71,13 +71,8 @@ void SwTextCharFormat::ModifyNotification( const SfxPoolItem* pOld, const SfxPoo
bool SwTextCharFormat::GetInfo( SfxPoolItem const & rInfo ) const
{
- if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
- &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode const &>(rInfo).pNodes )
- {
- return true;
- }
-
- return false;
+ return RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
+ &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode const &>(rInfo).pNodes;
}
SwTextAttrNesting::SwTextAttrNesting( SfxPoolItem & i_rAttr,
@@ -184,13 +179,8 @@ void SwTextINetFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
bool SwTextINetFormat::GetInfo( SfxPoolItem& rInfo ) const
{
- if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
- &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes )
- {
- return true;
- }
-
- return false;
+ return RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
+ &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes;
}
bool SwTextINetFormat::IsProtect( ) const
@@ -232,13 +222,8 @@ void SwTextRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
bool SwTextRuby::GetInfo( SfxPoolItem& rInfo ) const
{
- if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
- &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes )
- {
- return true;
- }
-
- return false;
+ return RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode ||
+ &m_pTextNode->GetNodes() != static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes;
}
SwCharFormat* SwTextRuby::GetCharFormat()
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3d539978f096..8dc33bfd8b71 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5149,10 +5149,7 @@ bool DocxAttributeOutput::ExportAsActiveXControl(const SdrObject* pObject) const
return false;
oox::ole::OleFormCtrlExportHelper exportHelper(comphelper::getProcessComponentContext(), xModel, xControlModel);
- if(!exportHelper.isValid())
- return false;
-
- return true;
+ return exportHelper.isValid();
}
void DocxAttributeOutput::PostponeOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrameFormat* pFlyFrameFormat )