[Libreoffice-commits] .: Branch 'libreoffice-3-6' - reportdesign/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 17 02:54:30 PDT 2012


 reportdesign/source/core/sdr/RptObject.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9d270d24de55d0f962cd3394b8ebf9d3e4622dfb
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Sep 14 14:53:20 2012 +0200

    fdo#44721 protect against negative calculated height value
    
    Change-Id: I4faedd535421eaf1e3e425f4731b3bb8831e7360
    Reviewed-on: https://gerrit.libreoffice.org/622
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index dd142d4..699a755 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -410,8 +410,10 @@ void OObjectBase::SetPropsFromRect(const Rectangle& _rRect)
     if ( pPage && !_rRect.IsEmpty() )
     {
         uno::Reference<report::XSection> xSection = pPage->getSection();
-        if ( xSection.is() && (static_cast<sal_uInt32>(_rRect.getHeight() + _rRect.Top()) > xSection->getHeight()) )
-            xSection->setHeight(_rRect.getHeight() + _rRect.Top());
+        assert(_rRect.getHeight() >= 0);
+        const sal_uInt32 newHeight( ::std::max(0l, _rRect.getHeight()+_rRect.Top()) );
+        if ( xSection.is() && ( newHeight > xSection->getHeight() ) )
+            xSection->setHeight( newHeight );
 
         // TODO
         //pModel->GetRefDevice()->Invalidate(INVALIDATE_CHILDREN);


More information about the Libreoffice-commits mailing list