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/edit | |
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/edit')
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edundo.cxx | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index e958a24b0d50..fbce36232d08 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -374,7 +374,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, aCpyPam.GetPoint()->nNode.Assign( pAutoDoc->GetNodes().GetEndOfContent(), -1 ); pContentNd = aCpyPam.GetContentNode(); aCpyPam.GetPoint()->nContent.Assign( - pContentNd, (pContentNd) ? pContentNd->Len() : 0); + pContentNd, pContentNd ? pContentNd->Len() : 0); SwDontExpandItem aExpItem; aExpItem.SaveDontExpandItems( *aPam.GetPoint() ); diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index c901cbe9f005..4737f411cd8d 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -153,7 +153,7 @@ void SwEditShell::Insert2(SwField const & rField, const bool bForceExpandHints) StartAllAction(); SwFormatField aField( rField ); - const SetAttrMode nInsertFlags = (bForceExpandHints) + const SetAttrMode nInsertFlags = bForceExpandHints ? SetAttrMode::FORCEHINTEXPAND : SetAttrMode::DEFAULT; diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 7c49f728d3d6..98f6288bba39 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -135,7 +135,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, aCpyPam.GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1; pContentNd = aCpyPam.GetContentNode(); aCpyPam.GetPoint()->nContent.Assign( - pContentNd, (pContentNd) ? pContentNd->Len() : 0); + pContentNd, pContentNd ? pContentNd->Len() : 0); aStt = pGDoc->GetNodes().GetEndOfExtras(); pContentNd = pGDoc->GetNodes().GoNext( &aStt ); @@ -159,7 +159,7 @@ bool SwEditShell::CopySelToDoc( SwDoc* pInsDoc ) SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 ); SwContentNode *const pContentNode = aIdx.GetNode().GetContentNode(); SwPosition aPos( aIdx, - SwIndex(pContentNode, (pContentNode) ? pContentNode->Len() : 0)); + SwIndex(pContentNode, pContentNode ? pContentNode->Len() : 0)); bool bRet = false; SET_CURR_SHELL( this ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 0f9662f01f16..0cd05f4e1d0f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -87,7 +87,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) StartAllAction(); { const SwInsertFlags nInsertFlags = - (bForceExpandHints) + bForceExpandHints ? (SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND) : SwInsertFlags::EMPTYEXPAND; diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index 4591c535d6a5..1decb5dc36a3 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -139,7 +139,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) { // fdo#39003 Pop does not touch the rest of the cursor ring KillPams(); // so call this first to get rid of unwanted cursors } - Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack); + Pop(bRestoreCursor ? PopMode::DeleteCurrent : PopMode::DeleteStack); GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld ); GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); @@ -190,7 +190,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) SAL_WARN("sw.core", "SwEditShell::Redo(): exception caught: " << e); } - Pop((bRestoreCursor) ? PopMode::DeleteCurrent : PopMode::DeleteStack); + Pop(bRestoreCursor ? PopMode::DeleteCurrent : PopMode::DeleteStack); GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOld ); GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); |