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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshtxt.cxx | 4 |
6 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 4cf1740ad3cc..c39428e688f2 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2386,7 +2386,7 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj ) bool EnhancedCustomShape2d::IsPostRotate() const { - return pCustomShapeObj->ISA( SdrObjCustomShape ) ? ((SdrObjCustomShape*)pCustomShapeObj)->IsPostRotate() : false; + return pCustomShapeObj->ISA( SdrObjCustomShape ) && ((SdrObjCustomShape*)pCustomShapeObj)->IsPostRotate(); } SdrObject* EnhancedCustomShape2d::CreateLineGeometry() diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index eacce2d8f7fc..f3efcc7a56d1 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -99,7 +99,7 @@ namespace { bool GetCheckBoxValue(const CheckBox *pBox) { - return pBox->IsEnabled() ? pBox->IsChecked() : false; + return pBox->IsEnabled() && pBox->IsChecked(); } } diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index c442ff4273e4..5b2b45f0c65e 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -74,8 +74,8 @@ namespace drawinglayer const attribute::SdrLineStartEndAttribute aLineStartEnd( bLeftActive ? rLineStartEnd.getStartPolyPolygon() : aEmpty, bRightActive ? rLineStartEnd.getEndPolyPolygon() : aEmpty, bLeftActive ? rLineStartEnd.getStartWidth() : 0.0, bRightActive ? rLineStartEnd.getEndWidth() : 0.0, - bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false, - bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false); + bLeftActive && rLineStartEnd.isStartActive(), bRightActive && rLineStartEnd.isEndActive(), + bLeftActive && rLineStartEnd.isStartCentered(), bRightActive && rLineStartEnd.isEndCentered()); return createPolygonLinePrimitive( aPolygon, diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index e0007cb0dec1..04ff43de6f86 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -634,7 +634,7 @@ namespace return false; bool bRet(false); - bool bMaster(rList.GetPage() ? rList.GetPage()->IsMasterPage() : false); + bool bMaster(rList.GetPage() && rList.GetPage()->IsMasterPage()); for(sal_uIntPtr no(rList.GetObjCount()); !bRet && no > 0; ) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index a2441761d1f3..b227d89ef799 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1910,7 +1910,7 @@ SdrObjUserData* SdrObject::ImpGetMacroUserData() const bool SdrObject::HasMacro() const { SdrObjUserData* pData=ImpGetMacroUserData(); - return pData!=NULL ? pData->HasMacro(this) : false; + return pData && pData->HasMacro(this); } SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 0e385200aafc..d62d58d7c113 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -115,7 +115,7 @@ private: bool IsEditMode() const { SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject ); - return mbShapeIsEditMode && pTextObj && pTextObj->IsTextEditActive() ? true : false; + return mbShapeIsEditMode && pTextObj && pTextObj->IsTextEditActive(); } void dispose(); @@ -661,7 +661,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() } else { - bool bVertical = pOutlinerParaObject ? pOutlinerParaObject->IsVertical() : false; + bool bVertical = pOutlinerParaObject && pOutlinerParaObject->IsVertical(); // set objects style sheet on empty outliner SfxStyleSheetPool* pPool = (SfxStyleSheetPool*)mpObject->GetModel()->GetStyleSheetPool(); |