[Libreoffice-commits] core.git: 9 commits - connectivity/source framework/source sfx2/source svx/source sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Wed Apr 16 08:42:24 PDT 2014


 connectivity/source/drivers/postgresql/pq_baseresultset.cxx     |    2 +-
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx |    2 +-
 connectivity/source/drivers/postgresql/pq_statement.cxx         |    2 +-
 framework/source/uielement/menubarmerger.cxx                    |    1 +
 sfx2/source/dialog/dinfdlg.cxx                                  |    9 +--------
 svx/source/sidebar/line/LinePropertyPanel.cxx                   |    2 +-
 sw/source/core/access/accpara.cxx                               |    2 +-
 sw/source/core/frmedt/tblsel.cxx                                |    2 +-
 sw/source/filter/ww8/ww8par.cxx                                 |    2 --
 sw/source/ui/vba/vbadialog.cxx                                  |    7 ++++---
 vcl/source/filter/sgvmain.cxx                                   |    1 +
 11 files changed, 13 insertions(+), 19 deletions(-)

New commits:
commit bcbf14f6077b0ccf1179dcba3e382bda4f9bdcad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:40:24 2014 +0100

    coverity#1202773 Logically dead code
    
    I can't find any evidence that it was possible to be
    other than true/false here before sal_Bool got converted
    to bool
    
    Change-Id: Ieacc780b5f5abce0fe166337a50284bd5e0aef45

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 44750f8..df43353 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -217,8 +217,6 @@ SfxDocumentInfoItem::SfxDocumentInfoItem()
 {
 }
 
-
-
 SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
         const uno::Reference<document::XDocumentProperties>& i_xDocProps,
         const uno::Sequence<document::CmisProperty>& i_cmisProps,
@@ -1112,12 +1110,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
             m_pInfoItem->getEditingCycles() ) );
     }
 
-    TriState eState = (TriState)m_bUseUserData;
-
-    if ( TRISTATE_INDET == eState )
-        m_pUseUserDataCB->EnableTriState( true );
-
-    m_pUseUserDataCB->SetState( eState );
+    m_pUseUserDataCB->SetState( static_cast<TriState>(m_bUseUserData) );
     m_pUseUserDataCB->SaveValue();
     m_pUseUserDataCB->Enable( bEnableUseUserData );
     bHandleDelete = false;
commit 98a39af312d493c26eabc94f95df0c27b3c7f66c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:33:13 2014 +0100

    WaE: -Werror=maybe-uninitialized
    
    Change-Id: Id9226a5d460c114d4811209020f408779dd2424d

diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index e6fb435..5b4a030 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -617,7 +617,7 @@ sal_Bool BaseResultSet::convertFastPropertyValue(
     case BASERESULTSET_ESCAPE_PROCESSING:
     case BASERESULTSET_IS_BOOKMARKABLE:
     {
-        bool val;
+        bool val(false);
         bRet = ( rValue >>= val );
         m_props[nHandle] = makeAny( val );
         break;
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index bfb5010..83dbdbf 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -779,7 +779,7 @@ sal_Bool PreparedStatement::convertFastPropertyValue(
     }
     case PREPARED_STATEMENT_ESCAPE_PROCESSING:
     {
-        bool val;
+        bool val(false);
         bRet = ( rValue >>= val );
         rConvertedValue = makeAny( val );
         break;
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 14a7817..e002067 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -934,7 +934,7 @@ sal_Bool Statement::convertFastPropertyValue(
     }
     case STATEMENT_ESCAPE_PROCESSING:
     {
-        bool val;
+        bool val(false);
         bRet = ( rValue >>= val );
         rConvertedValue = makeAny( val );
         break;
commit eff36c994e0a0c19c8f38bba116e268ac7e9f146
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:27:43 2014 +0100

    coverity#1027390 Logically dead code
    
    Change-Id: Ie2d375093828cc2b0f9ca20b360a8fe8a5032dcf

diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 7452532..01c64f1 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -500,7 +500,7 @@ void LinePropertyPanel::NotifyItemUpdate(
 
                 if(pItem)
                 {
-                    mpStartItem.reset(pItem ? (XLineStartItem*)pItem->Clone() : 0);
+                    mpStartItem.reset((XLineStartItem*)pItem->Clone());
                     SelectEndStyle(true);
                     break;
                 }
commit a4d5f7d085bd13426e0f0ec3e84290120311a445
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:26:44 2014 +0100

    coverity#1157770 Logically dead code
    
    Change-Id: I28a19cbf77cf6354107a31a432a810e73ba45538

diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 16ce19e..74549d5 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1455,7 +1455,7 @@ OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
         const SwpHints* pSwpHints = GetTxtNode()->GetpSwpHints();
         if (pSwpHints)
         {
-            const sal_uInt16  nSize = pSwpHints ? pSwpHints->Count() : 0;
+            const sal_uInt16  nSize = pSwpHints->Count();
             for( sal_uInt16 i = 0; i < nSize; ++i )
             {
                 const SwTxtAttr* pHt = (*pSwpHints)[i];
commit e19b3b4230883fb34ef992d915a86768282b6779
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:24:47 2014 +0100

    coverity#735516 Logically dead code
    
    Change-Id: I70c6ae792805fa7165f465d076e9f4cda60e5e84

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 98d0ff6..8448a13 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -434,7 +434,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
     if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
             return sal_False;
 
-    const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
+    const SwLayoutFrm *pStart = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper();
     OSL_ENSURE( pStart, "without frame nothing works" );
 
     aIdx = rEndNd;
commit b56e32b3c7f37d7da45c148f9e662f8d6dd4caf9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:21:02 2014 +0100

    coverity#735534 Logically dead code
    
    Change-Id: If44c17bca47e461229823ad2b5d911df4b1e0319

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 6e68f63..ba99b4f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -765,8 +765,6 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
 
             if (nTextRotationAngle)
             {
-                while (nTextRotationAngle > 360000)
-                    nTextRotationAngle-=9000;
                 if (nTextRotationAngle == 9000)
                 {
                     long nWidth = rTextRect.GetWidth();
commit 0c8a3a82c1ccfb3dbe9c6e44fe1dff5f6befb3ef
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 14:18:50 2014 +0100

    coverity#1202778 Logically dead code
    
    Change-Id: Ie3f297bb5bf05bb133d964ddfe4d4f16af1eb73f

diff --git a/sw/source/ui/vba/vbadialog.cxx b/sw/source/ui/vba/vbadialog.cxx
index 1c8de59..ee83a33 100644
--- a/sw/source/ui/vba/vbadialog.cxx
+++ b/sw/source/ui/vba/vbadialog.cxx
@@ -40,11 +40,12 @@ static const WordDialogTable aWordDialogTable[] =
 OUString
 SwVbaDialog::mapIndexToName( sal_Int32 nIndex )
 {
-    for( const WordDialogTable* pTable = aWordDialogTable; pTable != NULL; pTable++ )
+    for (size_t i = 0; i < SAL_N_ELEMENTS(aWordDialogTable); ++i)
     {
-        if( nIndex == pTable->wdDialog )
+        const WordDialogTable& rTable = aWordDialogTable[i];
+        if( nIndex == rTable.wdDialog )
         {
-            return OUString::createFromAscii( pTable->ooDialog );
+            return OUString::createFromAscii( rTable.ooDialog );
         }
     }
     return OUString();
commit 9a8e6c715ab17a60f3014e912cfda0d609ca29aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 12:57:12 2014 +0100

    coverity#1202907 Uninitialized scalar variable
    
    Change-Id: I7c33a9ecaec6a771fa2a22c0ddb38a0a9b1d2df7

diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index 308d61a..cfbf396 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -260,6 +260,7 @@ SvStream& ReadTextType(SvStream& rInp, TextType& rText)
 }
 SvStream& ReadBmapType(SvStream& rInp, BmapType& rBmap)
 {
+    memset((char*)&rBmap.Last, 0, BmapSize);
     rInp.Read((char*)&rBmap.Last,BmapSize);
 #if defined OSL_BIGENDIAN
     SWAPOBJK (rBmap);
commit 159acfe7b83d4b39021f27c0e607a2579b959297
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 16 12:49:25 2014 +0100

    coverity#738544 Uninitialized scalar variable
    
    Change-Id: Ife273f4e36f7d2cfc837ab6fb21796392fd45d28

diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx
index 8efee13..e151ee9 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -88,6 +88,7 @@ ReferencePathInfo MenuBarMerger::FindReferencePath(
     {
         aResult.pPopupMenu = NULL;
         aResult.nPos = 0;
+        aResult.nLevel = -1;
         aResult.eResult = RP_MENUITEM_NOT_FOUND;
         return aResult;
     }


More information about the Libreoffice-commits mailing list