diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-11-22 14:12:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-11-22 19:16:52 +0100 |
commit | 72ef2b5d9802c424dbb0810e0a72fae50d92b678 (patch) | |
tree | c043fd16189d55fcc549589cecf145bb522089e6 /svx | |
parent | b140f92531396c1087b997852d7ece18429b79d1 (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 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaymanager.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaymanagerbuffered.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanel.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdmark.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdpoev.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdviter.cxx | 6 | ||||
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 2 |
14 files changed, 24 insertions, 24 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 34f71b8b7c33..03670dbbebb8 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1234,7 +1234,7 @@ void LineEndLB::Fill( const XLineEndListRef &pList, bool bStart ) pVD->DrawBitmap( Point(), aBitmap ); InsertEntry( pEntry->GetName(), Image(pVD->GetBitmap( - (bStart) ? Point() : Point(aBmpSize.Width() / 2, 0), + bStart ? Point() : Point(aBmpSize.Width() / 2, 0), Size(aBmpSize.Width() / 2, aBmpSize.Height())))); } else diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index b99594b3ee33..036b6472a19b 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1874,7 +1874,7 @@ void DbGridControl::RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, bool // positioned on the first sentence long nDelta = nNewTopRow - GetTopRow(); // limit for relative positioning - long nLimit = (nCacheSize) ? nCacheSize / 2 : 0; + long nLimit = nCacheSize ? nCacheSize / 2 : 0; // more lines on screen than in cache if (nLimit < nLinesOnScreen) diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 4ffd872cd7f0..083e7692f7cb 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -251,7 +251,7 @@ namespace sdr aRegionBoundRect.Left(), aRegionBoundRect.Top(), aRegionBoundRect.Right(), aRegionBoundRect.Bottom()); - OutputDevice& rTarget = (pPreRenderDevice) ? *pPreRenderDevice : getOutputDevice(); + OutputDevice& rTarget = pPreRenderDevice ? *pPreRenderDevice : getOutputDevice(); ImpDrawMembers(aRegionRange, rTarget); } } diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index a718970689f4..a2bc553580c7 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -153,7 +153,7 @@ namespace sdr void OverlayManagerBuffered::ImpSaveBackground(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice) { // prepare source - OutputDevice& rSource = (pPreRenderDevice) ? *pPreRenderDevice : getOutputDevice(); + OutputDevice& rSource = pPreRenderDevice ? *pPreRenderDevice : getOutputDevice(); // Ensure buffer is valid ImpPrepareBufferDevice(); diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index 7d6526bcaf0f..992e240540dd 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -124,7 +124,7 @@ void AreaPropertyPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& rColorItem) { GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_COLOR, - SfxCallMode::RECORD, (pStyleItem) + SfxCallMode::RECORD, pStyleItem ? std::initializer_list<SfxPoolItem const*>{ &rColorItem, pStyleItem } : std::initializer_list<SfxPoolItem const*>{ &rColorItem }); } @@ -133,7 +133,7 @@ void AreaPropertyPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem const XFillGradientItem& rGradientItem) { GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_GRADIENT, - SfxCallMode::RECORD, (pStyleItem) + SfxCallMode::RECORD, pStyleItem ? std::initializer_list<SfxPoolItem const*>{ &rGradientItem, pStyleItem } : std::initializer_list<SfxPoolItem const*>{ &rGradientItem }); } @@ -142,7 +142,7 @@ void AreaPropertyPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& rHatchItem) { GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_HATCH, - SfxCallMode::RECORD, (pStyleItem) + SfxCallMode::RECORD, pStyleItem ? std::initializer_list<SfxPoolItem const*>{ &rHatchItem, pStyleItem } : std::initializer_list<SfxPoolItem const*>{ &rHatchItem }); } @@ -151,7 +151,7 @@ void AreaPropertyPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& rBitmapItem) { GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_BITMAP, - SfxCallMode::RECORD, (pStyleItem) + SfxCallMode::RECORD, pStyleItem ? std::initializer_list<SfxPoolItem const*>{ &rBitmapItem, pStyleItem } : std::initializer_list<SfxPoolItem const*>{ &rBitmapItem }); } diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 1bde1afca7f0..e7447041e23b 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -964,7 +964,7 @@ bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue() != drawi void SdrTextFitToSizeTypeItem::SetBoolValue(bool bVal) { - SetValue((bVal) ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE); + SetValue(bVal ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE); } bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index be0d4d140eec..c373caac480f 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -212,7 +212,7 @@ void SdrEditView::DeleteLayer(const OUString& rName) for(sal_uInt16 nPgNum(0); nPgNum < nPgCount; nPgNum++) { // over all pages - SdrPage* pPage = (bMaPg) ? mpModel->GetMasterPage(nPgNum) : mpModel->GetPage(nPgNum); + SdrPage* pPage = bMaPg ? mpModel->GetMasterPage(nPgNum) : mpModel->GetPage(nPgNum); const size_t nObjCount(pPage->GetObjCount()); // make sure OrdNums are correct diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 55e8c175fb41..faf855bc96a4 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -123,16 +123,16 @@ static bool ImpSdrMarkListSorter(SdrMark* const& lhs, SdrMark* const& rhs) { SdrObject* pObj1 = lhs->GetMarkedSdrObj(); SdrObject* pObj2 = rhs->GetMarkedSdrObj(); - SdrObjList* pOL1 = (pObj1) ? pObj1->GetObjList() : nullptr; - SdrObjList* pOL2 = (pObj2) ? pObj2->GetObjList() : nullptr; + SdrObjList* pOL1 = pObj1 ? pObj1->GetObjList() : nullptr; + SdrObjList* pOL2 = pObj2 ? pObj2->GetObjList() : nullptr; if (pOL1 == pOL2) { // AF: Note that I reverted a change from sal_uInt32 to sal_uLong (made // for 64bit compliance, #i78198#) because internally in SdrObject // both nOrdNum and mnNavigationPosition are stored as sal_uInt32. - sal_uInt32 nObjOrd1((pObj1) ? pObj1->GetNavigationPosition() : 0); - sal_uInt32 nObjOrd2((pObj2) ? pObj2->GetNavigationPosition() : 0); + sal_uInt32 nObjOrd1(pObj1 ? pObj1->GetNavigationPosition() : 0); + sal_uInt32 nObjOrd2(pObj2 ? pObj2->GetNavigationPosition() : 0); return nObjOrd1 < nObjOrd2; } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 3d71630005d0..23e5cfdf8822 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1552,7 +1552,7 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev) size_t nSearchBeg = 0; E3dScene* pScene = nullptr; - SdrObject* pObjHit = (bPrev) ? pBtmObjHit : pTopObjHit; + SdrObject* pObjHit = bPrev ? pBtmObjHit : pTopObjHit; bool bRemap = dynamic_cast< const E3dCompoundObject* >(pObjHit) != nullptr && static_cast<E3dCompoundObject*>(pObjHit)->IsAOrdNumRemapCandidate(pScene); diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index f121952d8992..a03b6f53963c 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1176,7 +1176,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage) mbPageBorderOnlyLeftRight(false) { aPrefVisiLayers.SetAll(); - eListKind = (bMasterPage) ? SdrObjListKind::MasterPage : SdrObjListKind::DrawPage; + eListKind = bMasterPage ? SdrObjListKind::MasterPage : SdrObjListKind::DrawPage; mpSdrPageProperties.reset(new SdrPageProperties(*this)); } diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index 0ea5fc21ee64..f6b9bd6d7845 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -164,7 +164,7 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot if(!b1stSegm && !bSegmFuz) { - eMarkedSegmentsKind = (bCurve) ? SdrPathSegmentKind::Curve : SdrPathSegmentKind::Line; + eMarkedSegmentsKind = bCurve ? SdrPathSegmentKind::Curve : SdrPathSegmentKind::Line; } } diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx index 3c0ab9badb08..6ef07497b40b 100644 --- a/svx/source/svdraw/svdviter.cxx +++ b/svx/source/svdraw/svdviter.cxx @@ -38,7 +38,7 @@ void SdrViewIter::ImpInitVars() SdrViewIter::SdrViewIter(const SdrPage* pPage) { mpPage = pPage; - mpModel = (pPage) ? pPage->GetModel() : nullptr; + mpModel = pPage ? pPage->GetModel() : nullptr; mpObject = nullptr; mbNoMasterPage = false; ImpInitVars(); @@ -48,8 +48,8 @@ SdrViewIter::SdrViewIter(const SdrPage* pPage) SdrViewIter::SdrViewIter(const SdrObject* pObject) { mpObject = pObject; - mpModel = (pObject) ? pObject->GetModel() : nullptr; - mpPage = (pObject) ? pObject->GetPage() : nullptr; + mpModel = pObject ? pObject->GetModel() : nullptr; + mpPage = pObject ? pObject->GetPage() : nullptr; mbNoMasterPage = false; if(!mpModel || !mpPage) diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index f763b7869825..661ce1700f76 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -787,7 +787,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void) // #i122676# Change FillStyle and Gradinet in one call SfxViewFrame::Current()->GetDispatcher()->ExecuteList( SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, - (bFillStyleChange) + bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillGradientItem, &aXFillStyleItem } : std::initializer_list<SfxPoolItem const*>{ &aXFillGradientItem }); } @@ -820,7 +820,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void) // #i122676# Change FillStyle and Hatch in one call SfxViewFrame::Current()->GetDispatcher()->ExecuteList( SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, - (bFillStyleChange) + bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillHatchItem, &aXFillStyleItem } : std::initializer_list<SfxPoolItem const*>{ &aXFillHatchItem }); } @@ -853,7 +853,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void) // #i122676# Change FillStyle and Bitmap in one call SfxViewFrame::Current()->GetDispatcher()->ExecuteList( SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, - (bFillStyleChange) + bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillBitmapItem, &aXFillStyleItem } : std::initializer_list<SfxPoolItem const*>{ &aXFillBitmapItem }); } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 3d1328a44a2e..f5eb6a14c375 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2813,7 +2813,7 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpl if(pPageObj) { SdrPage* pPage = pPageObj->GetReferencedPage(); - sal_Int32 nPageNumber = (pPage) ? pPage->GetPageNum() : 0L; + sal_Int32 nPageNumber = pPage ? pPage->GetPageNum() : 0L; nPageNumber++; nPageNumber >>= 1; rValue <<= nPageNumber; |