diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:32:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:24 +0200 |
commit | 36b06bffadac67b30a5e81b66315cf972c26da88 (patch) | |
tree | 01ef81ad5ba7cf52731145bfa4e2146ea8bfbafa /lotuswordpro/source/filter | |
parent | 319c5f8fef83cf35701934192af3f7f2985962bd (diff) |
loplugin:simplifybool
Change-Id: If09fcea7bea9d246e81e3fb9824d284212e8719b
Diffstat (limited to 'lotuswordpro/source/filter')
-rw-r--r-- | lotuswordpro/source/filter/lwpdivinfo.hxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.cxx | 33 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwppara.cxx | 6 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptblcell.hxx | 6 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptoc.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptoc.hxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptools.hxx | 4 |
7 files changed, 30 insertions, 31 deletions
diff --git a/lotuswordpro/source/filter/lwpdivinfo.hxx b/lotuswordpro/source/filter/lwpdivinfo.hxx index cb073d76a3c4..6ac2fb503eca 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.hxx +++ b/lotuswordpro/source/filter/lwpdivinfo.hxx @@ -139,7 +139,7 @@ private: inline bool LwpDivInfo::HasContents() { - return (m_nFlags & DI_HASCONTENTS) ? true : false; + return (m_nFlags & DI_HASCONTENTS) != 0; } inline bool LwpDivInfo::IsOleDivision() @@ -152,7 +152,7 @@ inline bool LwpDivInfo::IsOleDivision() inline bool LwpDivInfo::IsScrollable() { - return (m_nFlags & DI_SCROLLABLE) ? true : false; + return (m_nFlags & DI_SCROLLABLE) != 0; } inline bool LwpDivInfo::IsGotoable() diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index cc37eb468bed..38634586e8ea 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -109,7 +109,7 @@ void LwpVirtualLayout::Read() bool LwpVirtualLayout::MarginsSameAsParent() { - return m_nAttributes2 & STYLE2_MARGINSSAMEASPARENT ? true : false; + return (m_nAttributes2 & STYLE2_MARGINSSAMEASPARENT) != 0; } /** @@ -218,7 +218,7 @@ bool LwpVirtualLayout::HasProtection() */ bool LwpVirtualLayout::IsComplex() { - return m_nAttributes & STYLE_COMPLEX ? true : false; + return (m_nAttributes & STYLE_COMPLEX) != 0; } /** @@ -1054,7 +1054,7 @@ bool LwpMiddleLayout::IsSizeRightToContainer() else if (m_BasedOnStyle.obj().is()) { LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj().get()); - return pLayout ? pLayout->IsSizeRightToContainer() : false; + return pLayout && pLayout->IsSizeRightToContainer(); } else return false; @@ -1073,7 +1073,7 @@ bool LwpMiddleLayout::IsSizeRightToContent() else if (m_BasedOnStyle.obj().is()) { LwpMiddleLayout * pLayout = dynamic_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj().get()); - return pLayout ? pLayout->IsSizeRightToContent() : false; + return pLayout && pLayout->IsSizeRightToContent(); } else return false; @@ -1158,15 +1158,14 @@ bool LwpMiddleLayout::IsAutoGrow() { if(m_nOverrideFlag & OVER_SIZE) { - return m_nDirection & + return (m_nDirection & ((LAY_AUTOGROW << SHIFT_UP) | (LAY_AUTOGROW << SHIFT_DOWN) | - (LAY_AUTOGROW << SHIFT_RIGHT) | (LAY_AUTOGROW << SHIFT_LEFT)) - ? true : false; + (LAY_AUTOGROW << SHIFT_RIGHT) | (LAY_AUTOGROW << SHIFT_LEFT))) != 0; } else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - return pLay ? pLay->IsAutoGrow() : false; + return pLay && pLay->IsAutoGrow(); } return LwpVirtualLayout::IsAutoGrow(); } @@ -1179,12 +1178,12 @@ bool LwpMiddleLayout::IsAutoGrowDown() { if(m_nOverrideFlag & OVER_SIZE) { - return m_nDirection & (LAY_AUTOGROW << SHIFT_DOWN) ? true : false; + return (m_nDirection & (LAY_AUTOGROW << SHIFT_DOWN)) != 0; } else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - return pLay ? pLay->IsAutoGrowDown() : false; + return pLay && pLay->IsAutoGrowDown(); } return LwpVirtualLayout::IsAutoGrowDown(); } @@ -1197,12 +1196,12 @@ bool LwpMiddleLayout::IsAutoGrowUp() { if(m_nOverrideFlag & OVER_SIZE) { - return m_nDirection & (LAY_AUTOGROW << SHIFT_UP) ? true : false; + return (m_nDirection & (LAY_AUTOGROW << SHIFT_UP)) != 0; } else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - return pLay ? pLay->IsAutoGrowUp() : false; + return pLay && pLay->IsAutoGrowUp(); } return LwpVirtualLayout::IsAutoGrowUp(); } @@ -1215,7 +1214,7 @@ bool LwpMiddleLayout::IsAutoGrowLeft() { if(m_nOverrideFlag & OVER_SIZE) { - return m_nDirection & (LAY_AUTOGROW << SHIFT_LEFT) ? true : false; + return (m_nDirection & (LAY_AUTOGROW << SHIFT_LEFT)) != 0; } else if( !m_BasedOnStyle.IsNull() ) { @@ -1234,12 +1233,12 @@ bool LwpMiddleLayout::IsAutoGrowRight() { if(m_nOverrideFlag & OVER_SIZE) { - return m_nDirection & (LAY_AUTOGROW << SHIFT_RIGHT) ? true : false; + return (m_nDirection & (LAY_AUTOGROW << SHIFT_RIGHT)) != 0; } else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - return pLay ? pLay->IsAutoGrowRight() : false; + return pLay && pLay->IsAutoGrowRight(); } return LwpVirtualLayout::IsAutoGrowRight(); } @@ -1316,7 +1315,7 @@ bool LwpMiddleLayout::IsProtected() else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - bProtected = pLay ? pLay->IsProtected() : false; + bProtected = pLay && pLay->IsProtected(); } else bProtected = LwpVirtualLayout::IsProtected(); @@ -1442,7 +1441,7 @@ bool LwpMiddleLayout::GetUsePrinterSettings() else if( !m_BasedOnStyle.IsNull() ) { LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj().get() ); - return pLay ? pLay->GetUsePrinterSettings() : false; + return pLay && pLay->GetUsePrinterSettings(); } return false; } diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index d1c2e5f7189f..7cebb589f0ea 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -174,8 +174,8 @@ void LwpPara::Read() const int DISK_SIMPLE = 1; const int DISK_NOTIFY = 2; - Simple = (Flag & DISK_SIMPLE) ? true : false; - Notify = (Flag & DISK_NOTIFY) ? true : false; + Simple = (Flag & DISK_SIMPLE) != 0; + Notify = (Flag & DISK_NOTIFY) != 0; } if(!Simple) @@ -613,7 +613,7 @@ void LwpPara::RegisterStyle() * higher than our current level. */ // restart based on Outline level? - if (pNumbering && bLesser && (bHeading ? pNumbering->IsHeading() : true)) + if (pNumbering && bLesser && (!bHeading || pNumbering->IsHeading())) { if (nFoundLevel != 0xffff) { diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx index ed66cf744858..2a2273cb153d 100644 --- a/lotuswordpro/source/filter/lwptblcell.hxx +++ b/lotuswordpro/source/filter/lwptblcell.hxx @@ -290,19 +290,19 @@ LwpRowColumnQualifier::LwpRowColumnQualifier() inline bool LwpRowColumnQualifier::IsAfter() { - return cFlags & REF_AFTER ? true : false; + return (cFlags & REF_AFTER) != 0; } inline bool LwpRowColumnQualifier::IsBad() { - return cFlags & REF_BAD ? true : false; + return (cFlags & REF_BAD) != 0; } inline bool LwpRowColumnQualifier::IsAbsolute() { - return cFlags & REF_ABSOLUTE ? true : false; + return (cFlags & REF_ABSOLUTE) != 0; } /** * @brief diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx index e209557bedb9..75b9aa7ef7fa 100644 --- a/lotuswordpro/source/filter/lwptoc.cxx +++ b/lotuswordpro/source/filter/lwptoc.cxx @@ -337,7 +337,7 @@ void LwpTocSuperLayout::AddSourceStyle(XFIndex* pToc, LwpTocLevelData * pLevel, bool LwpTocSuperLayout::GetRightAlignPageNumber(sal_uInt16 index) { if (index < MAX_LEVELS) - return (m_nFlags[index] & TS_RIGHTALIGN) ? true : false; + return (m_nFlags[index] & TS_RIGHTALIGN) != 0; return false; } /** @@ -348,7 +348,7 @@ bool LwpTocSuperLayout::GetRightAlignPageNumber(sal_uInt16 index) bool LwpTocSuperLayout::GetUsePageNumber(sal_uInt16 index) { if (index < MAX_LEVELS) - return (m_nFlags[index] & TS_PAGENUMBER) ? true : false; + return (m_nFlags[index] & TS_PAGENUMBER) != 0; return false; } /** diff --git a/lotuswordpro/source/filter/lwptoc.hxx b/lotuswordpro/source/filter/lwptoc.hxx index 84a859dcdbcb..59d922aeaa94 100644 --- a/lotuswordpro/source/filter/lwptoc.hxx +++ b/lotuswordpro/source/filter/lwptoc.hxx @@ -153,9 +153,9 @@ public: void RegisterStyle() SAL_OVERRIDE; virtual void XFConvert(XFContentContainer* pCont) SAL_OVERRIDE; inline sal_uInt16 GetLevel(){return m_nLevel;} - inline bool GetUseText(){ return (m_nFlags & USETEXT) ? true : false;} + inline bool GetUseText(){ return (m_nFlags & USETEXT) != 0;} inline OUString GetSearchStyle(){return m_SearchName.str();} - inline bool GetUseLeadingText(){ return (m_nFlags & USENUMBER) ? true : false;} + inline bool GetUseLeadingText(){ return (m_nFlags & USENUMBER) != 0;} private: virtual ~LwpTocLevelData(); diff --git a/lotuswordpro/source/filter/lwptools.hxx b/lotuswordpro/source/filter/lwptools.hxx index 584b418cba5a..42d9a55dc7fb 100644 --- a/lotuswordpro/source/filter/lwptools.hxx +++ b/lotuswordpro/source/filter/lwptools.hxx @@ -135,11 +135,11 @@ inline sal_Int32 LwpTools::ConvertToUnits(const double& fInch) } inline bool LwpTools::IsOddNumber(sal_uInt16& nNumber) { - return (nNumber%2)? true : false; + return (nNumber%2) != 0; } inline bool LwpTools::IsEvenNumber(sal_uInt16& nNumber) { - return (nNumber%2)? false : true; + return (nNumber%2) == 0; } class BadSeek : public std::runtime_error |