summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/core/stlpool.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-stylesheet.cxx2
-rw-r--r--sd/source/filter/ppt/pptin.cxx2
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx2
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx4
6 files changed, 7 insertions, 7 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 6283edca1486..c627970fd4e2 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1118,7 +1118,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
// Subtitle template
SvxNumBulletItem const*const pItem(
rSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET));
- SvxNumRule *const pDefaultRule = (pItem) ? pItem->GetNumRule() : nullptr;
+ SvxNumRule *const pDefaultRule = pItem ? pItem->GetNumRule() : nullptr;
DBG_ASSERT( pDefaultRule, "Where is my default template? [CL]" );
if(pDefaultRule)
diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx
index a17ee08d6a89..693607413215 100644
--- a/sd/source/filter/eppt/pptx-stylesheet.cxx
+++ b/sd/source/filter/eppt/pptx-stylesheet.cxx
@@ -168,7 +168,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
{
nBulletChar = 0x2022;
nBulletOfs = 0;
- nTextOfs = ( bHasBullet ) ? 0xd8 : 0;
+ nTextOfs = bHasBullet ? 0xd8 : 0;
}
break;
case 1 :
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 2c189d79516c..60eb678303b0 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -585,7 +585,7 @@ bool ImplSdPPTImport::Import()
bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bNotesMaster;
bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bStarDrawFiller;
- PageKind ePgKind = ( bNotesMaster ) ? PageKind::Notes : PageKind::Standard;
+ PageKind ePgKind = bNotesMaster ? PageKind::Notes : PageKind::Standard;
bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bHandoutMaster;
if ( bHandout )
ePgKind = PageKind::Handout;
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 8392c0e7f5d1..ea8b5dc326c8 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -681,7 +681,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
if(rKEvt.GetKeyCode().IsMod2())
{
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
- Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
+ Size aLogicSizeOnePixel = pOut ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
nX *= aLogicSizeOnePixel.Width();
nY *= aLogicSizeOnePixel.Height();
}
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 68d2f165c147..e7e5c1a2cba3 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -396,7 +396,7 @@ bool AnnotationTag::OnMove( const KeyEvent& rKEvt )
if(rKEvt.GetKeyCode().IsMod2())
{
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
- Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
+ Size aLogicSizeOnePixel = pOut ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
nX *= aLogicSizeOnePixel.Width();
nY *= aLogicSizeOnePixel.Height();
}
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 3dbd3503b13a..99dca2efed88 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -455,7 +455,7 @@ OUString ViewShellBase::GetSelectionText(bool bCompleteWords)
std::shared_ptr<ViewShell> const pMainShell(GetMainViewShell());
DrawViewShell *const pDrawViewShell(
dynamic_cast<DrawViewShell*>(pMainShell.get()));
- return (pDrawViewShell)
+ return pDrawViewShell
? pDrawViewShell->GetSelectionText(bCompleteWords)
: SfxViewShell::GetSelectionText(bCompleteWords);
}
@@ -465,7 +465,7 @@ bool ViewShellBase::HasSelection(bool bText) const
std::shared_ptr<ViewShell> const pMainShell(GetMainViewShell());
DrawViewShell *const pDrawViewShell(
dynamic_cast<DrawViewShell*>(pMainShell.get()));
- return (pDrawViewShell)
+ return pDrawViewShell
? pDrawViewShell->HasSelection(bText)
: SfxViewShell::HasSelection(bText);
}