[Libreoffice-commits] core.git: 2 commits - editeng/source sd/source

Caolán McNamara caolanm at redhat.com
Tue Jan 20 07:17:59 PST 2015


 editeng/source/editeng/impedit3.cxx |    3 ++-
 sd/source/ui/view/outlview.cxx      |    7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 26bd210ccd6033cf5d06a2de35047757d8f7a6e7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 20 15:14:58 2015 +0000

    Related: ooo#34420-1.sxi concealed divide by zero
    
    on this and about 30 other documents where the NaN result is cast back to a
    long, giving rise to an assert in vcl/source/outdev/map.cxx:391 of
    
    long int ImplLogicToPixel(long int, long int, long int, long int, long int):
    Assertion `std::abs(n) < std::numeric_limits<long>::max() / nMapNum / nDPI'
    failed.
    
    Change-Id: Ia87e4ee6bbf0f10b7eba513e9a5ba3c42440d181

diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index c7e1508..4840296 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1723,8 +1723,11 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
             Size aOutSize( 2000, nBulletHeight );
 
             const float fImageHeight = ((float)aOutSize.Height() * (float)4) / (float)7;
-            const float fImageRatio  = (float)aImageSize.Height() / (float)aImageSize.Width();
-            aImageSize.Width() = (long)( fImageRatio * fImageHeight );
+            if (aImageSize.Width() != 0)
+            {
+                const float fImageRatio  = (float)aImageSize.Height() / (float)aImageSize.Width();
+                aImageSize.Width() = (long)( fImageRatio * fImageHeight );
+            }
             aImageSize.Height() = (long)( fImageHeight );
 
             Point aImagePos( pInfo->mrStartPos );
commit ca36f09c7168bd5dd59118c1a8bccac7c826bde0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 20 14:14:34 2015 +0000

    textranges are always in pairs
    
    Change-Id: I3d98c26c7902bc89ab6701dd02e266fd466c6907

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 57cedf4..d98efb5 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -841,7 +841,8 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
                 // Use the widest range ...
                 // The widest range could be a bit confusing, so normally it
                 // is the first one. Best with gaps.
-                if ( pTextRanges->size() )
+                assert(pTextRanges->size() % 2 == 0 && "textranges are always in pairs");
+                if (!pTextRanges->empty())
                 {
                     long nA = pTextRanges->at(0);
                     long nB = pTextRanges->at(1);


More information about the Libreoffice-commits mailing list