summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-25 19:52:09 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-25 20:35:57 +0100
commit4ac2f1799f1d6d428c06e5699c246184dd8590ad (patch)
treeb96b61a7a037074d3155b63f30c01fbf276c491f
parent1bc269504bc16b188f77204f53f1c34541750da9 (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I2ae298f49ceba8059cd7236431db9a4d9a46b125 Reviewed-on: https://gerrit.libreoffice.org/63992 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx2
-rw-r--r--linguistic/source/lngsvcmgr.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpfnlayout.cxx4
-rw-r--r--lotuswordpro/source/filter/lwppara.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx9
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx14
6 files changed, 19 insertions, 18 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 11d3f4bb070c..a3d2595022f0 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -2025,7 +2025,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const
}
of.writeParameter("ReservedWord", str, nbOfWords);
// "true", ..., "below" trigger untranslated warning.
- if (!bEnglishLocale && curNode && (0 <= i && i <= 7) &&
+ if (!bEnglishLocale && curNode && i <= 7 &&
str.equalsIgnoreAsciiCaseAscii( ReserveWord[i].value))
{
fprintf( stderr,
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 9d57c1432b29..a95f5bfd4fbd 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1585,7 +1585,7 @@ void SAL_CALL
mxSpellDsp->SetServiceList( rLocale, rServiceImplNames );
SaveCfgSvcs( SN_SPELLCHECKER );
- if (mxListenerHelper.is() && bChanged)
+ if (mxListenerHelper)
mxListenerHelper->AddLngSvcEvt(
linguistic2::LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN |
linguistic2::LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN );
@@ -1602,7 +1602,7 @@ void SAL_CALL
mxGrammarDsp->SetServiceList( rLocale, rServiceImplNames );
SaveCfgSvcs( SN_GRAMMARCHECKER );
- if (mxListenerHelper.is() && bChanged)
+ if (mxListenerHelper)
mxListenerHelper->AddLngSvcEvt(
linguistic2::LinguServiceEventFlags::PROOFREAD_AGAIN );
}
@@ -1618,7 +1618,7 @@ void SAL_CALL
mxHyphDsp->SetServiceList( rLocale, rServiceImplNames );
SaveCfgSvcs( SN_HYPHENATOR );
- if (mxListenerHelper.is() && bChanged)
+ if (mxListenerHelper)
mxListenerHelper->AddLngSvcEvt(
linguistic2::LinguServiceEventFlags::HYPHENATE_AGAIN );
}
diff --git a/lotuswordpro/source/filter/lwpfnlayout.cxx b/lotuswordpro/source/filter/lwpfnlayout.cxx
index c2ac01055119..6dc167ff8dda 100644
--- a/lotuswordpro/source/filter/lwpfnlayout.cxx
+++ b/lotuswordpro/source/filter/lwpfnlayout.cxx
@@ -264,7 +264,7 @@ LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
{
break;
}
- if (pLayout && pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
+ if (pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
{
return pLayout;
}
@@ -321,7 +321,7 @@ LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
{
break;
}
- if (pLayout && pLayout->GetLayoutType() == LWP_FOOTNOTE_LAYOUT)
+ if (pLayout->GetLayoutType() == LWP_FOOTNOTE_LAYOUT)
{
return pLayout;
}
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index aca3fb934ac3..5b92281b0560 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -546,7 +546,7 @@ void LwpPara::RegisterStyle()
}
else
{
- if (pNumbering && pNumbering->GetLevel() < nFoundBound && pParaSilverBullet
+ if (pNumbering->GetLevel() < nFoundBound
&& (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID()
|| pNumbering->GetPosition() != nPosition))
{
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 05c817ab7855..b2d9d8a37b61 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -471,14 +471,15 @@ void LinkManager::InsertFileLink(
void LinkManager::CancelTransfers()
{
SvFileObject* pFileObj;
- sfx2::SvBaseLink* pLnk;
const sfx2::SvBaseLinks& rLnks = GetLinks();
for( size_t n = rLnks.size(); n; )
- if( nullptr != ( pLnk = &(*rLnks[ --n ])) &&
- OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) &&
- nullptr != ( pFileObj = static_cast<SvFileObject*>(pLnk->GetObj()) ) )
+ {
+ const sfx2::SvBaseLink& rLnk = *rLnks[--n];
+ if (OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & rLnk.GetObjType())
+ && nullptr != (pFileObj = static_cast<SvFileObject*>(rLnk.GetObj())))
pFileObj->CancelTransfers();
+ }
}
// For the purpose of sending Status information from the file object to
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 33c478fc457f..618aece61eec 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -705,19 +705,19 @@ void LinePropertyPanelBase::SetWidthIcon()
if(nVal <= 6)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[0]);
- else if(nVal > 6 && nVal <= 9)
+ else if (nVal <= 9)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[1]);
- else if(nVal > 9 && nVal <= 12)
+ else if (nVal <= 12)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[2]);
- else if(nVal > 12 && nVal <= 19)
+ else if (nVal <= 19)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[3]);
- else if(nVal > 19 && nVal <= 26)
+ else if (nVal <= 26)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[4]);
- else if(nVal > 26 && nVal <= 37)
+ else if (nVal <= 37)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[5]);
- else if(nVal > 37 && nVal <=52)
+ else if (nVal <= 52)
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[6]);
- else if(nVal > 52)
+ else
mpTBWidth->SetItemImage( nIdWidth, mpIMGWidthIcon[7]);
}