1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XCurrencyField" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9'
10' Copyright 2000, 2010 Oracle and/or its affiliates.
11'
12' OpenOffice.org - a multi-platform office productivity suite
13'
14' This file is part of OpenOffice.org.
15'
16' OpenOffice.org is free software: you can redistribute it and/or modify
17' it under the terms of the GNU Lesser General Public License version 3
18' only, as published by the Free Software Foundation.
19'
20' OpenOffice.org is distributed in the hope that it will be useful,
21' but WITHOUT ANY WARRANTY; without even the implied warranty of
22' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23' GNU Lesser General Public License version 3 for more details
24' (a copy is included in the LICENSE file that accompanied this code).
25'
26' You should have received a copy of the GNU Lesser General Public License
27' version 3 along with OpenOffice.org.  If not, see
28' <http://www.openoffice.org/license.html>
29' for a copy of the LGPLv3 License.
30'
31'*************************************************************************
32*****
33'*************************************************************************
34
35
36
37' Be sure that all variables are dimensioned:
38option explicit
39
40
41
42Sub RunTest()
43
44'*************************************************************************
45' INTERFACE:
46' com.sun.star.awt.XCurrencyField
47'*************************************************************************
48On Error Goto ErrHndl
49    Dim bOK As Boolean
50
51    Test.StartMethod("getValue()")
52    Dim value As Double
53    value = oObj.getValue()
54    bOK = True
55    Test.MethodTested("getValue()", bOK)
56
57    Test.StartMethod("setValue()")
58    oObj.setValue(value + 1.1)
59    bOK = oObj.getValue() = (value + 1.1)
60    Test.MethodTested("setValue()", bOK)
61
62    Test.StartMethod("getMin()")
63    Dim min As Double
64    min = oObj.getMin()
65    bOK = True
66    Test.MethodTested("getMin()", bOK)
67
68    Test.StartMethod("setMin()")
69    oObj.setMin(min + 1.1)
70    bOK = oObj.getMin() = (min + 1.1)
71    Test.MethodTested("setMin()", bOK)
72
73    Test.StartMethod("getMax()")
74    Dim max As Double
75    max = oObj.getMax()
76    bOK = True
77    Test.MethodTested("getMax()", bOK)
78
79    Test.StartMethod("setMax()")
80    oObj.setMax(max + 1.1)
81    bOK = oObj.getMax() = (max + 1.1)
82    Test.MethodTested("setMax()", bOK)
83
84    Test.StartMethod("getFirst()")
85    Dim first As Double
86    first = oObj.getFirst()
87    bOK = True
88    Test.MethodTested("getFirst()", bOK)
89
90    Test.StartMethod("setFirst()")
91    oObj.setFirst(first + 1.1)
92    bOK = oObj.getFirst() = first + 1.1
93    Test.MethodTested("setFirst()", bOK)
94
95    Test.StartMethod("getLast()")
96    Dim last As Double
97    last = oObj.getLast()
98    bOK = True
99    Test.MethodTested("getLast()", bOK)
100
101    Test.StartMethod("setLast()")
102    oObj.setLast(last + 1.1)
103    bOK = oObj.getLast() = (last + 1.1)
104    Test.MethodTested("setLast()", bOK)
105
106    Test.StartMethod("getSpinSize()")
107    Dim spinSize As Double
108    spinSize = oObj.getSpinSize()
109    bOK = True
110    Test.MethodTested("getSpinSize()", bOK)
111
112    Test.StartMethod("setSpinSize()")
113    oObj.setSpinSize(spinSize + 1.1)
114    bOK = oObj.getSpinSize() = (spinSize + 1.1)
115    Test.MethodTested("setSpinSize()", bOK)
116
117    Test.StartMethod("getDecimalDigits()")
118    Dim digits As Integer
119    digits = oObj.getDecimalDigits()
120    bOK = True
121    Test.MethodTested("getDecimalDigits()", bOK)
122
123    Test.StartMethod("setDecimalDigits()")
124    oObj.setDecimalDigits(digits + 1)
125    bOK = oObj.getDecimalDigits() = (digits + 1)
126    Test.MethodTested("setDecimalDigits()", bOK)
127
128    Test.StartMethod("isStrictFormat()")
129    Dim strict As Boolean
130    strict = oObj.isStrictFormat()
131    bOK = True
132    Test.MethodTested("isStrictFormat()", bOK)
133
134    Test.StartMethod("setStrictFormat()")
135    oObj.setStrictFormat(Not strict)
136    bOK = oObj.isStrictFormat() &lt;&gt; strict
137    Test.MethodTested("setStrictFormat()", bOK)
138
139Exit Sub
140ErrHndl:
141    Test.Exception()
142    bOK = false
143    resume next
144End Sub
145</script:module>
146