diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2012-11-29 16:35:14 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-12-21 16:29:52 +0100 |
commit | 6c47e7a5f80a4e6147b03a98ca886cedb860fc2a (patch) | |
tree | cf0f14282eb08d2d4588a26298e18ca4bd491090 | |
parent | 9cb32fb3ebb7ee96b9db0dc7c1b30ae863b85706 (diff) |
fdo#57611 do not crash when setting too small size
setWidth/setHeight's exception specifications are lacking,
but fixing this in a stable release line is too invasive:
they are "inherited" from the specification in
offapi/com/sun/star/report/XReportComponent.idl
and are thus part of our public API.
Change-Id: I8ae2048a6c0acc6b6cf2beece9e630c87caac39f
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | reportdesign/source/core/inc/ReportHelperImpl.hxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx index 1b5f7d2e78a0..6325f8f79ad1 100644 --- a/reportdesign/source/core/inc/ReportHelperImpl.hxx +++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx @@ -46,7 +46,14 @@ void SAL_CALL clazz::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeExcepti { \ awt::Size aSize = getSize(); \ aSize.Height = _height; \ - setSize(aSize); \ + try \ + { \ + setSize(aSize); \ + } \ + catch (const beans::PropertyVetoException &) \ + { \ + throw uno::RuntimeException("Unacceptable height", static_cast<cppu::OWeakObject*>(this)); \ + } \ } \ ::sal_Int32 SAL_CALL clazz::getPositionX() throw (uno::RuntimeException) \ { \ @@ -76,7 +83,14 @@ void SAL_CALL clazz::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException { \ awt::Size aSize = getSize(); \ aSize.Width = _width; \ - setSize(aSize); \ + try \ + { \ + setSize(aSize); \ + } \ + catch (const beans::PropertyVetoException &) \ + { \ + throw uno::RuntimeException("Unacceptable width", static_cast<cppu::OWeakObject*>(this)); \ + } \ } \ uno::Reference< report::XSection > SAL_CALL clazz::getSection() throw (uno::RuntimeException) \ { \ |