summaryrefslogtreecommitdiffstats
path: root/forms
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-13 15:14:07 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-13 15:17:18 +0100
commit7ca657e5eeb883d2a90ef80456f48a7df6e27cba (patch)
tree0281b417df208f98a4f4547d9f55d887d43d3f3c /forms
parentbasebmap: 5e4a7a95027d979b3bdd729d7ebe950da1129b2b missed COM check (diff)
downloadcore-7ca657e5eeb883d2a90ef80456f48a7df6e27cba.tar.gz
core-7ca657e5eeb883d2a90ef80456f48a7df6e27cba.zip
css.form.component.{CheckBox,RadioButton} DefaultState property values
...must be in the range 0--2; avoid setting bad values from generic qadevOOo property set tests, and throw an IllegalArgumentException if bad values do get set. Change-Id: Ia4a97d0fac326b3ca2ce254946dc4d418e9dd5a7
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/refvaluecomponent.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx
index b3f4afe30590..0be4706f9d73 100644
--- a/forms/source/component/refvaluecomponent.cxx
+++ b/forms/source/component/refvaluecomponent.cxx
@@ -103,8 +103,15 @@ namespace frm
case PROPERTY_ID_DEFAULT_STATE:
{
- sal_Int16 nDefaultChecked( (sal_Int16)TRISTATE_FALSE );
- OSL_VERIFY( _rValue >>= nDefaultChecked );
+ sal_Int16 nDefaultChecked;
+ if (!(_rValue >>= nDefaultChecked) || nDefaultChecked < 0
+ || nDefaultChecked > 2)
+ {
+ throw css::lang::IllegalArgumentException(
+ ("DefaultState property value must be a SHORT in the range"
+ " 0--2"),
+ css::uno::Reference<css::uno::XInterface>(), -1);
+ }
m_eDefaultChecked = (ToggleState)nDefaultChecked;
resetNoBroadcast();
}