[Libreoffice-commits] core.git: dbaccess/source i18npool/source sc/source sfx2/source sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 24 06:46:20 UTC 2018


 dbaccess/source/ui/querydesign/TableWindowListBox.cxx |    2 +-
 i18npool/source/search/textsearch.cxx                 |    4 ++--
 sc/source/ui/view/tabview.cxx                         |    2 +-
 sfx2/source/dialog/templdlg.cxx                       |    2 +-
 sw/source/core/frmedt/tblsel.cxx                      |    4 ++--
 sw/source/ui/table/tabledlg.cxx                       |    4 ++--
 vcl/source/outdev/text.cxx                            |    6 +++---
 7 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 5bbe79272ee91bd4c93064e75b7a403025cf5212
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Dec 24 08:24:26 2018 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Dec 24 07:45:56 2018 +0100

    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 at collabora.com>

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


More information about the Libreoffice-commits mailing list