summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-02 00:59:58 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-02 05:31:10 +0100
commit1f2d3b3f09d16033dae1f99f7739564a5f4c5482 (patch)
tree292145abe33a2bac69d67fdd67cfc7a8527f6024 /sw
parenta9b13f2b7f0d2ab8bcf25a3110a06ababb4573f6 (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: Ia9c496ec93bedb13764969bf21c3f21d84caacef Reviewed-on: https://gerrit.libreoffice.org/64413 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/docnode/section.cxx11
-rw-r--r--sw/source/core/layout/sectfrm.cxx6
-rw-r--r--sw/source/uibase/wrtsh/select.cxx2
3 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 80ae308c4b85..bf052828f906 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -595,10 +595,9 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc()->getIDocumentLinksAdministration().GetLinkManager().GetLinks();
for( auto n = rLnks.size(); n; )
{
- ::sfx2::SvBaseLink* pBLnk = &(*rLnks[ --n ]);
- if( pBLnk && !pBLnk->IsVisible() &&
- dynamic_cast< const SwBaseLink *>( pBLnk ) != nullptr &&
- nullptr != ( pNd = static_cast<SwBaseLink*>(pBLnk)->GetAnchor() ) )
+ sfx2::SvBaseLink& rBLnk = *rLnks[--n];
+ if (!rBLnk.IsVisible() && dynamic_cast<const SwBaseLink*>(&rBLnk) != nullptr
+ && nullptr != (pNd = static_cast<SwBaseLink&>(rBLnk).GetAnchor()))
{
pNd = pNd->StartOfSectionNode(); // If it's a SectionNode
const SwSectionNode* pParent;
@@ -609,7 +608,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
// It's within a normal Section, so show again
if( !pParent )
- pBLnk->SetVisible( true );
+ rBLnk.SetVisible(true);
}
}
}
@@ -1134,7 +1133,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
SwBaseLink* pBLink;
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
- if( pLnk && pLnk != &rUpdLnk &&
+ if( pLnk != &rUpdLnk &&
OBJECT_CLIENT_FILE == pLnk->GetObjType() &&
dynamic_cast< const SwBaseLink *>( pLnk ) != nullptr &&
( pBLink = static_cast<SwBaseLink*>(pLnk) )->IsInRange( rSectNd.GetIndex(),
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 093d84d04f4e..0596f5076418 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -613,8 +613,8 @@ static SwContentFrame* lcl_GetNextContentFrame( const SwLayoutFrame* pLay, bool
}
bGoingUp = !( bGoingFwdOrBwd || bGoingDown );
-
- if( !bFwd && bGoingDown && p )
+ assert(p);
+ if (!bFwd && bGoingDown)
while ( p->GetNext() )
p = p->GetNext();
@@ -2184,7 +2184,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
if( nGrow <= 0 )
{
nGrow = 0;
- if( nDist && !bTst )
+ if (!bTst)
{
if( bInCalcContent )
InvalidateSize_();
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 3f4c2540f006..6459ef5284ff 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -880,7 +880,7 @@ int SwWrtShell::IntelligentCut(SelectionType nSelection, bool bCut)
int cWord = NO_WORD;
// is a word selected?
- if(!cWord && cPrev && cNext &&
+ if (cPrev && cNext &&
CH_TXTATR_BREAKWORD != cPrev && CH_TXTATR_INWORD != cPrev &&
CH_TXTATR_BREAKWORD != cNext && CH_TXTATR_INWORD != cNext &&
!rCC.isLetterNumeric( ( sText = OUString(cPrev) ), 0 ) &&