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 /sw/source/core/unocore/unosect.cxx | |
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 'sw/source/core/unocore/unosect.cxx')
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 3c79a8315db5..b8c32ae13f78 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -123,7 +123,7 @@ public: , m_EventListeners(m_Mutex) , m_bIndexHeader(bIndexHeader) , m_bIsDescriptor(nullptr == pFormat) - , m_pProps((pFormat) ? nullptr : new SwTextSectionProperties_Impl()) + , m_pProps(pFormat ? nullptr : new SwTextSectionProperties_Impl()) { } @@ -243,7 +243,7 @@ SwXTextSection::getParentSection() SwSectionFormat *const pParentFormat = rSectionFormat.GetParent(); const uno::Reference< text::XTextSection > xRet = - (pParentFormat) ? CreateXTextSection(pParentFormat) : nullptr; + pParentFormat ? CreateXTextSection(pParentFormat) : nullptr; return xRet; } @@ -287,7 +287,7 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) } SwDoc *const pDoc = - (pRange) ? &pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : nullptr); + pRange ? &pRange->GetDoc() : (pCursor ? pCursor->GetDoc() : nullptr); if (!pDoc) { throw lang::IllegalArgumentException(); @@ -562,7 +562,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } std::unique_ptr<SwSectionData> const pSectionData( - (pFormat) ? new SwSectionData(*pFormat->GetSection()) : nullptr); + pFormat ? new SwSectionData(*pFormat->GetSection()) : nullptr); OUString const*const pPropertyNames = rPropertyNames.getConstArray(); uno::Any const*const pValues = rValues.getConstArray(); @@ -950,7 +950,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( uno::Sequence< uno::Any > aRet(rPropertyNames.getLength()); uno::Any* pRet = aRet.getArray(); - SwSection *const pSect = (pFormat) ? pFormat->GetSection() : nullptr; + SwSection *const pSect = pFormat ? pFormat->GetSection() : nullptr; const OUString* pPropertyNames = rPropertyNames.getConstArray(); for (sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength(); @@ -1448,7 +1448,7 @@ SwXTextSection::setPropertyToDefault(const OUString& rPropertyName) } std::unique_ptr<SwSectionData> const pSectionData( - (pFormat) ? new SwSectionData(*pFormat->GetSection()) : nullptr); + pFormat ? new SwSectionData(*pFormat->GetSection()) : nullptr); std::unique_ptr<SfxItemSet> pNewAttrSet; bool bLinkModeChanged = false; @@ -1724,7 +1724,7 @@ uno::Reference<frame::XModel> SwXTextSection::GetModel() if (pSectionFormat) { SwDocShell const*const pShell( pSectionFormat->GetDoc()->GetDocShell() ); - return (pShell) ? pShell->GetModel() : nullptr; + return pShell ? pShell->GetModel() : nullptr; } return nullptr; } |