[Libreoffice-commits] core.git: 8 commits - comphelper/source cppu/source include/basegfx include/comphelper include/svx sc/source svx/source sw/source unoxml/source vcl/source xmloff/source

Caolán McNamara caolanm at redhat.com
Sat Jan 7 21:57:32 UTC 2017


 comphelper/source/misc/sequenceashashmap.cxx   |    4 ----
 cppu/source/typelib/static_types.cxx           |    2 +-
 include/basegfx/point/b2ipoint.hxx             |   12 ------------
 include/basegfx/tuple/b2ituple.hxx             |   20 --------------------
 include/comphelper/sequenceashashmap.hxx       |    5 -----
 include/svx/optgrid.hxx                        |    1 -
 sc/source/filter/excel/tokstack.cxx            |    1 +
 svx/source/dialog/optgrid.cxx                  |    4 ----
 sw/source/core/text/txtfrm.cxx                 |    4 ++--
 unoxml/source/dom/node.cxx                     |    2 +-
 vcl/source/filter/ixpm/xpmread.hxx             |    2 ++
 xmloff/source/transform/ChartOASISTContext.cxx |    2 +-
 xmloff/source/transform/StyleOOoTContext.cxx   |    2 +-
 13 files changed, 9 insertions(+), 52 deletions(-)

New commits:
commit 87f9e8945fde37182bec1e674dd6ccee4133209c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:58:25 2017 +0000

    default copy ctor and assignment operator are good enough
    
    and block default move equivalents
    
    Change-Id: Ib8a1050803446c2e099f66602fae0465bd8165cf

diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx
index 46df283..999c89c 100644
--- a/comphelper/source/misc/sequenceashashmap.cxx
+++ b/comphelper/source/misc/sequenceashashmap.cxx
@@ -51,10 +51,6 @@ SequenceAsHashMap::SequenceAsHashMap(const css::uno::Sequence< css::beans::Named
     (*this) << lSource;
 }
 
-SequenceAsHashMap::~SequenceAsHashMap()
-{
-}
-
 void SequenceAsHashMap::operator<<(const css::uno::Any& aSource)
 {
     // An empty Any reset this instance!
diff --git a/include/basegfx/point/b2ipoint.hxx b/include/basegfx/point/b2ipoint.hxx
index e092e35..7a930d6 100644
--- a/include/basegfx/point/b2ipoint.hxx
+++ b/include/basegfx/point/b2ipoint.hxx
@@ -60,15 +60,6 @@ namespace basegfx
         :   B2ITuple(nX, nY)
         {}
 
-        /** Create a copy of a 2D Point
-
-            @param rPoint
-            The 2D Point which will be copied.
-        */
-        B2IPoint(const B2IPoint& rPoint)
-        :   B2ITuple(rPoint)
-        {}
-
         /** constructor with tuple to allow copy-constructing
             from B2ITuple-based classes
         */
@@ -76,9 +67,6 @@ namespace basegfx
         :   B2ITuple(rTuple)
         {}
 
-        ~B2IPoint()
-        {}
-
         /** *=operator to allow usage from B2IPoint, too
         */
         B2IPoint& operator*=( const B2IPoint& rPnt )
diff --git a/include/basegfx/tuple/b2ituple.hxx b/include/basegfx/tuple/b2ituple.hxx
index 7c859d5..f8df10f 100644
--- a/include/basegfx/tuple/b2ituple.hxx
+++ b/include/basegfx/tuple/b2ituple.hxx
@@ -66,19 +66,6 @@ namespace basegfx
             mnY( fY )
         {}
 
-        /** Create a copy of a 2D Tuple
-
-            @param rTup
-            The 2D Tuple which will be copied.
-        */
-        B2ITuple(const B2ITuple& rTup)
-        :   mnX( rTup.mnX ),
-            mnY( rTup.mnY )
-        {}
-
-        ~B2ITuple()
-        {}
-
         /// Get X-Coordinate of 2D Tuple
         sal_Int32 getX() const
         {
@@ -185,13 +172,6 @@ namespace basegfx
         {
             return !(*this == rTup);
         }
-
-        B2ITuple& operator=( const B2ITuple& rTup )
-        {
-            mnX = rTup.mnX;
-            mnY = rTup.mnY;
-            return *this;
-        }
     };
 
     // external operators
diff --git a/include/comphelper/sequenceashashmap.hxx b/include/comphelper/sequenceashashmap.hxx
index fdec8cc..aaa45fd 100644
--- a/include/comphelper/sequenceashashmap.hxx
+++ b/include/comphelper/sequenceashashmap.hxx
@@ -78,11 +78,6 @@ class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase
         SequenceAsHashMap(const css::uno::Sequence< css::beans::NamedValue >& lSource);
 
 
-        /** @short  not really used but maybe useful :-)
-         */
-        ~SequenceAsHashMap();
-
-
         /** @short  fill this map from the given
                     Any, which of course must contain
                     a suitable sequence of element types
diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index ab00b9f..f69ab59 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -46,7 +46,6 @@ protected:
 
 public:
     SvxOptionsGrid();
-    ~SvxOptionsGrid();
 
     void    SetFieldDrawX(    sal_uInt32 nSet){nFldDrawX      = nSet;}
     void    SetFieldDivisionX(sal_uInt32 nSet){nFldDivisionX  = nSet;}
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index f759d7c..c503427 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -58,10 +58,6 @@ SvxOptionsGrid::SvxOptionsGrid() :
 {
 }
 
-SvxOptionsGrid::~SvxOptionsGrid()
-{
-}
-
 SvxGridItem::SvxGridItem( const SvxGridItem& rItem )
 :   SvxOptionsGrid()
 ,   SfxPoolItem(rItem)
commit 8b6e914305d978892e106a575662a2a5217242dc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:54:08 2017 +0000

    coverity#1358841 Explicit null dereferenced
    
    Change-Id: I1c4cff09a7c549e9a14886c1460a7e2c2c74f757

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 30117ed..ee61362 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2285,7 +2285,7 @@ void SwTextFrame::CalcHeightOfLastLine( const bool _bUseFont )
             aFont.SetFntChg( true );
             aFont.ChgPhysFnt( pVsh, *pOut );
             mnHeightOfLastLine = aFont.GetHeight( pVsh, *pOut );
-            //coverity[var_deref_model] - pLastFont is set in SwSubFont::ChgFnt
+            assert(pLastFont && "coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
             pLastFont->Unlock();
             pLastFont = pOldFont;
             pLastFont->SetDevFont( pVsh, *pOut );
@@ -2296,7 +2296,7 @@ void SwTextFrame::CalcHeightOfLastLine( const bool _bUseFont )
             aFont.SetFntChg( true );
             aFont.ChgPhysFnt( pVsh, *pOut );
             mnHeightOfLastLine = aFont.GetHeight( pVsh, *pOut );
-            //coverity[var_deref_model] - pLastFont is set in SwSubFont::ChgFnt
+            assert(pLastFont && "coverity[var_deref_model] - pLastFont should be set in SwSubFont::ChgFnt");
             pLastFont->Unlock();
             pLastFont = nullptr;
             pOut->SetFont( aOldFont );
commit 1e50b35595b8e0b8d1dc03145f5ee33b7224fc31
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:51:41 2017 +0000

    coverity#735796 Explicit null dereferenced
    
    Change-Id: I7468fd9637421b8b854217c19969f94e9ab0cab4

diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index ae8c59b..68993c2 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -553,6 +553,7 @@ bool TokenPool::GetElementRek( const sal_uInt16 nId )
     }
     for( ; nAnz > 0 ; nAnz--, pAkt++ )
     {
+        assert(pAkt);
         if( *pAkt < nScTokenOff )
         {// recursion or not?
             if (*pAkt >= nElementAkt)
commit c962f1629213ed30fad355eb5168e212edc4e36a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:49:26 2017 +0000

    coverity#705098 Explicit null dereferenced
    
    Change-Id: Icf32bbe9ce259048219ba88aa7e4dc51592f7cb5

diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index 3a6df66..bf841ca 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -978,7 +978,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
             aProtectAttrValue += rSize;
         }
 
-        // coverity[var_deref_model] - pProtectContext is assigned in a superset of the enclosing if condition entry logic
+        assert(pProtectContext && "coverity[var_deref_model] - pProtectContext should be assigned in a superset of the enclosing if condition entry logic");
         pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue );
     }
 
commit d126ce58c2eb8c56faaa2163a62c5fe5d4b68690
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:48:30 2017 +0000

    coverity#705097 Explicit null dereferenced
    
    Change-Id: I0c2163f91b86d2b48b7bc58b173438d2aa11377d

diff --git a/xmloff/source/transform/ChartOASISTContext.cxx b/xmloff/source/transform/ChartOASISTContext.cxx
index 2a7c507..a0c233d 100644
--- a/xmloff/source/transform/ChartOASISTContext.cxx
+++ b/xmloff/source/transform/ChartOASISTContext.cxx
@@ -121,7 +121,7 @@ void XMLChartOASISTransformerContext::StartElement(
         OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey(
                                 XML_NAMESPACE_CHART,
                                 GetXMLToken( XML_ADD_IN_NAME ) ) );
-        // coverity[var_deref_model] - pMutableAttrList is assigned in a superset of the enclosing if condition entry logic
+        assert(pMutableAttrList && "coverity[var_deref_model] - pMutableAttrList should be assigned in a superset of the enclosing if condition entry logic");
         pMutableAttrList->AddAttribute( aAttrQName, aAddInName );
     }
 
commit 8b87f29461493b7a6759b9aa1420a0fa945689b3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:46:16 2017 +0000

    forward decl of Graphic needed here
    
    Change-Id: I81a4bb99ffa41531323e5a5b3473f54dd0cb8910

diff --git a/vcl/source/filter/ixpm/xpmread.hxx b/vcl/source/filter/ixpm/xpmread.hxx
index d353262..4a39949 100644
--- a/vcl/source/filter/ixpm/xpmread.hxx
+++ b/vcl/source/filter/ixpm/xpmread.hxx
@@ -22,6 +22,8 @@
 
 #include <vcl/bitmap.hxx>
 
+class Graphic;
+
 VCL_DLLPUBLIC bool ImportXPM( SvStream& rStream, Graphic& rGraphic );
 
 #endif // INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX
commit 30d28cb883c2304a845c816c0f1d1e504991cd76
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:45:36 2017 +0000

    coverity#704593 Dereference after null check
    
    Change-Id: I5426cb2e8ca1e8fd2e9f38419ffe6d6e148a7cba

diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 2d8aa12..33e5b29 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -289,7 +289,7 @@ void SAL_CALL typelib_static_type_init(
             OUString aTypeName( OUString::createFromAscii( pTypeName ) );
             ::typelib_typedescriptionreference_new( ppRef, eTypeClass, aTypeName.pData );
 
-            // coverity[var_deref_op] - another static ref
+            assert(*ppRef && "coverity[var_deref_op] - shouldn't be possible");
             ++((*ppRef)->nStaticRefCount);
         }
     }
commit 89efbdd440343bd10b03fc80b6e396aea3215e90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 7 20:43:50 2017 +0000

    coverity#440749 Explicit null dereferenced
    
    Change-Id: I0927e51d0cdb53b5bd20d4f1cf567cbfb4b377da

diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index 50adabe..c863a0e 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -905,7 +905,7 @@ namespace DOM
                 if (pNew->next != nullptr)
                     pNew->next->prev = pNew;
                 pNew->parent = pOld->parent;
-                // coverity[var_deref_op] pNew->parent cannot be NULL here
+                assert(pNew->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)


More information about the Libreoffice-commits mailing list