diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-02 23:58:31 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-03 01:20:08 +0100 |
commit | 6ed52ecfed5781659cd27ff9aea5d0a04be77cd1 (patch) | |
tree | 5a8fb0696d7a575646dc6176d87bd57c888a3055 /sw | |
parent | 3abcd34f37b6aba5025631c64a49d4c8c34effd2 (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: Ieff0dde4faee209200b8f4e809e8bb4eb1b8f4a6
Reviewed-on: https://gerrit.libreoffice.org/64433
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/swserv.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 9 |
3 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 2428babd9019..8fd23844c09a 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -226,7 +226,7 @@ bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const for( size_t n = rLnks.size(); n; ) { const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); - if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() && + if (OBJECT_CLIENT_GRF != pLnk->GetObjType() && dynamic_cast<const SwBaseLink*>( pLnk) != nullptr && !static_cast<const SwBaseLink*>(pLnk)->IsNoDataFlag() && static_cast<const SwBaseLink*>(pLnk)->IsInRange( nSttNd, nEndNd )) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 59bdea7c35d3..74188bb66954 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2434,7 +2434,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) } const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !(bAllowSplitOfRow || !bEmulateTableKeepFwdMoveAllowed) ) ); - if( !bTryToSplit && !bSplitError && nUnSplitted > 0 ) + if (!bTryToSplit && !bSplitError) { --nUnSplitted; } @@ -5197,7 +5197,7 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } } - if ( ( bAttrSetChg && pNew && + if ( ( bAttrSetChg && SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_PROTECT, false ) ) || ( pNew && RES_PROTECT == pNew->Which()) ) { @@ -5206,7 +5206,7 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) pSh->Imp()->InvalidateAccessibleEditableState( true, this ); } - if ( bAttrSetChg && pNew && + if ( bAttrSetChg && SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_FRAMEDIR, false, &pItem ) ) { SetDerivedVert( false ); @@ -5214,7 +5214,7 @@ void SwCellFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) } // #i29550# - if ( bAttrSetChg && pNew && + if ( bAttrSetChg && SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_BOX, false, &pItem ) ) { SwFrame* pTmpUpper = GetUpper(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index f401e7ac2451..e0d787fe0ab3 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2473,7 +2473,7 @@ void SwHTMLParser::AddParSpace() bool bIsCJK = false; bool bIsCTL = false; - const size_t nCntAttr = (pTextNode && pTextNode->GetpSwpHints()) + const size_t nCntAttr = pTextNode->GetpSwpHints() ? pTextNode->GetSwpHints().Count() : 0; for(size_t i = 0; i < nCntAttr; ++i) @@ -2893,8 +2893,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, case RES_LR_SPACE: if( pAttrPam->GetPoint()->nNode.GetIndex() == - pAttrPam->GetMark()->nNode.GetIndex() && - pCNd ) + pAttrPam->GetMark()->nNode.GetIndex()) { // because of numbering set this attribute directly at node pCNd->SetAttr( *pAttr->m_pItem ); @@ -4912,7 +4911,7 @@ void SwHTMLParser::InsertSpacer() case HTML_SPTYPE_VERT: if( nSize > 0 ) { - if( nSize && Application::GetDefaultDevice() ) + if (Application::GetDefaultDevice()) { nSize = Application::GetDefaultDevice() ->PixelToLogic( Size(0,nSize), @@ -4960,7 +4959,7 @@ void SwHTMLParser::InsertSpacer() // If the paragraph is still empty, set first line // indentation, otherwise apply letter spacing over a space. - if( nSize && Application::GetDefaultDevice() ) + if (Application::GetDefaultDevice()) { nSize = Application::GetDefaultDevice() ->PixelToLogic( Size(nSize,0), |