summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-24 08:24:26 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-24 07:45:56 +0100
commit5bbe79272ee91bd4c93064e75b7a403025cf5212 (patch)
treef7c8f6340df405712a327e3fca66d32dbe90d95d
parentff66e912c4019c9d6320eeef4d75f265cd878d01 (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I5ca32214bab4b26208aecaa98eecc2a6297d9093 Reviewed-on: https://gerrit.libreoffice.org/65592 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx2
-rw-r--r--i18npool/source/search/textsearch.cxx4
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sw/source/core/frmedt/tblsel.cxx4
-rw-r--r--sw/source/ui/table/tabledlg.cxx4
-rw-r--r--vcl/source/outdev/text.cxx6
7 files changed, 12 insertions, 12 deletions
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index d56c9dcdc47e..43536d7925ab 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -262,7 +262,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt )
}
// automatically select right entry when dragging
- if ((FirstSelected() != pEntry) || (FirstSelected() && NextSelected(FirstSelected())))
+ if ((FirstSelected() != pEntry) || NextSelected(FirstSelected()))
SelectAll(false);
Select(pEntry);
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 10b58ba3ea6c..8ec461c5dd46 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -1128,7 +1128,7 @@ SearchResult TextSearch::WildcardSrchFrwrd( const OUString& searchStr, sal_Int32
// Forward nStartPos inclusive, nEndPos exclusive, but allow for empty
// string match with [0,0).
- if (nStartPos < 0 || nEndPos > nStringLen || nEndPos < nStartPos || nStartPos > nStringLen ||
+ if (nStartPos < 0 || nEndPos > nStringLen || nEndPos < nStartPos ||
(nStartPos == nStringLen && (nStringLen != 0 || nStartPos != nEndPos)))
return aRes;
@@ -1300,7 +1300,7 @@ SearchResult TextSearch::WildcardSrchBkwrd( const OUString& searchStr, sal_Int32
// Backward nStartPos exclusive, nEndPos inclusive, but allow for empty
// string match with (0,0].
- if (nStartPos > nStringLen || nEndPos < 0 || nStartPos < nEndPos || nEndPos > nStringLen ||
+ if (nStartPos > nStringLen || nEndPos < 0 || nStartPos < nEndPos ||
(nEndPos == nStringLen && (nStringLen != 0 || nStartPos != nEndPos)))
return aRes;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 3444a7e36fdc..32e443bc914d 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1367,7 +1367,7 @@ SCROW lcl_LastVisible( const ScViewData& rViewData )
void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY )
{
- if ( !pRowBar[SC_SPLIT_BOTTOM] || MAXROW < 10000 )
+ if (!pRowBar[SC_SPLIT_BOTTOM])
return;
SCROW nEndPos = MAXROW;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 1f394aaf7844..b82638a82770 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1439,7 +1439,7 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
if( pStyleSheetPool )
{
OUString aStr = GetSelectedEntry();
- if( !aStr.isEmpty() && pStyleSheetPool )
+ if (!aStr.isEmpty())
{
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
if( !pItem ) break;
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index d08545eaaf7f..fd1f59a150b0 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -300,7 +300,7 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd,
{
const SwLayoutFrame *pCell = pRow->FirstCell();
- while( bTableIsValid && pCell && pRow->IsAnLower( pCell ) )
+ while (pCell && pRow->IsAnLower(pCell))
{
if( !pCell->isFrameAreaDefinitionValid() && nLoopMax )
{
@@ -513,7 +513,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
{
const SwLayoutFrame *pCell = pRow->FirstCell();
- while( bValidChartSel && bTableIsValid && pCell && pRow->IsAnLower( pCell ) )
+ while (pCell && pRow->IsAnLower(pCell))
{
if( !pCell->isFrameAreaDefinitionValid() && nLoopMax )
{
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index b19711eb2502..3a4f5463b962 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1143,7 +1143,7 @@ SwTwips SwTableColumnPage::GetVisibleWidth(sal_uInt16 nPos)
while( nPos )
{
- if(pTableData->GetColumns()[i].bVisible && nPos)
+ if(pTableData->GetColumns()[i].bVisible)
nPos--;
i++;
}
@@ -1160,7 +1160,7 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
sal_uInt16 i=0;
while( nPos )
{
- if(pTableData->GetColumns()[i].bVisible && nPos)
+ if(pTableData->GetColumns()[i].bVisible)
nPos--;
i++;
}
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index c826126d4b27..d81fda0c58da 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -462,7 +462,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nMaxLineWidth = 0;
rLineInfo.Clear();
- if ( !rStr.isEmpty() && (nWidth > 0) )
+ if (!rStr.isEmpty())
{
const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) == DrawTextFlags::WordBreakHyphenation;
css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
@@ -2177,7 +2177,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector
+ if (!(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics)
&& accel && (!autoacc || !(nStyle & DrawTextFlags::HideMnemonic)) )
{
if ( nMnemonicPos != -1 )
@@ -2213,7 +2213,7 @@ long OutputDevice::GetCtrlTextWidth( const OUString& rStr, const SalLayoutGlyphs
{
if ( nMnemonicPos < nIndex )
nIndex--;
- else if ( (nMnemonicPos >= nIndex) && (static_cast<sal_uLong>(nMnemonicPos) < static_cast<sal_uLong>(nIndex+nLen)) )
+ else if (static_cast<sal_uLong>(nMnemonicPos) < static_cast<sal_uLong>(nIndex+nLen))
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen, nullptr, pGlyphs );