diff options
Diffstat (limited to 'reportdesign/source/core/sdr/RptObject.cxx')
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index dd142d48826a..699a755e8902 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); |