summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2012-11-29 16:35:14 +0100
committerAndras Timar <atimar@suse.com>2013-01-13 22:00:10 +0100
commit7061141096134a6cb5103bdf5a08d02bc0392330 (patch)
tree88b21f94fafbeb3586fcedcd9b5032a58c2cd150
parentae8a34b85f7048b9df213eea34bfb49f8de8c99f (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.hxx18
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) \
{ \