summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-22 14:12:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-22 19:16:52 +0100
commit72ef2b5d9802c424dbb0810e0a72fae50d92b678 (patch)
treec043fd16189d55fcc549589cecf145bb522089e6 /sc
parentb140f92531396c1087b997852d7ece18429b79d1 (diff)
Make loplugin:unnecessaryparen warn about (x) ? ... : ... after all
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table2.cxx2
-rw-r--r--sc/source/core/tool/interpr5.cxx6
-rw-r--r--sc/source/filter/excel/excrecds.cxx2
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx2
6 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 56be6df03201..cd09f5d0247f 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1638,7 +1638,7 @@ CommentCaptionState ScTable::GetAllNoteCaptionsState(const ScRange& rRange, std:
}
}
}
- return (bIsFirstNoteShownState) ? CommentCaptionState::ALLSHOWN : CommentCaptionState::ALLHIDDEN;
+ return bIsFirstNoteShownState ? CommentCaptionState::ALLSHOWN : CommentCaptionState::ALLHIDDEN;
}
void ScTable::GetUnprotectedCells( ScRangeList& rRangeList ) const
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 909965676139..29d9d845b8f6 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -2490,7 +2490,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
double fSSreg = fSlope * fSlope * fSumX2;
pResMat->PutDouble(fSSreg, 0, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-2 : N-1 );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-2 : N-1 );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
double fSSresid = lcl_GetSSresid(pMatX,pMatY,fSlope,N);
@@ -2621,7 +2621,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
pResMat->PutDouble(fSSreg, 0, 4);
pResMat->PutDouble(fSSresid, 1, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-K-1 : N-K );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
@@ -2778,7 +2778,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
pResMat->PutDouble(fSSreg, 0, 4);
pResMat->PutDouble(fSSresid, 1, 4);
- double fDegreesFreedom =static_cast<double>( (bConstant) ? N-K-1 : N-K );
+ double fDegreesFreedom =static_cast<double>( bConstant ? N-K-1 : N-K );
pResMat->PutDouble(fDegreesFreedom, 1, 3);
if (fDegreesFreedom == 0.0 || fSSresid == 0.0 || fSSreg == 0.0)
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 0461d7e48c66..cc69f4ae3c1e 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -737,7 +737,7 @@ bool XclExpAutofilter::AddEntry( const ScQueryEntry& rEntry )
sal_uInt32 nIndex = 0;
bool bIsNum = !bLen || GetFormatter().IsNumberFormat( sText, nIndex, fVal );
OUString* pText;
- (bIsNum) ? pText = nullptr : pText = &sText;
+ bIsNum ? pText = nullptr : pText = &sText;
// top10 flags
sal_uInt16 nNewFlags = 0x0000;
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 39ea16bf683a..1a6b3f56157b 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1372,7 +1372,7 @@ void ScCheckListMenuWindow::updateMemberParents( const SvTreeListEntry* pLeaf, s
if ( pLeaf )
{
SvTreeListEntry* pMonthEntry = pLeaf->GetParent();
- SvTreeListEntry* pYearEntry = ( pMonthEntry ) ? pMonthEntry->GetParent() : nullptr;
+ SvTreeListEntry* pYearEntry = pMonthEntry ? pMonthEntry->GetParent() : nullptr;
maMembers[nIdx].mpParent = pMonthEntry;
if ( aItr != maYearMonthMap.end() )
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 16767809cc26..79f52c5dd2b6 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -111,7 +111,7 @@ InsertDeleteFlags ScDeleteContentsDlg::GetDelContentsCmdBits() const
ScDeleteContentsDlg::bPreviousAllCheck = aBtnDelAll->IsChecked();
- return ( (ScDeleteContentsDlg::bPreviousAllCheck)
+ return ( ScDeleteContentsDlg::bPreviousAllCheck
? InsertDeleteFlags::ALL
: ScDeleteContentsDlg::nPreviousChecks );
}
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 0845e7627c23..eddd015b646d 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -147,7 +147,7 @@ InsertDeleteFlags ScInsertContentsDlg::GetInsContentsCmdBits() const
if (bUsedShortCut)
return nShortCutInsContentsCmdBits;
- return ( (ScInsertContentsDlg::bPreviousAllCheck)
+ return ( ScInsertContentsDlg::bPreviousAllCheck
? InsertDeleteFlags::ALL
: ScInsertContentsDlg::nPreviousChecks );
}