summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2012-11-29 15:53:28 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2012-11-29 21:44:28 +0100
commit1fefd633220e5d9a7b1d511e3ebac7c008d97a97 (patch)
tree570644d308962ab75fd32b860c79731eeb3aa57c
parentefd2438e824edd616075e62e948d4ed771f1251f (diff)
fdo#57611 don't crash when setting too small size
setHeight/Width needs to be authorized to throw com::sun::star::beans::PropertyVetoException, which is already handled adequately Change-Id: I077fbf7e3b871a59446fb3e23cc9fa1e2e9272a2
-rw-r--r--offapi/com/sun/star/inspection/XPropertyHandler.idl4
-rw-r--r--offapi/com/sun/star/report/XReportComponent.idl10
-rw-r--r--reportdesign/inc/ReportHelperDefines.hxx4
-rw-r--r--reportdesign/source/core/inc/ReportHelperImpl.hxx4
-rw-r--r--reportdesign/source/ui/inc/GeometryHandler.hxx2
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
6 files changed, 17 insertions, 9 deletions
diff --git a/offapi/com/sun/star/inspection/XPropertyHandler.idl b/offapi/com/sun/star/inspection/XPropertyHandler.idl
index 0c24dbe02dae..40f721068641 100644
--- a/offapi/com/sun/star/inspection/XPropertyHandler.idl
+++ b/offapi/com/sun/star/inspection/XPropertyHandler.idl
@@ -22,12 +22,13 @@
#include <com/sun/star/beans/PropertyState.idl>
#include <com/sun/star/beans/Property.idl>
#include <com/sun/star/beans/XPropertyChangeListener.idl>
#include <com/sun/star/inspection/LineDescriptor.idl>
#include <com/sun/star/lang/NullPointerException.idl>
#include <com/sun/star/beans/UnknownPropertyException.idl>
+#include <com/sun/star/beans/PropertyVetoException.idl>
#include <com/sun/star/lang/XComponent.idl>
#include <com/sun/star/inspection/InteractiveSelectionResult.idl>
module com { module sun { module star { module inspection {
interface XObjectInspectorUI;
@@ -83,13 +84,14 @@ interface XPropertyHandler
the property value to set
@throws com::sun::star::beans::UnknownPropertyException
if the given property is not supported by the property handler
*/
void
setPropertyValue( [in] string PropertyName, [in] any Value )
- raises (::com::sun::star::beans::UnknownPropertyException);
+ raises (::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::beans::PropertyVetoException);
/** returns the state of a property
@param PropertyName
the name of the property whose state is to be retrieved
@throws com::sun::star::beans::UnknownPropertyException
diff --git a/offapi/com/sun/star/report/XReportComponent.idl b/offapi/com/sun/star/report/XReportComponent.idl
index f6e9d8c5494d..148b75f0cf96 100644
--- a/offapi/com/sun/star/report/XReportComponent.idl
+++ b/offapi/com/sun/star/report/XReportComponent.idl
@@ -61,25 +61,31 @@ interface XReportComponent
{
set raises ( com::sun::star::beans::PropertyVetoException );
};
/** specifies the height of the control.
*/
- [attribute,bound] long Height;
+ [attribute,bound] long Height
+ {
+ set raises ( com::sun::star::beans::PropertyVetoException );
+ };
/** specifies the horizontal position of the control.
*/
[attribute,bound] long PositionX;
/** specifies the vertical position of the control.
*/
[attribute,bound] long PositionY;
/** specifies the width of the control.
*/
- [attribute,bound] long Width;
+ [attribute,bound] long Width
+ {
+ set raises ( com::sun::star::beans::PropertyVetoException );
+ };
/** specifies the border style of the control.
<pre>
0: No border
2: simple border
diff --git a/reportdesign/inc/ReportHelperDefines.hxx b/reportdesign/inc/ReportHelperDefines.hxx
index d0467cbfce08..a54dea39a218 100644
--- a/reportdesign/inc/ReportHelperDefines.hxx
+++ b/reportdesign/inc/ReportHelperDefines.hxx
@@ -35,19 +35,19 @@
virtual void SAL_CALL setSize(const ::com::sun::star::awt::Size & aSize) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException);
#define REPORTCOMPONENT_HEADER() \
virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException); \
virtual ::sal_Int32 SAL_CALL getHeight() throw (::com::sun::star::uno::RuntimeException); \
- virtual void SAL_CALL setHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException); \
virtual ::sal_Int32 SAL_CALL getPositionX() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setPositionX(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int32 SAL_CALL getPositionY() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setPositionY(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int32 SAL_CALL getWidth() throw (::com::sun::star::uno::RuntimeException); \
- virtual void SAL_CALL setWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException); \
virtual ::sal_Int16 SAL_CALL getControlBorder() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBorder(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int32 SAL_CALL getControlBorderColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBorderColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getPrintRepeatedValues() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setPrintRepeatedValues(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx
index 1b3bc04a7fe4..1734998d3c95 100644
--- a/reportdesign/source/core/inc/ReportHelperImpl.hxx
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -30,13 +30,13 @@ void SAL_CALL clazz::setName( const ::rtl::OUString& _name ) throw (uno::Runtime
set(PROPERTY_NAME,_name,(arg).m_sName); \
} \
::sal_Int32 SAL_CALL clazz::getHeight() throw (uno::RuntimeException) \
{ \
return getSize().Height; \
} \
-void SAL_CALL clazz::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeException) \
+void SAL_CALL clazz::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeException,beans::PropertyVetoException) \
{ \
awt::Size aSize = getSize(); \
aSize.Height = _height; \
setSize(aSize); \
} \
::sal_Int32 SAL_CALL clazz::getPositionX() throw (uno::RuntimeException) \
@@ -60,13 +60,13 @@ void SAL_CALL clazz::setPositionY( ::sal_Int32 _positiony ) throw (uno::RuntimeE
setPosition(aPos); \
} \
::sal_Int32 SAL_CALL clazz::getWidth() throw (uno::RuntimeException) \
{ \
return getSize().Width; \
} \
-void SAL_CALL clazz::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException) \
+void SAL_CALL clazz::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException,beans::PropertyVetoException) \
{ \
awt::Size aSize = getSize(); \
aSize.Width = _width; \
setSize(aSize); \
} \
uno::Reference< report::XSection > SAL_CALL clazz::getSection() throw (uno::RuntimeException) \
diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx
index 08b71ef48529..e639500ce31c 100644
--- a/reportdesign/source/ui/inc/GeometryHandler.hxx
+++ b/reportdesign/source/ui/inc/GeometryHandler.hxx
@@ -255,13 +255,13 @@ namespace rptui
virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::inspection::XPropertyHandler:
virtual void SAL_CALL inspect(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Component) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
- virtual void SAL_CALL setPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & Value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL setPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & Value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException);
virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine(const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& ControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & ControlValue) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & PropertyValue, const ::com::sun::star::uno::Type & ControlValueType) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
virtual void SAL_CALL addPropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & Listener) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException);
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index d7ea714b58d9..cfb5cbae01e2 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -466,13 +466,13 @@ uno::Any SAL_CALL GeometryHandler::getPropertyValue(const ::rtl::OUString & Prop
aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName );
break;
}
return aPropertyValue;
}
-void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException, beans::PropertyVetoException)
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
uno::Any aNewValue = Value;
const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
bool bHandled = false;
switch(nId)