diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-02 15:42:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-05 12:47:48 +0200 |
commit | 4f9b21248ffdf55cef9f3f9d1da76778ee000775 (patch) | |
tree | b059d288339a68aa4c3901f1100e99b04d05a23d /sw/source/core/unocore/unorefmk.cxx | |
parent | b4107411900f5bb4c215e2d9db09fc2b2b82939b (diff) |
simplify ternary conditions "xxx ? yyy : false"
Look for code like:
xxx ? yyy : false;
Which can be simplified to:
xxx && yyy
Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
Diffstat (limited to 'sw/source/core/unocore/unorefmk.cxx')
-rw-r--r-- | sw/source/core/unocore/unorefmk.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 2b747742ae03..eace1acde1c2 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -57,8 +57,7 @@ public: : SwClient((pDoc) ? pDoc->GetUnoCallBack() : 0) , m_rThis(rThis) , m_EventListeners(m_Mutex) - // #i111177# unxsols4 (Sun C++ 5.9 SunOS_sparc) may generate wrong code - , m_bIsDescriptor((0 == pRefMark) ? true : false) + , m_bIsDescriptor(0 == pRefMark) , m_pDoc(pDoc) , m_pMarkFmt(pRefMark) { @@ -213,8 +212,7 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam, SwFmtRefMark aRefMark(m_sMarkName); bool bMark = *rPam.GetPoint() != *rPam.GetMark(); - const bool bForceExpandHints( (!bMark && pCursor) - ? pCursor->IsAtEndOfMeta() : false ); + const bool bForceExpandHints( !bMark && pCursor && pCursor->IsAtEndOfMeta() ); const SetAttrMode nInsertFlags = (bForceExpandHints) ? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND | nsSetAttrMode::SETATTR_DONTEXPAND) @@ -669,8 +667,7 @@ public: , m_EventListeners(m_Mutex) , m_pTextPortions( pPortions ) , m_bIsDisposed( false ) - // #i111177# unxsols4 (Sun C++ 5.9 SunOS_sparc) may generate wrong code - , m_bIsDescriptor((0 == pMeta) ? true : false) + , m_bIsDescriptor(0 == pMeta) , m_xParentText(xParentText) , m_Text(rDoc, rThis) { @@ -1021,8 +1018,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) SwXTextCursor const*const pTextCursor( dynamic_cast<SwXTextCursor*>(pCursor)); - const bool bForceExpandHints((pTextCursor) - ? pTextCursor->IsAtEndOfMeta() : false); + const bool bForceExpandHints(pTextCursor && pTextCursor->IsAtEndOfMeta()); const SetAttrMode nInsertFlags( (bForceExpandHints) ? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND | nsSetAttrMode::SETATTR_DONTEXPAND) |