[Libreoffice-commits] core.git: 11 commits - cppu/source desktop/source editeng/source idl/source sc/source sd/source unoxml/source vbahelper/source

Caolán McNamara caolanm at redhat.com
Thu Dec 11 03:02:41 PST 2014


 cppu/source/uno/copy.hxx                                      |    1 
 desktop/source/deployment/registry/component/dp_component.cxx |    2 
 editeng/source/items/frmitems.cxx                             |    1 
 idl/source/objects/basobj.cxx                                 |    2 
 sc/source/core/data/table4.cxx                                |    2 
 sc/source/ui/miscdlgs/autofmt.cxx                             |    1 
 sd/source/filter/eppt/pptx-epptooxml.cxx                      |    1 
 sd/source/filter/ppt/pptinanimations.cxx                      |    2 
 sd/source/ui/unoidl/unopage.cxx                               |    1 
 unoxml/source/dom/node.cxx                                    |    1 
 vbahelper/source/vbahelper/vbashaperange.cxx                  |   39 ++++++----
 11 files changed, 36 insertions(+), 17 deletions(-)

New commits:
commit f5728a8881d59d8fddbe267645c7a3921a4830ac
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 11 09:23:02 2014 +0000

    document 735481 Logically dead code
    
    Change-Id: I720b51f52010e0946061302dc733f50360073930

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1f1362b..08313df 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -636,6 +636,7 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
         nTransition = XML_zoom;
         pDirection = ( nDirection == 1) ? "in" : "out";
         break;
+        // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
         case PPT_TRANSITION_TYPE_NONE:
         default:
         nTransition = 0;
commit 67031e8dc06c411622039392d41e7caf94a93766
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 11 09:18:40 2014 +0000

    coverity#703983 Unchecked return value
    
    Change-Id: I83fe85a50e6e98da02a7c46a9e0c07a043244d56

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index f3789c7..2768429 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -362,7 +362,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
         rListData = (ScUserListData*)(ScGlobal::GetUserList()->GetData(aStr));
         if (rListData)
         {
-            rListData->GetSubIndex(aStr, rListIndex);
+            (void)rListData->GetSubIndex(aStr, rListIndex);
             nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
             nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
             for (sal_uInt16 i=1; i<nCount && rListData; i++)
commit f9b08152350f4db9db6e9f7ec326630e3eab06c1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 11 09:18:13 2014 +0000

    coverity#703967 Unchecked return value
    
    Change-Id: I7da643edf07e689bb24129d363fbba8170efa652

diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index 54a11cd..a82d121 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -125,7 +125,7 @@ void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
         if( cDel == '\0' )
             rInStm.ReadDelemiter();
         else
-            rInStm.Read( cDel );
+            (void)rInStm.Read( cDel );
     }
 }
 
commit 2ff53f66dc2fbb44b253065e564b6a44aa0b7833
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 11 09:17:43 2014 +0000

    coverity#703948 Unchecked return value
    
    Change-Id: Id72cb51ae61d663ab58585ba4b83086080462bab

diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 7976be5..5c13755 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -439,7 +439,7 @@ void BackendImpl::initServiceRdbFiles()
     // switch common rdb:
     if (!m_commonRDB_orig.isEmpty())
     {
-        create_ucb_content(
+        (void)create_ucb_content(
             &oldRDB, makeURL( getCachePath(), m_commonRDB_orig),
             xCmdEnv, false /* no throw */ );
     }
commit d08a7036dcdd75aba1b8ae67a0af745deb813ff2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 11 09:16:34 2014 +0000

    document 440749 Explicit null dereferenced
    
    Change-Id: I9f2e97504953742f09981632b7901fcd2fae6747

diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index 40fae80..ab80060 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -913,6 +913,7 @@ namespace DOM
                 if (pNew->next != NULL)
                     pNew->next->prev = pNew;
                 pNew->parent = pOld->parent;
+                // coverity[var_deref_op] pNew->parent cannot be NULL here
                 if(pNew->parent->children == pOld)
                     pNew->parent->children = pNew;
                 if(pNew->parent->last == pOld)
commit 43df355a86b1db8c11e6a42c06131d97626f04a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 21:21:43 2014 +0000

    coverity#704009 Unchecked return value
    
    Change-Id: I8f5c37c99d81811f94f3f1b4e863be1de7debaec

diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index eba584d..62d1b4e 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -2609,7 +2609,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
                     {
                         pValue = pAtom->findNextChildAtom(pValue);
                         if( pValue && pValue->getType() == DFF_msofbtAnimAttributeValue )
-                            importAttributeValue( pValue, aValue2 );
+                            (void)importAttributeValue( pValue, aValue2 );
 
                         bool bCouldBeFormula = false;
                         bool bHasValue = aValue2.hasValue();
commit ca7b0ec3ae14a82059e3e26868411f1720b5f2e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 17:35:07 2014 +0000

    document 704272 Logically dead code
    
    Change-Id: Ib0b2225bc0b09c910c6f47c36c3e118b8c999df8

diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 2e24fce..b062a3e 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -326,6 +326,7 @@ void ScAutoFmtPreview::DrawString( size_t nCol, size_t nRow )
                     case SVX_HOR_JUSTIFY_CENTER:
                         aPos.X() += nHorPos;
                         break;
+                    // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
                     case SVX_HOR_JUSTIFY_STANDARD:
                     default:
                         // Standard is not handled here
commit 4285c7c1437c1affa8c98c19e44254bfa4e17459
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 17:34:28 2014 +0000

    document 704296 Logically dead code
    
    Change-Id: I4fcced3a79113037d159301e04bdda54246edd13

diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 9d745a1..09f15ca 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -1477,6 +1477,7 @@ Reference< drawing::XShape >  SdGenericDrawPage::_CreateShape(SdrObject *pObj) c
             case PRESOBJ_DATETIME:
                 aShapeType += "DateTimeShape";
                 break;
+            // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
             case PRESOBJ_NONE:
             case PRESOBJ_IMAGE:
             case PRESOBJ_MAX:
commit 3ff1ce130a04643a5c4b1c2e905c7303fc6cde6e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 17:32:53 2014 +0000

    coverity#705150 Missing break in switch
    
    Change-Id: I5df9dff9ef6940b15c899d13f1a358e47dbd8b2b

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index de18d85..e4b6e0c 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1882,6 +1882,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             break;
         case RIGHT_BORDER_DISTANCE:
             bDistMember = true;
+            //fall-through
         case RIGHT_BORDER:
         case MID_RIGHT_BORDER:
             nLine = BOX_LINE_RIGHT;
commit 398c83576b006f718f8d61a133c06a7ad7dd9375
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 17:30:59 2014 +0000

    document coverity#706128 Wrong sizeof argument
    
    Change-Id: Ibb38d8b8395300501caa0fc040f03b06770fd42e

diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx
index 55a23c1..591f437 100644
--- a/cppu/source/uno/copy.hxx
+++ b/cppu/source/uno/copy.hxx
@@ -443,6 +443,7 @@ inline uno_Sequence * icopyConstructSequence(
             }
             case typelib_TypeClass_SEQUENCE: // sequence of sequence
             {
+                // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here
                 pDest = allocSeq( sizeof (uno_Sequence *), nElements );
                 if (pDest != 0)
                 {
commit 131762b16d5d2a2f6694ea5d7f9d2ecd60d68e80
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 10 17:22:35 2014 +0000

    coverity#738950 Structurally dead code
    
    Change-Id: If481c3dfd2c7c9b13bb7fa756156693fd02b8916

diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index a5f45a3..ee22a46 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -120,7 +120,8 @@ ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException,
 OUString SAL_CALL ScVbaShapeRange::getName() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getName( );
@@ -141,7 +142,8 @@ void SAL_CALL ScVbaShapeRange::setName( const OUString& _name ) throw (uno::Runt
 double SAL_CALL ScVbaShapeRange::getHeight() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getHeight( );
@@ -162,7 +164,8 @@ void SAL_CALL ScVbaShapeRange::setHeight( double _height ) throw (uno::RuntimeEx
 double SAL_CALL ScVbaShapeRange::getWidth() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getWidth( );
@@ -183,7 +186,8 @@ void SAL_CALL ScVbaShapeRange::setWidth( double _width ) throw (uno::RuntimeExce
 double SAL_CALL ScVbaShapeRange::getLeft() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getLeft();
@@ -204,7 +208,8 @@ void SAL_CALL ScVbaShapeRange::setLeft( double _left ) throw (uno::RuntimeExcept
 double SAL_CALL ScVbaShapeRange::getTop() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getTop();
@@ -225,7 +230,8 @@ void SAL_CALL ScVbaShapeRange::setTop( double _top ) throw (uno::RuntimeExceptio
 uno::Reference< ov::msforms::XLineFormat > SAL_CALL ScVbaShapeRange::getLine() throw (css::uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getLine();
@@ -236,7 +242,8 @@ uno::Reference< ov::msforms::XLineFormat > SAL_CALL ScVbaShapeRange::getLine() t
 uno::Reference< ov::msforms::XFillFormat > SAL_CALL ScVbaShapeRange::getFill() throw (css::uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getFill();
@@ -247,7 +254,8 @@ uno::Reference< ov::msforms::XFillFormat > SAL_CALL ScVbaShapeRange::getFill() t
 sal_Bool SAL_CALL ScVbaShapeRange::getLockAspectRatio() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getLockAspectRatio();
@@ -268,7 +276,8 @@ void SAL_CALL ScVbaShapeRange::setLockAspectRatio( sal_Bool _lockaspectratio ) t
 sal_Bool SAL_CALL ScVbaShapeRange::getLockAnchor() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getLockAnchor();
@@ -289,7 +298,8 @@ void SAL_CALL ScVbaShapeRange::setLockAnchor( sal_Bool _lockanchor ) throw (uno:
 ::sal_Int32 SAL_CALL ScVbaShapeRange::getRelativeHorizontalPosition() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getRelativeHorizontalPosition();
@@ -310,7 +320,8 @@ void SAL_CALL ScVbaShapeRange::setRelativeHorizontalPosition( ::sal_Int32 _relat
 ::sal_Int32 SAL_CALL ScVbaShapeRange::getRelativeVerticalPosition() throw (uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->getRelativeVerticalPosition();
@@ -331,7 +342,8 @@ void SAL_CALL ScVbaShapeRange::setRelativeVerticalPosition( ::sal_Int32 _relativ
 uno::Any SAL_CALL ScVbaShapeRange::TextFrame(  ) throw (css::uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->TextFrame();
@@ -342,7 +354,8 @@ uno::Any SAL_CALL ScVbaShapeRange::TextFrame(  ) throw (css::uno::RuntimeExcepti
 uno::Any SAL_CALL ScVbaShapeRange::WrapFormat(  ) throw (css::uno::RuntimeException, std::exception)
 {
     sal_Int32 nLen = getCount();
-    for ( sal_Int32 index = 1; index <= nLen; /* ++index unreachable */ )
+    sal_Int32 index = 1;
+    if (index <= nLen)
     {
         uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW );
         return xShape->WrapFormat();


More information about the Libreoffice-commits mailing list