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/ui | |
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/ui')
-rw-r--r-- | sw/source/ui/fldui/flddinf.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldvar.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/table/tabledlg.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 592a46c5ec89..92024ab1a727 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -81,7 +81,7 @@ SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, const SfxItemSet *con //enable 'active' language selection m_pFormatLB->SetShowLanguageControl(true); - const SfxUnoAnyItem* pItem = (pCoreSet) + const SfxUnoAnyItem* pItem = pCoreSet ? pCoreSet->GetItem<SfxUnoAnyItem>(SID_DOCINFO, false) : nullptr; if ( pItem ) diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 6c77133554bf..46fd6eb88802 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -1183,7 +1183,7 @@ bool SwFieldVarPage::FillItemSet(SfxItemSet* ) case TYP_INPUTFLD: { SwFieldType* pType = GetFieldMgr().GetFieldType(SwFieldIds::User, aName); - nSubType = static_cast< sal_uInt16 >((nSubType & 0xff00) | ((pType) ? INP_USR : INP_VAR)); + nSubType = static_cast< sal_uInt16 >((nSubType & 0xff00) | (pType ? INP_USR : INP_VAR)); break; } diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 64270c3248a2..0b20824c2342 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1355,7 +1355,7 @@ bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) sal_uInt16 nPgNum = static_cast< sal_uInt16 >(m_pPageNoNF->GetValue()); bool const usePageNo(bState && m_pPageNoCB->IsChecked()); boost::optional<sal_uInt16> const oPageNum( - (usePageNo) ? nPgNum : boost::optional<sal_Int16>()); + usePageNo ? nPgNum : boost::optional<sal_Int16>()); if (!pDesc || !pDesc->GetPageDesc() || (pDesc->GetPageDesc()->GetName() != sPage) || (pDesc->GetNumOffset() != oPageNum)) |