diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-06 07:44:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-06 07:45:25 +0200 |
commit | 794f09f195a449e387ebfbd53eb1b693803c95e7 (patch) | |
tree | 4c82e01015ccac094261060021b49757dab12f19 /sc/source | |
parent | 3f569908ac72c20826a45ebed59af9b1e5449207 (diff) |
simplify ternary conditions "xxx ? true : yyy"
Look for code like:
xxx ? true : yyy;
Which can be simplified to:
xxx || yyy
Change-Id: Ib7ca86580bfd0cf04674328a3c0cf3747de4758d
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index e0eb23e3061a..a8011c99c3d2 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -2228,7 +2228,7 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray SCROW nStart = nStartRow; for (SCSIZE i = 0; i < nCount; i++) { - if ((pData[i].nRow >= nStartRow) && ((i==0) ? true : pData[i-1].nRow < nEndRow)) + if ((pData[i].nRow >= nStartRow) && (i == 0 || pData[i-1].nRow < nEndRow)) { // copy (bPutToPool=TRUE) rAttrArray.SetPatternArea( nStart, std::min( (SCROW)pData[i].nRow, (SCROW)nEndRow ), diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 3b5a0b42532f..fe280e31177a 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -251,7 +251,7 @@ bool ScChangeAction::IsDialogParent() const return pPrevContent && pPrevContent->IsVirgin(); } if ( HasDependent() ) - return IsDeleteType() ? true : !IsDeletedIn(); + return IsDeleteType() || !IsDeletedIn(); if ( HasDeleted() ) { if ( IsDeleteType() ) diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 10ed6364db6e..cc45d02fc406 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1228,7 +1228,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos, SfxItemSet aItemSet = pCaption->GetMergedItemSet(); meTVA = pCaption->GetTextVerticalAdjust(); meTHA = pCaption->GetTextHorizontalAdjust(); - mbAutoScale = pCaption->GetFitToSize()?true:false; + mbAutoScale = pCaption->GetFitToSize() ? true : false; mbLocked = pCaption->IsMoveProtect() || pCaption->IsResizeProtect(); // AutoFill style would change if Postit.cxx object creation values are changed diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 7d8f4454bc33..c21ea7d9ee8d 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -4477,7 +4477,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const ScDocument* pDoc = pShell ? pShell->GetDocument() : NULL; if (pDoc) { - bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ) ? true : false; + bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ); } xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( bHasColHeader ) ); } |