[Libreoffice-commits] core.git: 4 commits - svx/source tools/qa vcl/source

David Tardon dtardon at redhat.com
Fri Oct 17 04:56:50 PDT 2014


 svx/source/dialog/connctrl.cxx   |    2 ++
 tools/qa/cppunit/test_bigint.cxx |    2 +-
 vcl/source/control/lstbox.cxx    |    2 +-
 vcl/source/gdi/pngwrite.cxx      |    2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 0cb6cb069026f2b6a38f4eb1175bfd3e524b418f
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Oct 17 13:54:49 2014 +0200

    coverity#735655 avoid division by 0
    
    Change-Id: I5eeb4cbcaa19bdf9bcafc3830447468dd8dc5c8c

diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 9942aeb..ee8884d 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -456,7 +456,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
     else
     {
         long        nTextHeight = pDev->GetTextHeight();
-        sal_uInt16  nLines = (sal_uInt16)(aSize.Height() / nTextHeight);
+        sal_uInt16  nLines = ( nTextHeight > 0 ) ? (sal_uInt16)(aSize.Height() / nTextHeight) : 1;
         Rectangle   aClip( aPos, aSize );
 
         pDev->IntersectClipRegion( aClip );
commit ecbc1865ce0894885eaa510a2b4909832d5805fd
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Oct 17 13:44:11 2014 +0200

    coverity#1209374 avoid division by 0
    
    Change-Id: I6728c0f79e0091b88b3269f5b8b25d27c82d9761

diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 028ab02..c1a73cf 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -342,7 +342,7 @@ void PNGWriterImpl::ImplWritepHYs( const BitmapEx& rBmpEx )
     if ( rBmpEx.GetPrefMapMode() == MAP_100TH_MM )
     {
         Size aPrefSize( rBmpEx.GetPrefSize() );
-        if ( aPrefSize.Width() && aPrefSize.Height() )
+        if ( aPrefSize.Width() && aPrefSize.Height() && mnWidth && mnHeight )
         {
             ImplOpenChunk( PNGCHUNK_pHYs );
             sal_uInt8 nMapUnit = 1;
commit 1dd736540fe4582ac0d725c2dfd233b196245a5c
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Oct 17 13:38:10 2014 +0200

    correct function name
    
    Change-Id: Ibc3ab15bc830d68bf9d3d1d9ac9595d82c7fb6aa

diff --git a/tools/qa/cppunit/test_bigint.cxx b/tools/qa/cppunit/test_bigint.cxx
index 39ab250..ac75cca 100644
--- a/tools/qa/cppunit/test_bigint.cxx
+++ b/tools/qa/cppunit/test_bigint.cxx
@@ -32,7 +32,7 @@ class BigIntTest : public CppUnit::TestFixture
 {
 public:
 #if SAL_TYPES_SIZEOFLONG < SAL_TYPES_SIZEOFLONGLONG
-    void testConstructionFromInt64();
+    void testConstructionFromLongLong();
 #endif
 
     CPPUNIT_TEST_SUITE(BigIntTest);
commit 6016287fd064568ab4052932b2e6c0ee4a601bbd
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Oct 17 13:31:12 2014 +0200

    coverity#1247617 there is nothing to do if width is 0
    
    Change-Id: Iddd877d83d2a3669778282fa8aa9a63dfa850524

diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index eb4973b..efa5f39 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -113,6 +113,8 @@ void SvxXConnectionPreview::AdaptSize()
             aNewSize.Height()= (long) ( (double) nWidth / fRectWH );
         }
 
+        if (aRect.GetWidth() == 0)
+            return;
         boost::rational<sal_Int64> aFrac1( aWinSize.Width(), aRect.GetWidth() );
         boost::rational<sal_Int64> aFrac2( aWinSize.Height(), aRect.GetHeight() );
         boost::rational<sal_Int64> aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 );


More information about the Libreoffice-commits mailing list