diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-03-29 11:23:36 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-03-29 11:23:36 +0000 |
commit | b01fb08a46804401d8dfc5278bed73cd6f848d90 (patch) | |
tree | bc2affc329fa75b7f2eb8daf3339088243fcbedc /forms/qa/integration | |
parent | 0ff3b6ea1c4663e6007b83d27145e9e19f7ecb4e (diff) |
INTEGRATION: CWS dba203a (1.2.204); FILE MERGED
2006/02/22 15:22:03 fs 1.2.204.1: in the course of #i62418#: check boxes and radio buttons exchange their validatable value as boolean, if no external binding is set
Diffstat (limited to 'forms/qa/integration')
-rw-r--r-- | forms/qa/integration/forms/BooleanValidator.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/forms/qa/integration/forms/BooleanValidator.java b/forms/qa/integration/forms/BooleanValidator.java index 05d3bc41e52d..ac67eb442084 100644 --- a/forms/qa/integration/forms/BooleanValidator.java +++ b/forms/qa/integration/forms/BooleanValidator.java @@ -12,22 +12,24 @@ package integration.forms; */ public class BooleanValidator extends integration.forms.ControlValidator { - private boolean m_preventChecked; + private boolean m_preventChecked; + private com.sun.star.uno.AnyConverter m_converter; /** Creates a new instance of BooleanValidator */ public BooleanValidator( boolean preventChecked ) { m_preventChecked = preventChecked; + m_converter = new com.sun.star.uno.AnyConverter(); } public String explainInvalid( Object Value ) { try { - short value = ((Short)Value).shortValue(); - if ( value == 2 ) + if ( m_converter.isVoid( Value ) ) return "'indetermined' is not an allowed state"; - if ( m_preventChecked && ( value == 1 ) ) + boolean value = ((Boolean)Value).booleanValue(); + if ( m_preventChecked && ( value == true ) ) return "no no no. Don't check it."; } catch( java.lang.Exception e ) @@ -41,10 +43,11 @@ public class BooleanValidator extends integration.forms.ControlValidator { try { - short value = ((Short)Value).shortValue(); - if ( value == 2 ) + if ( m_converter.isVoid( Value ) ) return false; - if ( m_preventChecked && ( value == 1 ) ) + + boolean value = ((Boolean)Value).booleanValue(); + if ( m_preventChecked && ( value == true ) ) return false; return true; } |