[Libreoffice-commits] core.git: 3 commits - bin/findunusedcode dbaccess/source filter/source unusedcode.easy

Caolán McNamara caolanm at redhat.com
Mon Apr 13 04:49:13 PDT 2015


 bin/findunusedcode                                      |    2 
 dbaccess/source/ui/inc/ConnectionLineAccess.hxx         |    6 --
 dbaccess/source/ui/inc/JAccess.hxx                      |    5 --
 dbaccess/source/ui/inc/QueryTextView.hxx                |    2 
 dbaccess/source/ui/inc/TableWindowAccess.hxx            |    5 --
 dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx |   16 ------
 dbaccess/source/ui/querydesign/JAccess.cxx              |    4 -
 dbaccess/source/ui/querydesign/QueryTextView.cxx        |    5 --
 dbaccess/source/ui/querydesign/TableWindowAccess.cxx    |    4 -
 filter/source/msfilter/escherex.cxx                     |   37 ++++++++--------
 unusedcode.easy                                         |    6 --
 11 files changed, 20 insertions(+), 72 deletions(-)

New commits:
commit ce705ac56a8709970356d634abb964adef105594
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 13 12:46:34 2015 +0100

    fix int wraparound + crash on export of fdo74018-2.docx to doc
    
    nPoints is 16bit and accumulated value wraps around, so use
    a 32bit nTotalPoints instead and move 16bit declarations to
    use points to confirm no other wraparounds
    
    Change-Id: If97ccb46ed8eb7f4305cdfe328ae83bc2b0c778c

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 22bb0f0..67680c0 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -2056,42 +2056,43 @@ bool EscherPropertyContainer::CreatePolygonProperties(
         {
             Polygon aPolygon;
 
-            sal_uInt16 i, j, k, nPoints, nBezPoints, nPolyCount = aPolyPolygon.Count();
+            sal_uInt16 nPolyCount = aPolyPolygon.Count();
+            sal_uInt32 nTotalPoints(0), nTotalBezPoints(0);
             Rectangle aRect( aPolyPolygon.GetBoundRect() );
             rGeoRect = ::com::sun::star::awt::Rectangle( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight() );
 
-            for ( nBezPoints = nPoints = i = 0; i < nPolyCount; i++ )
+            for (sal_uInt16 i = 0; i < nPolyCount; ++i)
             {
-                k = aPolyPolygon[ i ].GetSize();
-                nPoints = nPoints + k;
-                for ( j = 0; j < k; j++ )
+                sal_uInt16 k = aPolyPolygon[ i ].GetSize();
+                nTotalPoints += k;
+                for (sal_uInt16 j = 0; j < k; ++j)
                 {
                     if ( aPolyPolygon[ i ].GetFlags( j ) != POLY_CONTROL )
-                        nBezPoints++;
+                        nTotalBezPoints++;
                 }
             }
-            sal_uInt32 nVerticesBufSize = ( nPoints << 2 ) + 6;
+            sal_uInt32 nVerticesBufSize = ( nTotalPoints << 2 ) + 6;
             sal_uInt8* pVerticesBuf = new sal_uInt8[ nVerticesBufSize ];
 
 
-            sal_uInt32 nSegmentBufSize = ( ( nBezPoints << 2 ) + 8 );
+            sal_uInt32 nSegmentBufSize = ( ( nTotalBezPoints << 2 ) + 8 );
             if ( nPolyCount > 1 )
                 nSegmentBufSize += ( nPolyCount << 1 );
             sal_uInt8* pSegmentBuf = new sal_uInt8[ nSegmentBufSize ];
 
             sal_uInt8* pPtr = pVerticesBuf;
-            *pPtr++ = (sal_uInt8)( nPoints );                    // Little endian
-            *pPtr++ = (sal_uInt8)( nPoints >> 8 );
-            *pPtr++ = (sal_uInt8)( nPoints );
-            *pPtr++ = (sal_uInt8)( nPoints >> 8 );
+            *pPtr++ = (sal_uInt8)( nTotalPoints );                    // Little endian
+            *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 );
+            *pPtr++ = (sal_uInt8)( nTotalPoints );
+            *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 );
             *pPtr++ = (sal_uInt8)0xf0;
             *pPtr++ = (sal_uInt8)0xff;
 
-            for ( j = 0; j < nPolyCount; j++ )
+            for (sal_uInt16 j = 0; j < nPolyCount; ++j)
             {
                 aPolygon = aPolyPolygon[ j ];
-                nPoints = aPolygon.GetSize();
-                for ( i = 0; i < nPoints; i++ )             // write points from polygon to buffer
+                sal_uInt16 nPoints = aPolygon.GetSize();
+                for (sal_uInt16 i = 0; i < nPoints; ++i)             // write points from polygon to buffer
                 {
                     Point aPoint = aPolygon[ i ];
                     aPoint.X() -= rGeoRect.X;
@@ -2112,13 +2113,13 @@ bool EscherPropertyContainer::CreatePolygonProperties(
             *pPtr++ = (sal_uInt8)2;
             *pPtr++ = (sal_uInt8)0;
 
-            for ( j = 0; j < nPolyCount; j++ )
+            for (sal_uInt16 j = 0; j < nPolyCount; ++j)
             {
                 *pPtr++ = 0x0;          // Polygon start
                 *pPtr++ = 0x40;
                 aPolygon = aPolyPolygon[ j ];
-                nPoints = aPolygon.GetSize();
-                for ( i = 0; i < nPoints; i++ )         // write Polyflags to Buffer
+                sal_uInt16 nPoints = aPolygon.GetSize();
+                for (sal_uInt16 i = 0; i < nPoints; ++i)         // write Polyflags to Buffer
                 {
                     *pPtr++ = 0;
                     if ( bBezier )
commit a4b11f03187056248643c1f5deb7f3645a6570b7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 13 09:22:26 2015 +0100

    callcatcher: update unused code
    
    Change-Id: I29524711d8afe53cc03e6b6d941b3578566398aa

diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
index ce34510..fa3e860 100644
--- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
@@ -41,10 +41,6 @@ namespace dbaui
         */
         virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
-        /** isEditable returns the current editable state
-            @return true if it is editable otherwise false
-        */
-        bool isEditable() const;
     public:
         OConnectionLineAccess(OTableConnection* _pLine);
 
@@ -79,13 +75,11 @@ namespace dbaui
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 
         // XAccessibleComponent
-        bool SAL_CALL contains( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-        bool SAL_CALL isShowing(  ) throw (::com::sun::star::uno::RuntimeException);
 
         // XAccessibleRelationSet
         virtual sal_Int32 SAL_CALL getRelationCount(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/JAccess.hxx b/dbaccess/source/ui/inc/JAccess.hxx
index d964290..44e8dfb 100644
--- a/dbaccess/source/ui/inc/JAccess.hxx
+++ b/dbaccess/source/ui/inc/JAccess.hxx
@@ -34,11 +34,6 @@ namespace dbaui
     {
         OJoinTableView* m_pTableView; // the window which I should give accessibility to
 
-    protected:
-        /** isEditable returns the current editable state
-            @return true if the controller is not readonly otherwise false
-        */
-        bool isEditable() const;
     public:
         /** OJoinDesignViewAccess needs a valid view
         */
diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx
index a45eefb..5d9cff7 100644
--- a/dbaccess/source/ui/inc/QueryTextView.hxx
+++ b/dbaccess/source/ui/inc/QueryTextView.hxx
@@ -41,8 +41,6 @@ namespace dbaui
         void paste();
         // clears the whole query
         void clear();
-        // set the view readonly or not
-        void setReadOnly(bool _bReadOnly);
         // set the statement for representation
         void setStatement(const OUString& _rsStatement);
         OUString getStatement();
diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx
index c37f481..710c755 100644
--- a/dbaccess/source/ui/inc/TableWindowAccess.hxx
+++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx
@@ -43,11 +43,6 @@ namespace dbaui
         */
         virtual void SAL_CALL disposing() SAL_OVERRIDE;
 
-        /** isEditable returns the current editable state
-            @return true if it is editable otherwise false
-        */
-        bool isEditable() const;
-
         virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE;
     public:
         OTableWindowAccess( OTableWindow* _pTable);
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index 0ea77ec..d089f29 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -105,12 +105,6 @@ namespace dbaui
         return this;
     }
     // XAccessibleComponent
-    bool SAL_CALL OConnectionLineAccess::contains( const awt::Point& _aPoint ) throw (RuntimeException)
-    {
-        ::osl::MutexGuard aGuard( m_aMutex  );
-        Point aPoint(_aPoint.X,_aPoint.Y);
-        return m_pLine ? m_pLine->CheckHit(aPoint) : sal_False;
-    }
     Reference< XAccessible > SAL_CALL OConnectionLineAccess::getAccessibleAtPoint( const awt::Point& /*_aPoint*/ ) throw (RuntimeException, std::exception)
     {
         return Reference< XAccessible >();
@@ -139,11 +133,6 @@ namespace dbaui
         Size aSize(m_pLine ? m_pLine->GetBoundingRect().GetSize() : Size());
         return awt::Size(aSize.Width(),aSize.Height());
     }
-    bool SAL_CALL OConnectionLineAccess::isShowing(  ) throw (RuntimeException)
-    {
-        ::osl::MutexGuard aGuard( m_aMutex  );
-        return m_pLine ? m_pLine->GetParent()->GetWindowRegionPixel().IsInside(m_pLine->GetBoundingRect()) : sal_False;
-    }
     // XAccessibleRelationSet
     sal_Int32 SAL_CALL OConnectionLineAccess::getRelationCount(  ) throw (RuntimeException, std::exception)
     {
@@ -183,11 +172,6 @@ namespace dbaui
         // clear vector
         clearLineData();
     }
-    bool OConnectionLineAccess::isEditable() const
-    {
-
-        return m_pLine ? !m_pLine->GetParent()->getDesignView()->getController().isReadOnly() : sal_False;
-    }
     Reference< XAccessibleContext > SAL_CALL OConnectionLineAccess::getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     {
         return this;
diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx
index 717128e..9e942be 100644
--- a/dbaccess/source/ui/querydesign/JAccess.cxx
+++ b/dbaccess/source/ui/querydesign/JAccess.cxx
@@ -83,10 +83,6 @@ namespace dbaui
             throw IndexOutOfBoundsException();
         return aRet;
     }
-    bool OJoinDesignViewAccess::isEditable() const
-    {
-        return m_pTableView && !m_pTableView->getDesignView()->getController().isReadOnly();
-    }
     sal_Int16 SAL_CALL OJoinDesignViewAccess::getAccessibleRole(  ) throw (RuntimeException, std::exception)
     {
         return AccessibleRole::VIEW_PORT;
diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index 162eb9b..107daa9 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -73,11 +73,6 @@ OUString OQueryTextView::getStatement()
     return m_pEdit->GetText();
 }
 
-void OQueryTextView::setReadOnly(bool _bReadOnly)
-{
-    m_pEdit->SetReadOnly(_bReadOnly);
-}
-
 void OQueryTextView::clear()
 {
     OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( m_pEdit );
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index 433e008..b91e32e 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -229,10 +229,6 @@ namespace dbaui
         }
         return AccessibleRelation();
     }
-    bool OTableWindowAccess::isEditable() const
-    {
-        return m_pTable && !m_pTable->getTableView()->getDesignView()->getController().isReadOnly();
-    }
     OUString SAL_CALL OTableWindowAccess::getTitledBorderText(  ) throw (RuntimeException, std::exception)
     {
         return getAccessibleName(  );
diff --git a/unusedcode.easy b/unusedcode.easy
index 31e3636..6a30cfc 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -176,13 +176,7 @@ connectivity::sdbcx::OGroup::OGroup(bool)
 connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, bool)
 dbaccess::OBookmarkContainer::dispose()
 dbaccess::StorageInputStream::close()
-dbaui::OConnectionLineAccess::contains(com::sun::star::awt::Point const&)
-dbaui::OConnectionLineAccess::isEditable() const
-dbaui::OConnectionLineAccess::isShowing()
-dbaui::OJoinDesignViewAccess::isEditable() const
-dbaui::OQueryViewSwitch::setReadOnly(bool)
 dbaui::OTableRowView::SetUpdatable(bool)
-dbaui::OTableWindowAccess::isEditable() const
 dp_registry::backend::RegisteredDb::getEntry(rtl::OUString const&)
 oglcanvas::CanvasHelper::drawPoint(com::sun::star::rendering::XCanvas const*, com::sun::star::geometry::RealPoint2D const&, com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&)
 oglcanvas::TextLayout::draw(com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&, com::sun::star::uno::Reference<com::sun::star::rendering::XGraphicDevice> const&) const
commit 50594356dc3073eafa650c529498b9ae3be351b8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 13 09:21:29 2015 +0100

    findunusedcode make -> make check
    
    Change-Id: I6fb82e4587df3c7f457c2a9b5b7643ba288662d3

diff --git a/bin/findunusedcode b/bin/findunusedcode
index 74dc466..042bb0b 100755
--- a/bin/findunusedcode
+++ b/bin/findunusedcode
@@ -37,7 +37,7 @@ export AR="callarchive ${AR:-ar}"
 
 export dbglevel=2
 
-make clean && make
+make clean && make check
 
 callanalyse \
   instdir/program/* \


More information about the Libreoffice-commits mailing list