summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-24 12:33:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-24 12:36:29 +0200
commit746a717ed4648cd6c0d0d810a90a6539373b130c (patch)
treea1a2b3a3df4f968ccc98423a5b163d4b366b4c16 /sw
parent24df2bd5cb68f8de5e22a27f6a3505d099bc3581 (diff)
loplugin:simplifybool
Change-Id: Ic90d247e6c8e36e27ff444ace10fd37e06d46b50
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/calbck.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/printdata.hxx2
-rw-r--r--sw/source/core/access/accfrmobj.cxx3
-rw-r--r--sw/source/core/crsr/crstrvl.cxx2
-rw-r--r--sw/source/core/crsr/pam.cxx8
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx4
-rw-r--r--sw/source/core/docnode/section.cxx2
-rw-r--r--sw/source/core/edit/acorrect.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx2
-rw-r--r--sw/source/core/layout/objectformatter.cxx5
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx4
-rw-r--r--sw/source/core/text/txtfld.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx6
-rw-r--r--sw/source/core/txtnode/thints.cxx3
-rw-r--r--sw/source/core/undo/undel.cxx5
-rw-r--r--sw/source/core/unocore/unofield.cxx5
-rw-r--r--sw/source/core/unocore/unoobj.cxx5
-rw-r--r--sw/source/core/unocore/unoportenum.cxx6
-rw-r--r--sw/source/core/view/printdata.cxx2
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx5
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx8
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx2
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par.hxx8
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx16
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx2
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx2
-rw-r--r--sw/source/uibase/app/swmodul1.cxx6
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx2
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx3
47 files changed, 90 insertions, 96 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index ab91b51faadd..a27b7e9abe88 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -224,7 +224,7 @@ public:
/** get Client information */
virtual bool GetInfo( SfxPoolItem& rInfo) const SAL_OVERRIDE
- { return m_pToTell ? m_pToTell->GetInfo( rInfo ) : true; }
+ { return m_pToTell == nullptr || m_pToTell->GetInfo( rInfo ); }
protected:
virtual void Modify( const SfxPoolItem* pOldValue, const SfxPoolItem *pNewValue ) SAL_OVERRIDE
{
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 3973cb37af46..e186da7aaedd 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -223,7 +223,7 @@ public:
inline const SwpHints &GetSwpHints() const;
inline SwpHints *GetpSwpHints() { return m_pSwpHints; }
inline const SwpHints *GetpSwpHints() const { return m_pSwpHints; }
- inline bool HasHints() const { return m_pSwpHints ? true : false; }
+ inline bool HasHints() const { return m_pSwpHints != nullptr; }
inline SwpHints &GetOrCreateSwpHints();
virtual ~SwTxtNode();
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index eed52d0a881f..11e1945d77dd 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -184,7 +184,7 @@ public:
bool IsPrintFormControls() const { return getBoolValue( "PrintControls", m_rDefaultPrintData.bPrintControl ); }
bool IsPrintPageBackground() const { return getBoolValue( "PrintPageBackground", m_rDefaultPrintData.bPrintPageBackground ); }
bool IsPrintProspect() const { return getBoolValue( "PrintProspect", m_rDefaultPrintData.bPrintProspect ); }
- bool IsPrintProspectRTL() const { return getIntValue( "PrintProspectRTL", m_rDefaultPrintData.bPrintProspectRTL ? 1 : 0 ) ? true : false; }
+ bool IsPrintProspectRTL() const { return getIntValue( "PrintProspectRTL", m_rDefaultPrintData.bPrintProspectRTL ? 1 : 0 ) != 0; }
bool IsPrintTextPlaceholders() const { return getBoolValue( "PrintTextPlaceholder", m_rDefaultPrintData.bPrintTextPlaceholder ); }
bool IsPrintHiddenText() const { return getBoolValue( "PrintHiddenText", m_rDefaultPrintData.bPrintHiddenText ); }
bool IsPrintWithBlackTextColor() const { return getBoolValue( "PrintBlackFonts", m_rDefaultPrintData.bPrintBlackFont ); }
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 0953d7f9b04d..04e0bbc43ce7 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -158,8 +158,7 @@ bool SwAccessibleChild::IsBoundAsChar() const
{
const SwFrmFmt* mpFrmFmt = ::FindFrmFmt( mpDrawObj );
bRet = mpFrmFmt
- ? (FLY_AS_CHAR == mpFrmFmt->GetAnchor().GetAnchorId())
- : false;
+ && (FLY_AS_CHAR == mpFrmFmt->GetAnchor().GetAnchorId());
}
else if ( mpWindow )
{
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 425fa09856f0..c45e6042b8a0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -636,7 +636,7 @@ lcl_FindField(bool & o_rFound, _SetGetExpFlds const& rSrtLst,
_SetGetExpFlds::const_iterator it = rSrtLst.lower_bound(pSrch.get());
- o_rFound = (it == rSrtLst.end()) ? false : (**it == *pSrch);
+ o_rFound = (it != rSrtLst.end()) && (**it == *pSrch);
return it;
}
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 1e94830d54ab..e449f949bc8b 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -97,7 +97,7 @@ bool SwPosition::operator<(const SwPosition &rPos) const
}
else // by convention position with no index is smaller
{
- return (pOtherReg) ? true : false;
+ return pOtherReg != nullptr;
}
}
return false;
@@ -119,7 +119,7 @@ bool SwPosition::operator>(const SwPosition &rPos) const
}
else // by convention position with no index is smaller
{
- return (pThisReg) ? true : false;
+ return pThisReg != nullptr;
}
}
return false;
@@ -141,7 +141,7 @@ bool SwPosition::operator<=(const SwPosition &rPos) const
}
else // by convention position with no index is smaller
{
- return (pThisReg) ? false : true;
+ return pThisReg == nullptr;
}
}
return false;
@@ -163,7 +163,7 @@ bool SwPosition::operator>=(const SwPosition &rPos) const
}
else // by convention position with no index is smaller
{
- return (pOtherReg) ? false : true;
+ return pOtherReg == nullptr;
}
}
return false;
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index ba5ddad31282..398a4ee13e78 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -688,7 +688,7 @@ SwExtraRedlineTbl& DocumentRedlineManager::GetExtraRedlineTbl()
bool DocumentRedlineManager::HasExtraRedlineTbl() const
{
- return mpExtraRedlineTbl ? true : false;
+ return mpExtraRedlineTbl != nullptr;
}
bool DocumentRedlineManager::IsInRedlines(const SwNode & rNode) const
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 505f284ff676..65a476aeb981 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -662,7 +662,7 @@ void SwDoc::CalculatePagesForPrinting(
bool bPrintLeftPages = bIsPDFExport || rOptions.IsPrintLeftPages();
bool bPrintRightPages = bIsPDFExport || rOptions.IsPrintRightPages();
// #i103700# printing selections should not allow for automatic inserting empty pages
- bool bPrintEmptyPages = bPrintSelection ? false : rOptions.IsPrintEmptyPages( bIsPDFExport );
+ bool bPrintEmptyPages = !bPrintSelection && rOptions.IsPrintEmptyPages( bIsPDFExport );
std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays();
std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet();
@@ -922,7 +922,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// of the prospect!
bool bPrintLeftPages = rOptions.IsPrintLeftPages();
bool bPrintRightPages = rOptions.IsPrintRightPages();
- bool bPrintProspectRTL = rOptions.getIntValue( "PrintProspectRTL", 0 ) ? true : false;
+ bool bPrintProspectRTL = rOptions.getIntValue( "PrintProspectRTL", 0 ) != 0;
// get pages for prospect printing according to the 'PageRange'
// (duplicates and any order allowed!)
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 7fb68343930d..a5707dc74a97 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1062,7 +1062,7 @@ bool SwSectionFmt::IsInContent() const
{
SwNodeIndex const*const pIdx = GetCntnt(false).GetCntntIdx();
OSL_ENSURE(pIdx, "SwSectionFmt::IsInContent: no index?");
- return (pIdx) ? !GetDoc()->IsInHeaderFooter(*pIdx) : true;
+ return pIdx == nullptr || !GetDoc()->IsInHeaderFooter(*pIdx);
}
// n.b.: if the section format represents an index, then there is both a
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index cc879ba8482d..cb05ac3ab61f 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -85,7 +85,7 @@ SwAutoCorrDoc::SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam,
sal_Unicode cIns )
: rEditSh( rEditShell ), rCrsr( rPam ), pIdx( 0 )
, m_nEndUndoCounter(0)
- , bUndoIdInitialized( cIns ? false : true )
+ , bUndoIdInitialized( cIns == 0 )
{
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 9d18a0022de2..2a1001d98581 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -899,7 +899,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
// If Seconds > 0 then bSec should be TRUE otherwise Seconds
// information will be lost if file has EditTime in Seconds format.
aStr = pLocalData->getTime( tools::Time(dur/3600, (dur%3600)/60, dur%60),
- (dur%60 > 0 ? true : false), false);
+ dur%60 > 0, false);
}
else
{
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index 039c1025b8f0..55861f365304 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -506,9 +506,8 @@ sal_uInt32 SwObjectFormatter::GetPgNumOfCollected( const sal_uInt32 _nIndex )
*/
bool SwObjectFormatter::IsCollectedAnchoredAtMaster( const sal_uInt32 _nIndex )
{
- return mpPgNumAndTypeOfAnchors
- ? mpPgNumAndTypeOfAnchors->AnchoredAtMaster(_nIndex)
- : true;
+ return mpPgNumAndTypeOfAnchors == nullptr
+ || mpPgNumAndTypeOfAnchors->AnchoredAtMaster(_nIndex);
}
/** accessor to total number of collected anchored objects
diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx
index f11d3effcdda..b7edff26c717 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -78,7 +78,7 @@ bool SwObjectFormatterLayFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
// #124218# - consider that the layout action has to be
// restarted due to a deleted page frame.
- return GetLayAction() ? !GetLayAction()->IsAgain() : true;
+ return GetLayAction() == nullptr || !GetLayAction()->IsAgain();
}
bool SwObjectFormatterLayFrm::DoFormatObjs()
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 64713bdacd82..f352675fb9b9 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3608,7 +3608,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
}
const SwPageFrm *pPage = 0;
- const bool bWin = gProp.pSGlobalShell->GetWin() ? true : false;
+ const bool bWin = gProp.pSGlobalShell->GetWin() != nullptr;
while ( IsAnLower( pFrm ) )
{
@@ -7125,7 +7125,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
return;
}
- const bool bFlys = pPage->GetSortedObjs() ? true : false;
+ const bool bFlys = pPage->GetSortedObjs() != nullptr;
const bool bCell = IsCellFrm();
// use frame area for cells
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index a55fb63e7933..5741651dbed7 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -92,7 +92,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
SwViewShell *pSh = rInf.GetVsh();
SwDoc *const pDoc( (pSh) ? pSh->GetDoc() : 0 );
- bool const bInClipboard( (pDoc) ? pDoc->IsClipBoard() : true );
+ bool const bInClipboard( pDoc == nullptr || pDoc->IsClipBoard() );
bool bPlaceHolder = false;
switch( pFld->GetTyp()->Which() )
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 8b0319a4fbd0..f2af63f11902 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -705,14 +705,14 @@ bool Meta::IsInUndo() const
{
const SwTxtNode * const pTxtNode( GetTxtNode() );
// no text node: in UNDO OSL_ENSURE(pTxtNode, "IsInUndo: no text node?");
- return (pTxtNode) ? pTxtNode->IsInUndo() : true;
+ return pTxtNode == nullptr || pTxtNode->IsInUndo();
}
bool Meta::IsInContent() const
{
const SwTxtNode * const pTxtNode( GetTxtNode() );
OSL_ENSURE(pTxtNode, "IsInContent: no text node?");
- return (pTxtNode) ? pTxtNode->IsInContent() : true;
+ return pTxtNode == nullptr || pTxtNode->IsInContent();
}
::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable >
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 91f617701d39..a454edf1328f 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3918,7 +3918,7 @@ bool SwTxtNode::IsListRestart() const
const SfxBoolItem& aIsRestartItem =
dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISRESTART ));
- return aIsRestartItem.GetValue() ? true : false;
+ return aIsRestartItem.GetValue();
}
/** Returns if the paragraph has a visible numbering or bullet.
@@ -4013,7 +4013,7 @@ bool SwTxtNode::IsNotificationEnabled() const
const SwDoc * pDoc = GetDoc();
if( pDoc )
{
- bResult = pDoc->IsInReading() || pDoc->IsInDtor() ? false : true;
+ bResult = !(pDoc->IsInReading() || pDoc->IsInDtor());
}
return bResult;
}
@@ -4038,7 +4038,7 @@ bool SwTxtNode::IsCountedInList() const
const SfxBoolItem& aIsCountedInListItem =
dynamic_cast<const SfxBoolItem&>(GetAttr( RES_PARATR_LIST_ISCOUNTED ));
- return aIsCountedInListItem.GetValue() ? true : false;
+ return aIsCountedInListItem.GetValue();
}
void SwTxtNode::AddToList()
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 6d4f283053ef..428256799a0c 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1594,8 +1594,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// 4263: AttrInsert durch TextInsert => kein Adjust
const bool bRet = bInsertHint
- ? m_pSwpHints->TryInsertHint( pAttr, *this, nMode )
- : false;
+ && m_pSwpHints->TryInsertHint( pAttr, *this, nMode );
if ( !bRet )
{
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 06d513d45d52..1bbab983891b 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -174,9 +174,8 @@ SwUndoDelete::SwUndoDelete(
: pEnd->nNode.GetNode().GetTxtNode();
}
- bool bMoveNds = *pStt == *pEnd // any area still existent?
- ? false
- : ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy );
+ bool bMoveNds = *pStt != *pEnd // any area still existent?
+ && ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy );
if( pSttTxtNd && pEndTxtNd && pSttTxtNd != pEndTxtNd )
{
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 1d2295f8ab0b..a77085a0e8f9 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1946,9 +1946,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
SwXTextCursor const*const pTextCursor(dynamic_cast<SwXTextCursor*>(pCursor));
const bool bForceExpandHints(
- (pTextCursor)
- ? pTextCursor->IsAtEndOfMeta()
- : false );
+ pTextCursor
+ && pTextCursor->IsAtEndOfMeta() );
const SetAttrMode nInsertFlags =
(bForceExpandHints)
? SetAttrMode::FORCEHINTEXPAND
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 444763fa2b1e..86b35a4e681c 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1771,9 +1771,8 @@ SwXTextCursor::setString(const OUString& aString) throw (uno::RuntimeException,
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
(void) rUnoCursor; // just to check if valid
- const bool bForceExpandHints( (CURSOR_META != m_pImpl->m_eType)
- ? false
- : dynamic_cast<SwXMeta*>(m_pImpl->m_xParentText.get())
+ const bool bForceExpandHints( (CURSOR_META == m_pImpl->m_eType)
+ && dynamic_cast<SwXMeta*>(m_pImpl->m_xParentText.get())
->CheckForOwnMemberMeta(*GetPaM(), true) );
DeleteAndInsert(aString, bForceExpandHints);
}
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 80c1abde888c..9e292197fd35 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -536,7 +536,7 @@ lcl_CreateRefMarkPortion(
{
pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_REFMARK_START);
pPortion->SetRefMark(xContent);
- pPortion->SetCollapsed(rAttr.End() ? false : true);
+ pPortion->SetCollapsed(rAttr.End() == nullptr);
}
else
{
@@ -556,7 +556,7 @@ lcl_InsertRubyPortion(
SwXTextPortion* pPortion = new SwXTextPortion(pUnoCrsr,
static_txtattr_cast<const SwTxtRuby&>(rAttr), xParent, bEnd);
rPortions.push_back(pPortion);
- pPortion->SetCollapsed(rAttr.End() ? false : true);
+ pPortion->SetCollapsed(rAttr.End() == nullptr);
}
static Reference<XTextRange>
@@ -577,7 +577,7 @@ lcl_CreateTOXMarkPortion(
{
pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_TOXMARK_START);
pPortion->SetTOXMark(xContent);
- pPortion->SetCollapsed(rAttr.GetEnd() ? false : true);
+ pPortion->SetCollapsed(rAttr.GetEnd() == nullptr);
}
else
{
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index f0c11fe2611c..337816cbc030 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -79,7 +79,7 @@ void SwRenderData::SetTempDocShell(SfxObjectShellLock const& xShell)
bool SwRenderData::NeedNewViewOptionAdjust( const SwViewShell& rCompare ) const
{
- return m_pViewOptionAdjust ? ! m_pViewOptionAdjust->checkShell( rCompare ) : true;
+ return !(m_pViewOptionAdjust && m_pViewOptionAdjust->checkShell( rCompare ));
}
void SwRenderData::ViewOptionAdjustStart(
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index bcd3150d351e..5e7abaff8f59 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -469,7 +469,7 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
AppendTxtNode( AM_NOSPACE, false );
bNoParSpace = false; // In <LI> wird kein Abstand eingefuegt!
- const bool bCountedInList( HTML_LISTHEADER_ON==nToken ? false : true );
+ const bool bCountedInList = nToken != HTML_LISTHEADER_ON;
_HTMLAttrContext *pCntxt = new _HTMLAttrContext( static_cast< sal_uInt16 >(nToken) );
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 25a1ffe05a93..f45fc1010d42 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1591,7 +1591,7 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
{
sal_uInt16 nSubType = rInfos.pField->GetSubType( );
bool bIsSetField = rInfos.pField->GetTyp( )->Which( ) == RES_SETEXPFLD;
- bool bShowRef = ( !bIsSetField || ( nSubType & nsSwExtendedSubType::SUB_INVISIBLE ) ) ? false : true;
+ bool bShowRef = bIsSetField && ( nSubType & nsSwExtendedSubType::SUB_INVISIBLE ) == 0;
if ( ( !m_sFieldBkm.isEmpty() ) && bShowRef )
{
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 6290ae0bd061..f2e554f1dde2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2218,7 +2218,7 @@ void RtfAttributeOutput::CharUnderline(const SvxUnderlineItem& rUnderline)
const SfxPoolItem* pItem = m_rExport.HasItem(RES_CHRATR_WORDLINEMODE);
bool bWord = false;
if (pItem)
- bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue() ? true : false;
+ bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue();
switch (rUnderline.GetLineStyle())
{
case UNDERLINE_SINGLE:
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index fef51ca962b7..9778834013e2 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -266,7 +266,7 @@ namespace myImplHelpers
pRet = 0;
}
- bool bStyExist = pRet ? true : false;
+ bool bStyExist = pRet != nullptr;
if (!pRet)
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 0edd7db5d902..d787258fce1c 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2639,9 +2639,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
const SwTable& rTable = pTableNode->GetTable();
const SvxFmtKeepItem& rKeep = rTable.GetFrmFmt()->GetKeep();
const bool bKeep = rKeep.GetValue();
- const bool bDontSplit = !bKeep ?
- !rTable.GetFrmFmt()->GetLayoutSplit().GetValue() :
- false;
+ const bool bDontSplit = !(bKeep ||
+ rTable.GetFrmFmt()->GetLayoutSplit().GetValue());
if ( bKeep || bDontSplit )
{
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 0481e7b830a6..049a4e32e0b4 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2858,9 +2858,9 @@ void WW8Export::WriteFkpPlcUsw()
if ( pFibData )
{
pFib->fReadOnlyRecommended =
- pFibData->getReadOnlyRecommended() ? true : false;
+ pFibData->getReadOnlyRecommended();
pFib->fWriteReservation =
- pFibData->getWriteReservation() ? true : false;
+ pFibData->getWriteReservation();
}
pFib->Write( Strm() ); // FIB
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7199c68a1d0f..3ec12e2a7fd5 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1194,12 +1194,12 @@ void WW8AttributeOutput::CharWeight( const SvxWeightItem& rWeight )
// Shadowed und Contour are not in WW-UI. JP: ??
void WW8AttributeOutput::CharContour( const SvxContourItem& rContour )
{
- OutputWW8Attribute( 3, rContour.GetValue() ? true : false);
+ OutputWW8Attribute( 3, rContour.GetValue() );
}
void WW8AttributeOutput::CharShadow( const SvxShadowedItem& rShadow )
{
- OutputWW8Attribute( 4, rShadow.GetValue() ? true : false);
+ OutputWW8Attribute( 4, rShadow.GetValue() );
}
void WW8AttributeOutput::CharKerning( const SvxKerningItem& rKerning )
@@ -1304,7 +1304,7 @@ void WW8AttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
const SfxPoolItem* pItem = m_rWW8Export.HasItem( RES_CHRATR_WORDLINEMODE );
bool bWord = false;
if (pItem)
- bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue() ? true : false;
+ bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue();
// WW95 - parameters: 0 = none, 1 = single, 2 = by Word,
// 3 = double, 4 = dotted, 5 = hidden
@@ -2706,7 +2706,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
+ pSet->GetPar1() + " \""
+ sVar + "\" ";
eFieldNo = ww::eSET;
- bShowAsWell = (nSubType & nsSwExtendedSubType::SUB_INVISIBLE) ? false : true;
+ bShowAsWell = (nSubType & nsSwExtendedSubType::SUB_INVISIBLE) == 0;
}
SetField( *pFld, eFieldNo, sStr );
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3a11d1e3b325..8249a066f2fd 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1782,7 +1782,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
case drawing::FillStyle_BITMAP:
{
GraphicObject aGrfObj(static_cast< XFillBitmapItem const & >(rOldSet.Get(XATTR_FILLBITMAP)).GetGraphicObject());
- const bool bTile(WW8ITEMVALUE(rOldSet, XATTR_FILLBMP_TILE, SfxBoolItem) ? true: false);
+ const bool bTile(WW8ITEMVALUE(rOldSet, XATTR_FILLBMP_TILE, SfxBoolItem));
if(bBrushItemOk) // has trans
{
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 275ac54d4437..cdfe2c418f01 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -268,7 +268,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, Graphic*& rpGraphic,
GDIMetaFile aWMF;
pSt->Seek( nPosFc );
- bool bOk = ReadWindowMetafile( *pSt, aWMF, NULL ) ? true : false;
+ bool bOk = ReadWindowMetafile( *pSt, aWMF, NULL );
if (!bOk || pSt->GetError() || !aWMF.GetActionSize())
return false;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 77f578ea32b7..5dfd048b85ce 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2345,9 +2345,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev,
}
bool bUseLeft
- = (nI & ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false;
+ = (nI & ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) != 0;
bool bUseFirst
- = (nI & ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false;
+ = (nI & ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) != 0;
// If we are loading a first-page header/footer which is not
// actually enabled in this section (it still needs to be
@@ -2355,7 +2355,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev,
bool bDisabledFirst = bUseFirst && !rSection.HasTitlePage();
bool bFooter
- = (nI & ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) ? true: false;
+ = (nI & ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) != 0;
SwFrmFmt& rFmt = bUseLeft ? pPD->GetLeft()
: bUseFirst ? pPD->GetFirstMaster()
@@ -4453,8 +4453,10 @@ void wwSectionManager::InsertSegments()
*/
bool bIgnoreCols = false;
- bool bThisAndNextAreCompatible = (aNext != aEnd) ? ((aIter->GetPageWidth() == aNext->GetPageWidth()) &&
- (aIter->GetPageHeight() == aNext->GetPageHeight()) && (aIter->IsLandScape() == aNext->IsLandScape())) : true;
+ bool bThisAndNextAreCompatible = (aNext == aEnd) ||
+ ((aIter->GetPageWidth() == aNext->GetPageWidth()) &&
+ (aIter->GetPageHeight() == aNext->GetPageHeight()) &&
+ (aIter->IsLandScape() == aNext->IsLandScape()));
if (((aNext != aEnd && aNext->IsContinuous() && bThisAndNextAreCompatible) || bProtected))
{
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 10421900018a..cee4cd42fae0 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -812,17 +812,17 @@ public:
bool IsVertical() const;
sal_Int16 NoCols() const { return maSep.ccolM1 + 1; }
sal_Int32 StandardColSeparation() const { return maSep.dxaColumns; }
- bool HasTitlePage() const { return maSep.fTitlePage ? true : false; }
+ bool HasTitlePage() const { return maSep.fTitlePage != 0; }
sal_uInt16 PageStartAt() const { return maSep.pgnStart; }
- bool PageRestartNo() const { return maSep.fPgnRestart ? true : false; }
- bool IsBiDi() const { return maSep.fBiDi ? true : false; }
+ bool PageRestartNo() const { return maSep.fPgnRestart != 0; }
+ bool IsBiDi() const { return maSep.fBiDi != 0; }
sal_uInt32 GetPageWidth() const { return nPgWidth; }
sal_uInt32 GetTextAreaWidth() const
{ return GetPageWidth() - GetPageLeft() - GetPageRight(); }
sal_uInt32 GetPageHeight() const { return maSep.yaPage; }
sal_uInt32 GetPageLeft() const { return nPgLeft; }
sal_uInt32 GetPageRight() const { return nPgRight; }
- bool IsLandScape() const { return maSep.dmOrientPage ? true : false; }
+ bool IsLandScape() const { return maSep.dmOrientPage != 0; }
bool IsFixedHeightHeader() const { return maSep.dyaTop < 0; }
bool IsFixedHeightFooter() const { return maSep.dyaBottom < 0; }
};
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 852dee7889d1..2a86c4ffaafe 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1238,10 +1238,10 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSe
if (nitcLim > nWwCols)
nitcLim = nWwCols;
- bool bChangeRight = (nFlag & 0x08) ? true : false;
- bool bChangeBottom = (nFlag & 0x04) ? true : false;
- bool bChangeLeft = (nFlag & 0x02) ? true : false;
- bool bChangeTop = (nFlag & 0x01) ? true : false;
+ bool bChangeRight = (nFlag & 0x08) != 0;
+ bool bChangeBottom = (nFlag & 0x04) != 0;
+ bool bChangeLeft = (nFlag & 0x02) != 0;
+ bool bChangeTop = (nFlag & 0x01) != 0;
WW8_TCell* pAktTC = pTCs + nitcFirst;
WW8_BRCVer9 brcVer9;
@@ -1825,7 +1825,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
eOri = aOriArr[*pParams & 0x3];
break;
case sprmTFBiDi:
- bIsBiDi = SVBT16ToShort(pParams) ? true : false;
+ bIsBiDi = SVBT16ToShort(pParams) != 0;
break;
case sprmTDxaGapHalf:
pNewBand->nGapHalf = (sal_Int16)SVBT16ToShort( pParams );
@@ -2315,7 +2315,7 @@ void WW8TabDesc::CreateSwTable(SvxULSpaceItem* pULSpaceItem)
// if there is already some content on the Node append new node to ensure
// that this content remains ABOVE the table
SwPosition* pPoint = pIo->pPaM->GetPoint();
- bool bInsNode = pPoint->nContent.GetIndex() ? true : false;
+ bool bInsNode = pPoint->nContent.GetIndex() != 0;
bool bSetMinHeight = false;
/*
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 104052a2c841..386b049e773f 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -446,7 +446,7 @@ WW8LFOInfo::WW8LFOInfo(const WW8LFO& rLFO)
, pNumRule(rLFO.pNumRule)
, nIdLst(rLFO.nIdLst)
, nLfoLvl(rLFO.nLfoLvl)
- , bOverride(rLFO.nLfoLvl ? true : false)
+ , bOverride(rLFO.nLfoLvl != 0)
, bSimpleList(rLFO.bSimpleList)
, bUsedInDoc(false)
, bLSTbUIDSet(false)
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 02bfbb323227..72f04ed2521d 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -156,7 +156,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
OSL_ENSURE( !pSt, "+OLE: Groesse von 0 ???" );
return false;
}
- bool bOk = ReadWindowMetafile( *pSt, rWMF, NULL ) ? true : false; // WMF lesen
+ bool bOk = ReadWindowMetafile( *pSt, rWMF, NULL ); // WMF lesen
// *pSt >> aWMF geht nicht ohne placable Header
if (!bOk || pSt->GetError() || rWMF.GetActionSize() == 0)
{
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 5f0fe6bffa6a..521e7f843957 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -170,7 +170,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
OUString sHex("\\x");
bool bSetAsHex;
bool bAllowCr = SwFltGetFlag(nFieldFlags,
- SwFltControlStack::ALLOW_FLD_CR) ? true : false;
+ SwFltControlStack::ALLOW_FLD_CR);
for( sal_Int32 nI = 0;
nI < aVal.getLength() && aVal.getLength() < (MAX_FIELDLEN - 4);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index d107eba7d69c..f4781a79068a 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -917,7 +917,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
{
// sprmSFEvenlySpaced
aNewSection.maSep.fEvenlySpaced =
- sal_uInt8(ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) ? true : false);
+ sal_uInt8(ReadBSprm(pSep, (eVer <= ww::eWW7 ? 138 : 0x3005), 1) != 0);
if (aNewSection.maSep.ccolM1 > 0 && !aNewSection.maSep.fEvenlySpaced)
{
@@ -4298,7 +4298,7 @@ bool SwWW8ImplReader::IsRightToLeft()
const sal_uInt8 *pDir =
pPlcxMan ? pPlcxMan->GetPapPLCF()->HasSprm(0x2441) : 0;
if (pDir)
- bRTL = *pDir ? true : false;
+ bRTL = *pDir != 0;
else
{
const SvxFrameDirectionItem* pItem=
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 703bcf2f4f3a..e409085e493b 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1155,7 +1155,7 @@ void WW8PLCFx_PCD::SetIdx( sal_uLong nIdx )
bool WW8PLCFx_PCD::SeekPos(WW8_CP nCpPos)
{
- return pPcdI ? pPcdI->SeekPos( nCpPos ) : false;
+ return pPcdI && pPcdI->SeekPos( nCpPos );
}
WW8_CP WW8PLCFx_PCD::Where()
@@ -1388,7 +1388,7 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
if (pWw8Fib->nVersion >= 8)
bIsUnicode = false;
else
- bIsUnicode = pWw8Fib->fExtChar ? true : false;
+ bIsUnicode = pWw8Fib->fExtChar;
if( pPieceIter ) // Complex File ?
{
@@ -1412,7 +1412,7 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
}
else
{
- bIsUnicode = pWw8Fib->fExtChar ? true : false;
+ bIsUnicode = pWw8Fib->fExtChar;
}
sal_Int32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
@@ -1472,7 +1472,7 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
if (pWw8Fib->nVersion >= 8)
*pIsUnicode = false;
else
- *pIsUnicode = pWw8Fib->fExtChar ? true : false;
+ *pIsUnicode = pWw8Fib->fExtChar;
if( pPieceIter )
{
@@ -1507,7 +1507,7 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
if (pWw8Fib->nVersion >= 8)
nRet = WW8PLCFx_PCD::TransformPieceAddress( nRet, *pIsUnicode );
else
- *pIsUnicode = pWw8Fib->fExtChar ? true : false;
+ *pIsUnicode = pWw8Fib->fExtChar;
nRet += (nCpPos - nCpStart) * (*pIsUnicode ? 2 : 1);
@@ -2441,7 +2441,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
sal_Size nOldPos = pSt->Tell();
bool bCouldSeek = checkSeek(*pSt, nFilePos);
- bool bCouldRead = bCouldSeek ? checkRead(*pSt, maRawData, 512) : false;
+ bool bCouldRead = bCouldSeek && checkRead(*pSt, maRawData, 512);
mnIMax = bCouldRead ? maRawData[511] : 0;
@@ -3624,7 +3624,7 @@ void WW8PLCFx_SubDoc::SetIdx( sal_uLong nIdx )
bool WW8PLCFx_SubDoc::SeekPos( WW8_CP nCpPos )
{
- return ( pRef ) ? pRef->SeekPos( nCpPos ) : false;
+ return pRef && pRef->SeekPos( nCpPos );
}
WW8_CP WW8PLCFx_SubDoc::Where()
@@ -3738,7 +3738,7 @@ void WW8PLCFx_FLD::SetIdx( sal_uLong nIdx )
bool WW8PLCFx_FLD::SeekPos(WW8_CP nCpPos)
{
- return pPLCF ? pPLCF->SeekPosExact( nCpPos ) : false;
+ return pPLCF && pPLCF->SeekPosExact( nCpPos );
}
WW8_CP WW8PLCFx_FLD::Where()
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 80c8dcc28964..613649e7800d 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -749,7 +749,7 @@ public:
WW8_CP GetStartPos() const
{ return ( nIsEnd ) ? WW8_CP_MAX : pBook[0]->Where(); }
long GetLen() const;
- bool GetIsEnd() const { return nIsEnd ? true : false; }
+ bool GetIsEnd() const { return nIsEnd != 0; }
long GetHandle() const;
void SetStatus( sal_uInt16 nIndex, eBookStatus eStat );
bool MapName(OUString& rName);
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index f780d35f3446..1386638a4e20 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -190,7 +190,7 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
OUString SwSelectDBTableDialog::GetSelectedTable(bool& bIsTable)
{
SvTreeListEntry* pEntry = m_pTable->FirstSelected();
- bIsTable = pEntry->GetUserData() ? false : true;
+ bIsTable = pEntry->GetUserData() == nullptr;
return SvTabListBox::GetEntryText(pEntry, 0);
}
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index d64b949e9526..a0763d3894a8 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -145,9 +145,9 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
SwViewShell* pSh = pCurrView ? &pCurrView->GetWrtShell() : 0;
SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(GetUsrPref(
- VIEWOPT_DEST_WEB == nDest ? true :
- VIEWOPT_DEST_TEXT== nDest ? false :
- pCurrView && pCurrView->ISA(SwWebView) ));
+ nDest == VIEWOPT_DEST_WEB
+ || (nDest != VIEWOPT_DEST_TEXT
+ && pCurrView && pCurrView->ISA(SwWebView)) ));
// with Uno, only sdbcx::View, but not the Module should be changed
bool bViewOnly = VIEWOPT_DEST_VIEW_ONLY == nDest;
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 763ae8986566..7b36acd7ccb3 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1551,7 +1551,7 @@ long SwPostItMgr::GetNextBorder()
{
SwSidebarItem_iterator aNext = b;
++aNext;
- bool bFollow = (aNext == mPages[n]->mList->end()) ? false : (*aNext)->pPostIt->IsFollow();
+ bool bFollow = (aNext != mPages[n]->mList->end()) && (*aNext)->pPostIt->IsFollow();
if ( mPages[n]->bScrollbar || bFollow )
{
return -1;
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx
index 5314869113ef..796d8bcc715b 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -694,7 +694,7 @@ bool SwHHCWrapper::FindConvText_impl()
bool SwHHCWrapper::HasOtherCnt_impl()
{
- return m_bIsSelection ? false : m_rWrtShell.HasOtherCnt();
+ return !m_bIsSelection && m_rWrtShell.HasOtherCnt();
}
void SwHHCWrapper::ConvStart_impl( SwConversionArgs /* [out] */ *pConversionArgs, SvxSpellArea eArea )
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 015ac8c79a90..4760baecfeaf 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -470,7 +470,7 @@ bool PageMarginControl::GetUserCustomValues()
if ( aSeq.getLength())
aSeq[0].Value >>= aTmp;
OUString aWinData( aTmp );
- mbUserCustomMirrored = aWinData.toInt32() == 0 ? false : true;
+ mbUserCustomMirrored = aWinData.toInt32() != 0;
bUserCustomValuesAvailable = true;
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 2dba59d8d1b8..f052dbe1e2ea 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1747,8 +1747,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pItem ))
{
const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pItem)->GetValue();
- const bool bBookMode = (0 == nColumns || 0 != (nColumns % 2)) ?
- false :
+ const bool bBookMode = !(0 == nColumns || 0 != (nColumns % 2)) &&
static_cast<const SvxViewLayoutItem *>(pItem)->IsBookMode();
SetViewLayout( nColumns, bBookMode );