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 | |
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')
38 files changed, 71 insertions, 87 deletions
diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx index d3f73f20439d..ea7f14f7665a 100644 --- a/sw/inc/edimp.hxx +++ b/sw/inc/edimp.hxx @@ -46,9 +46,9 @@ struct SwPamRange SwPamRange( sal_uLong nS, sal_uLong nE ) : nStart( nS ), nEnd( nE ) {} bool operator==( const SwPamRange& rRg ) const - { return nStart == rRg.nStart ? true : false; } + { return nStart == rRg.nStart; } bool operator<( const SwPamRange& rRg ) const - { return nStart < rRg.nStart ? true : false; } + { return nStart < rRg.nStart; } }; class _SwPamRanges : public o3tl::sorted_vector<SwPamRange> {}; diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 1cefdf479c1d..2bcc64bd4684 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -696,14 +696,14 @@ public: /// Hidden Paragraph Field: inline bool CalcHiddenParaField() - { return m_pSwpHints ? m_pSwpHints->CalcHiddenParaField() : false; } + { return m_pSwpHints && m_pSwpHints->CalcHiddenParaField(); } /// set CalcVisible flags inline void SetCalcHiddenParaField() { if (m_pSwpHints) m_pSwpHints->SetCalcHiddenParaField(); } /// is the paragraph visible? inline bool HasHiddenParaField() const - { return m_pSwpHints ? m_pSwpHints->HasHiddenParaField() : false; } + { return m_pSwpHints && m_pSwpHints->HasHiddenParaField(); } /// Hidden Paragraph Field: diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 09fae2081264..61c6410024c5 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -243,7 +243,7 @@ bool SwNodeNum::LessThan(const SwNumberTreeNode & rNode) const { // #i83479# - refactoring // simplify comparison by comparing the indexes of the text nodes - bResult = ( mpTxtNode->GetIndex() < rTmpNode.mpTxtNode->GetIndex() ) ? true : false; + bResult = ( mpTxtNode->GetIndex() < rTmpNode.mpTxtNode->GetIndex() ); } return bResult; diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 60e5f99e9eb6..b35a53d8eb90 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -690,7 +690,7 @@ void SwNumberTreeNode::RemoveMe() bool SwNumberTreeNode::IsValid() const { - return mpParent ? mpParent->IsValid(this) : false; + return mpParent && mpParent->IsValid(this); } SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::GetNumber(bool bValidate) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 40451b7034d8..d6b949a119e8 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -719,7 +719,7 @@ struct ContainsPredicate ContainsPredicate( const Point& rPoint ) : mrPoint(rPoint) {} bool operator() ( const Rectangle& rRect ) const { - return rRect.IsInside( mrPoint ) ? true : false; + return rRect.IsInside( mrPoint ); } }; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 9f69d01eec80..64ba629b1fce 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1435,7 +1435,7 @@ struct IndexCompare IndexCompare( const PropertyValue* pVals ) : pValues(pVals) {} bool operator() ( const sal_Int32& a, const sal_Int32& b ) const { - return (pValues[a].Name < pValues[b].Name) ? true : false; + return (pValues[a].Name < pValues[b].Name); } }; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 5327f7645ccc..80febe13fdb1 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -622,7 +622,7 @@ bool SwCrsrShell::MoveFldType( } // found Modify object, add all fields to array - ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) ); + ::lcl_MakeFldLst( aSrtLst, *pFldType, IsReadOnlyAvailable() ); if( RES_INPUTFLD == pFldType->Which() && bAddSetExpressionFldsToInputFlds ) { @@ -634,7 +634,7 @@ bool SwCrsrShell::MoveFldType( pFldType = rFldTypes[ i ]; if ( RES_SETEXPFLD == pFldType->Which() ) { - ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ), true ); + ::lcl_MakeFldLst( aSrtLst, *pFldType, IsReadOnlyAvailable(), true ); } } } @@ -648,7 +648,7 @@ bool SwCrsrShell::MoveFldType( pFldType = rFldTypes[ i ]; if( nResType == pFldType->Which() ) { - ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) ); + ::lcl_MakeFldLst( aSrtLst, *pFldType, IsReadOnlyAvailable() ); } } } diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 13da404d4a5c..4afd2ee47e12 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1014,7 +1014,7 @@ SwPosFlyFrms SwDoc::GetAllFlyFmts( const SwPaM* pCmpRange, bool bDrawAlso, for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->size(); ++n ) { pFly = (*GetSpzFrmFmts())[ n ]; - bool bDrawFmt = bDrawAlso ? RES_DRAWFRMFMT == pFly->Which() : false; + bool bDrawFmt = bDrawAlso && RES_DRAWFRMFMT == pFly->Which(); bool bFlyFmt = RES_FLYFRMFMT == pFly->Which(); if( bFlyFmt || bDrawFmt ) { diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 83773efc8589..45a1d48959a2 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -970,7 +970,7 @@ void SwDoc::SetNumRuleStart( const SwPosition& rPos, bool bFlag ) GetIDocumentUndoRedo().AppendUndo(pUndo); } - pTxtNd->SetListRestart(bFlag ? true : false); + pTxtNd->SetListRestart(bFlag); SetModified(); } @@ -2065,8 +2065,8 @@ bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, bool bDel ) if ( !pTxtNd->IsCountedInList() == !bDel) { bool bOldNum = bDel; - bool bNewNum = bDel ? sal_False : sal_True; - pTxtNd->SetCountedInList(bNewNum ? true : false); + bool bNewNum = !bDel; + pTxtNd->SetCountedInList(bNewNum); SetModified(); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 8b1ef00a800c..680d8d1d2702 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -252,10 +252,9 @@ inline bool IsPrevPos( const SwPosition rPos1, const SwPosition rPos2 ) { const SwCntntNode* pCNd; return 0 == rPos2.nContent.GetIndex() && - rPos2.nNode.GetIndex() - 1 == rPos1.nNode.GetIndex() && - 0 != ( pCNd = rPos1.nNode.GetNode().GetCntntNode() ) - ? rPos1.nContent.GetIndex() == pCNd->Len() - : false; + rPos2.nNode.GetIndex() - 1 == rPos1.nNode.GetIndex() && + 0 != ( pCNd = rPos1.nNode.GetNode().GetCntntNode() ) && + rPos1.nContent.GetIndex() == pCNd->Len(); } #if OSL_DEBUG_LEVEL > 0 diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index f66f4eb71685..94c3f2e530bd 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -608,7 +608,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, SwSection* pSection = pFmt->GetSection(); /// remember hidden condition flag of SwSection before changes - bool bOldCondHidden = pSection->IsCondHidden() ? true : false; + bool bOldCondHidden = pSection->IsCondHidden(); if (pSection->DataEquals(rNewData)) { @@ -724,7 +724,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, /// This is necessary, because otherwise the <SetCondHidden> would have /// no effect. bool bCalculatedCondHidden = - aCalc.Calculate( pSection->GetCondition() ).GetBool() ? true : false; + aCalc.Calculate( pSection->GetCondition() ).GetBool(); if ( bCalculatedCondHidden && !bOldCondHidden ) { pSection->SetCondHidden( false ); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 367b64c95d3e..03d3a39b9977 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1816,7 +1816,7 @@ void SwFEShell::BreakCreate() bool SwFEShell::IsDrawCreate() const { - return Imp()->HasDrawView() ? Imp()->GetDrawView()->IsCreateObj() : false; + return Imp()->HasDrawView() && Imp()->GetDrawView()->IsCreateObj(); } bool SwFEShell::BeginMark( const Point &rPos ) @@ -2877,7 +2877,7 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const OSL_ENSURE( pPageFrm, "inconsistent modell - no page!"); if ( pPageFrm ) { - bRet = pPageFrm->IsRightToLeft() ? true : false; + bRet = pPageFrm->IsRightToLeft(); } } } diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 7231e01d1756..40c6c98815fd 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -697,8 +697,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if( bVert || bVertL2R ) { - bVertic = bVert ? true : false; - bVerticalL2R = bVertL2R ? true : false; + bVertic = bVert; + bVerticalL2R = bVertL2R; _bMirror = false; // no mirroring in vertical environment switch ( _eHoriRelOrient ) { @@ -1030,8 +1030,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, 0; if( bVert || bVertL2R ) { - bVertic = bVert ? true : false; - bVerticalL2R = bVertL2R ? true : false; + bVertic = bVert; + bVerticalL2R = bVertL2R; _bMirror = false; switch ( _eHoriRelOrient ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 084f0cbcee62..68606d8d6594 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -195,7 +195,7 @@ public: void LockLines( bool bLock ); //Limit lines to 100 - bool isFull() const { return aLineRects.size()>100 ? true : false; } + bool isFull() const { return aLineRects.size()>100; } }; class SwSubsRects : public SwLineRects @@ -3286,7 +3286,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c pPrintData, pPage->Frm(), &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false), + pPage->IsRightToLeft(), &aSwRedirector ); pLines->PaintLines( pSh->GetOut() ); pLines->LockLines( false ); @@ -3333,7 +3333,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c pPrintData, pPage->Frm(), &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false), + pPage->IsRightToLeft(), &aSwRedirector ); } @@ -4110,7 +4110,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const bool bPaintCompleteBack( !pNoTxt ); // paint complete background for transparent graphic and contour, // if own background color exists. - const bool bIsGraphicTransparent = pNoTxt ? pNoTxt->IsTransparent() : false; + const bool bIsGraphicTransparent = pNoTxt && pNoTxt->IsTransparent(); if ( !bPaintCompleteBack && ( bIsGraphicTransparent|| bContour ) ) { @@ -5357,7 +5357,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage, return; } - const bool bLine = rAttrs.IsLine() ? true : false; + const bool bLine = rAttrs.IsLine(); const bool bShadow = rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE; // - flag to control, @@ -7059,7 +7059,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage, // top and bottom (vertical layout) lines painted. // NOTE2: this does not hold for the new table model!!! We paint the top border // of each non-covered table cell. - const bool bVert = IsVertical() ? true : false; + const bool bVert = IsVertical(); if ( bFlys ) { // OD 14.11.2002 #104822# - add control for drawing left and right lines @@ -7304,11 +7304,11 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false), + pPage->IsRightToLeft(), &aSwRedirector ); pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false), + pPage->IsRightToLeft(), &aSwRedirector ); } @@ -7573,7 +7573,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) SwViewObjectContactRedirector aSwRedirector( *pSh ); // <-- pImp->PaintLayer( pIDDMA->GetHellId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false), + pFlyPage->IsRightToLeft(), &aSwRedirector ); pLines->PaintLines( &aDev ); if ( pFly->IsFlyInCntFrm() ) @@ -7581,7 +7581,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) pLines->PaintLines( &aDev ); // OD 30.08.2002 #102450# - add 3rd parameter pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false), + pFlyPage->IsRightToLeft(), &aSwRedirector ); pLines->PaintLines( &aDev ); DELETEZ( pLines ); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 1e31b45dcb45..a7b786d5e8ef 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -81,7 +81,7 @@ namespace { const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; if ( pFly && bBackgroundMatches && - ( ( pCMS ? pCMS->bSetInReadOnly : false ) || + ( ( pCMS && pCMS->bSetInReadOnly ) || !pFly->IsProtected() ) && pFly->GetCrsrOfst( pPos, aPoint, pCMS ) ) { diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 1607856404de..db10a840b819 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -145,7 +145,7 @@ void SwTableBox::setRowSpan( long nNewRowSpan ) bool SwTableBox::getDummyFlag() const { - return pImpl ? pImpl->getDummyFlag() : false; + return pImpl && pImpl->getDummyFlag(); } void SwTableBox::setDummyFlag( bool bDummy ) diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 9c23db71c0b0..ac3afd1a28eb 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -439,7 +439,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) { const OUString& rTxt = rInf.GetTxt(); sal_Int32 nIdx = rInf.GetIdx(); - bAllowBehind = nIdx < rTxt.getLength() ? rCC.isLetterNumeric(rTxt, nIdx) : false; + bAllowBehind = nIdx < rTxt.getLength() && rCC.isLetterNumeric(rTxt, nIdx); } const SwLinePortion* pLast = rInf.GetLast(); diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx index 85429dc13fcd..5becdc38ae4e 100644 --- a/sw/source/core/text/pormulti.hxx +++ b/sw/source/core/text/pormulti.hxx @@ -248,7 +248,7 @@ public: inline bool SwMultiPortion::HasBrackets() const { - return IsDouble() ? 0 != ((SwDoubleLinePortion*)this)->GetBrackets() : false; + return IsDouble() && 0 != ((SwDoubleLinePortion*)this)->GetBrackets(); } #endif diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index f0bb2d00d4a9..8b89a2ef9325 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -92,7 +92,7 @@ void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) // weiterleiten an das TextAttribut bool SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const { - return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : false; + return pTxtAttr && pTxtAttr->GetInfo( rInfo ); } bool SwFmtCharFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const { @@ -693,7 +693,7 @@ bool Meta::IsInClipboard() const { const SwTxtNode * const pTxtNode( GetTxtNode() ); // no text node: in UNDO OSL_ENSURE(pTxtNode, "IsInClipboard: no text node?"); - return (pTxtNode) ? pTxtNode->IsInClipboard() : false; + return pTxtNode && pTxtNode->IsInClipboard(); } bool Meta::IsInUndo() const diff --git a/sw/source/core/uibase/app/docstyle.cxx b/sw/source/core/uibase/app/docstyle.cxx index 55db367c9ff6..500bc5954cfa 100644 --- a/sw/source/core/uibase/app/docstyle.cxx +++ b/sw/source/core/uibase/app/docstyle.cxx @@ -1972,7 +1972,7 @@ bool SwDocStyleSheet::IsUsed() const case SFX_STYLE_FAMILY_PAGE : pMod = pDesc; break; case SFX_STYLE_FAMILY_PSEUDO: - return pNumRule ? rDoc.IsUsed( *pNumRule ) : false; + return pNumRule && rDoc.IsUsed( *pNumRule ); default: OSL_ENSURE(!this, "unknown style family"); diff --git a/sw/source/core/uibase/docvw/AnnotationWin.cxx b/sw/source/core/uibase/docvw/AnnotationWin.cxx index 4d8215efd400..9ef1e482bae0 100644 --- a/sw/source/core/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/core/uibase/docvw/AnnotationWin.cxx @@ -78,7 +78,7 @@ void SwAnnotationWin::SetPostItText() //If the cursor was visible, then make it visible again after //changing text, e.g. fdo#33599 Cursor *pCursor = GetOutlinerView()->GetEditView().GetCursor(); - bool bCursorVisible = pCursor ? pCursor->IsVisible() : false; + bool bCursorVisible = pCursor && pCursor->IsVisible(); //If the new text is the same as the old text, keep the same insertion //point .e.g. fdo#33599 @@ -295,7 +295,7 @@ bool SwAnnotationWin::IsProtected() { return SwSidebarWin::IsProtected() || GetLayoutStatus() == SwPostItHelper::DELETED || - ( mpFmtFld ? mpFmtFld->IsProtect() : false ); + ( mpFmtFld && mpFmtFld->IsProtect() ); } OUString SwAnnotationWin::GetAuthor() diff --git a/sw/source/core/uibase/docvw/SidebarWin.cxx b/sw/source/core/uibase/docvw/SidebarWin.cxx index 30905a0d79d5..1a7b6e67d5d2 100644 --- a/sw/source/core/uibase/docvw/SidebarWin.cxx +++ b/sw/source/core/uibase/docvw/SidebarWin.cxx @@ -693,7 +693,7 @@ void SwSidebarWin::SetPosAndSize() DocView(), mColorAnchor, aAnnotationTextRanges, - mpAnchor != NULL ? mpAnchor->getLineSolid() : false ); + mpAnchor && mpAnchor->getLineSolid() ); } } else diff --git a/sw/source/core/uibase/docvw/edtwin.cxx b/sw/source/core/uibase/docvw/edtwin.cxx index f391ca1009b8..1c37d91c7f03 100644 --- a/sw/source/core/uibase/docvw/edtwin.cxx +++ b/sw/source/core/uibase/docvw/edtwin.cxx @@ -1432,7 +1432,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) // pressing this inside a note will switch to next/previous note if ((rKeyCode.IsMod1() && rKeyCode.IsMod2()) && ((rKeyCode.GetCode() == KEY_PAGEUP) || (rKeyCode.GetCode() == KEY_PAGEDOWN))) { - const bool bNext = rKeyCode.GetCode()==KEY_PAGEDOWN ? true : false; + const bool bNext = rKeyCode.GetCode()==KEY_PAGEDOWN; const SwFieldType* pFldType = rSh.GetFldType( 0, RES_POSTITFLD ); rSh.MoveFldType( pFldType, bNext ); return; diff --git a/sw/source/core/uibase/fldui/fldmgr.cxx b/sw/source/core/uibase/fldui/fldmgr.cxx index eda301efb268..f69a1c5cb068 100644 --- a/sw/source/core/uibase/fldui/fldmgr.cxx +++ b/sw/source/core/uibase/fldui/fldmgr.cxx @@ -780,11 +780,11 @@ bool SwFldMgr::GoNextPrev( bool bNext, SwFieldType* pTyp ) if (pTyp && pTyp->Which() == RES_DBFLD) { // for fieldcommand-edit (hop to all DB fields) - return pSh->MoveFldType( 0, (bNext ? true : false), RES_DBFLD ); + return pSh->MoveFldType( 0, bNext, RES_DBFLD ); } return (pTyp && pSh) - ? pSh->MoveFldType( pTyp, (bNext ? true : false) ) + ? pSh->MoveFldType( pTyp, bNext ) : sal_False; } diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index a81fa6f311f1..b229aa32687d 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -356,7 +356,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) SwCalc aCalc( rDoc ); rDoc.FldsToCalc(aCalc, pInsertedSectNd->GetIndex(), USHRT_MAX); bool bRecalcCondHidden = - aCalc.Calculate( aInsertedSect.GetCondition() ).GetBool() ? true : false; + aCalc.Calculate( aInsertedSect.GetCondition() ).GetBool(); aInsertedSect.SetCondHidden( bRecalcCondHidden ); } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 0687eae3b518..bdf91c63ad86 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -63,9 +63,7 @@ public: , m_rThis(rThis) , m_bIsEndnote(bIsEndnote) , m_EventListeners(m_Mutex) -// #i111177#: unxsols4 (Sun C++ 5.9 SunOS_sparc) generates wrong code for this -// , m_bIsDescriptor(0 == pFootnote) - , m_bIsDescriptor((0 == pFootnote) ? true : false) + , m_bIsDescriptor(0 == pFootnote) , m_pFmtFtn(pFootnote) { } @@ -322,8 +320,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) 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_DEFAULT; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index cc634733aa48..6bda22242f44 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -340,8 +340,7 @@ public: , m_rPropSet( *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Index(eType))) , m_eTOXType(eType) - // #i111177# unxsols4 (Sun C++ 5.9 SunOS_sparc) may generate wrong code - , m_bIsDescriptor((0 == pBaseSection) ? true : false) + , m_bIsDescriptor(0 == pBaseSection) , m_pDoc(&rDoc) , m_pProps((m_bIsDescriptor) ? new SwDocIndexDescriptorProperties_Impl(rDoc.GetTOXType(eType, 0)) @@ -1572,9 +1571,7 @@ public: *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Mark(eType))) , m_eTOXType(eType) , m_EventListeners(m_Mutex) -// #i112513#: unxsols4 (Sun C++ 5.9 SunOS_sparc) generates wrong code for this -// , m_bIsDescriptor(0 == pMark) - , m_bIsDescriptor((0 == pMark) ? true : false) + , m_bIsDescriptor(0 == pMark) , m_TypeDepend(this, pType) , m_pTOXMark(pMark) , m_pDoc(pDoc) @@ -1964,8 +1961,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark( rMark.SetAlternativeText( OUString(' ') ); } - const bool bForceExpandHints( (!bMark && pTextCursor) - ? pTextCursor->IsAtEndOfMeta() : false ); + const bool bForceExpandHints( !bMark && pTextCursor && pTextCursor->IsAtEndOfMeta() ); const SetAttrMode nInsertFlags = (bForceExpandHints) ? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND | nsSetAttrMode::SETATTR_DONTEXPAND) diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index e5f9207d49ea..da5eed08c2dd 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -117,8 +117,7 @@ public: , m_rThis(rThis) , m_EventListeners(m_Mutex) , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)) - // #i111177# unxsols4 (Sun C++ 5.9 SunOS_sparc) may generate wrong code - , m_bIsDescriptor((0 == pTxtNode) ? true : false) + , m_bIsDescriptor(0 == pTxtNode) , m_nSelectionStartPos(nSelStart) , m_nSelectionEndPos(nSelEnd) , m_xParentText(xParent) diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index bc6cf31c13bd..c6a7bc482481 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -599,8 +599,7 @@ static void lcl_ExportBookmark( new SwXTextPortion(pUnoCrsr, xParent, PORTION_BOOKMARK_START); rPortions.push_back(pPortion); pPortion->SetBookmark(pPtr->xBookmark); - pPortion->SetCollapsed( (BKM_TYPE_START_END == pPtr->nBkmType) - ? true : false); + pPortion->SetCollapsed( BKM_TYPE_START_END == pPtr->nBkmType ); } if (BKM_TYPE_END == pPtr->nBkmType) 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) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 7da430f72f89..f2eb49adb3d5 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -124,8 +124,7 @@ public: , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_SECTION)) , m_EventListeners(m_Mutex) , m_bIndexHeader(bIndexHeader) - // #i111177# unxsols4 (Sun C++ 5.9 SunOS_sparc) may generate wrong code - , m_bIsDescriptor((0 == pFmt) ? true : false) + , m_bIsDescriptor(0 == pFmt) , m_pProps((pFmt) ? 0 : new SwTextSectionProperties_Impl()) { } diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index dd84c4afff7e..fe0efbff88fe 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -917,7 +917,7 @@ struct PreviewPosInsidePagePred if ( _pPreviewPage->bVisible ) { Rectangle aPreviewPageRect( _pPreviewPage->aPreviewWinPos, _pPreviewPage->aPageSize ); - return aPreviewPageRect.IsInside( mnPreviewPos ) ? true : false; + return aPreviewPageRect.IsInside( mnPreviewPos ); } else return false; diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 2f2d6f94d94d..fe138639dfbf 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -772,7 +772,7 @@ namespace sw if (pOne->aStamp == pTwo->aStamp) return (pOne->eType == nsRedlineType_t::REDLINE_INSERT && pTwo->eType != nsRedlineType_t::REDLINE_INSERT); else - return (pOne->aStamp < pTwo->aStamp) ? true : false; + return (pOne->aStamp < pTwo->aStamp); } RedlineStack::~RedlineStack() diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index f8bdeab9991e..fd48f9bc146f 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -725,7 +725,7 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rGrfNd, else { Graphic& rGrf = const_cast<Graphic&>(rGrfNd.GetGrf()); - bool bSwapped = rGrf.IsSwapOut() ? true : false; + bool bSwapped = rGrf.IsSwapOut(); // immer ueber den Node einswappen! const_cast<SwGrfNode&>(rGrfNd).SwapIn(); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 4f1b98ca1cd2..da3cfbb0bcdb 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1132,7 +1132,7 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, InsertAttrsAsDrawingAttrs(nStartCp, nEndCp, eType); } - bool bVertical = pTextObj->IsVerticalWriting() ? true : false; + bool bVertical = pTextObj->IsVerticalWriting(); EditTextObject* pTemporaryText = mpDrawEditEngine->CreateTextObject(); OutlinerParaObject* pOp = new OutlinerParaObject(*pTemporaryText); pOp->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 829419bcfa61..03dff3824e65 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2317,7 +2317,7 @@ void SwWW8ImplReader::Read_HdFtText(long nStart, long nLen, SwFrmFmt* pHdFtFmt) bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const { // Each CP of Plcfhdd MUST be less than FibRgLw97.ccpHdd - return (nHeaderCP < pWwFib->ccpHdr) ? true : false; + return (nHeaderCP < pWwFib->ccpHdr); } bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIhdt, @@ -4378,7 +4378,7 @@ void wwSectionManager::InsertSegments() bool bThisAndPreviousAreCompatible = ((aIter->GetPageWidth() == aPrev->GetPageWidth()) && (aIter->GetPageHeight() == aPrev->GetPageHeight()) && (aIter->IsLandScape() == aPrev->IsLandScape())); - bool bInsertSection = (aIter != aStart) ? (aIter->IsContinuous() && bThisAndPreviousAreCompatible): false; + bool bInsertSection = (aIter != aStart) && aIter->IsContinuous() && bThisAndPreviousAreCompatible; bool bInsertPageDesc = !bInsertSection; bool bProtected = SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disables this... if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected()) @@ -6174,7 +6174,7 @@ bool WW8Reader::ReadGlossaries(SwTextBlocks& rBlocks, bool bSaveRelFiles) const WW8Glossary aGloss( refStrm, 8, pStg ); bRet = aGloss.Load( rBlocks, bSaveRelFiles ? true : false); } - return bRet ? true : false; + return bRet; } bool SwMSDffManager::GetOLEStorageName(long nOLEId, OUString& rStorageName, diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 0fc5859bec1d..02168178f5fc 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1666,7 +1666,7 @@ private: bool SetLowerSpacing(SwPaM &rMyPam, int nSpace); bool IsInlineEscherHack() const - {return !maFieldStack.empty() ? maFieldStack.back().mnFieldId == 95 : false; }; + { return !maFieldStack.empty() && maFieldStack.back().mnFieldId == 95; }; void StoreMacroCmds(); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 8554ff0d73ad..bf4b67ae5561 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2151,8 +2151,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr) aVText += aReadParam.GetResult(); if (bNewVText) { - bBracket = (aVText[0] == '[') - ? true : false; + bBracket = (aVText[0] == '['); bNewVText = false; } else if( aVText.endsWith("]") ) |