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>
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index d56c9dc..43536d7 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -262,7 +262,7 @@
            }

            // 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 10b58ba..8ec461c 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -1128,7 +1128,7 @@

    // 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 @@

    // 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 3444a7e..32e443b 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1367,7 +1367,7 @@

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 1f394aa..b82638a 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1439,7 +1439,7 @@
                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 d08545e..fd1f59a 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -300,7 +300,7 @@
                {
                    const SwLayoutFrame *pCell = pRow->FirstCell();

                    while( bTableIsValid && pCell && pRow->IsAnLower( pCell ) )
                    while (pCell && pRow->IsAnLower(pCell))
                    {
                        if( !pCell->isFrameAreaDefinitionValid() && nLoopMax )
                        {
@@ -513,7 +513,7 @@
                {
                    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 b19711e..3a4f546 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1143,7 +1143,7 @@

    while( nPos )
    {
        if(pTableData->GetColumns()[i].bVisible && nPos)
        if(pTableData->GetColumns()[i].bVisible)
            nPos--;
        i++;
    }
@@ -1160,7 +1160,7 @@
    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 c826126..d81fda0 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -462,7 +462,7 @@

    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 @@
            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 @@
    {
        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 );