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' Be sure that all variables are dimensioned:
37option explicit
38
39
40
41Sub RunTest()
42
43'*************************************************************************
44' INTERFACE:
45' com.sun.star.awt.XCurrencyField
46'*************************************************************************
47On Error Goto ErrHndl
48    Dim bOK As Boolean
49
50    Test.StartMethod("getValue()")
51    Dim value As Double
52    value = oObj.getValue()
53    bOK = True
54    Test.MethodTested("getValue()", bOK)
55
56    Test.StartMethod("setValue()")
57    oObj.setValue(value + 1.1)
58    bOK = oObj.getValue() = (value + 1.1)
59    Test.MethodTested("setValue()", bOK)
60
61    Test.StartMethod("getMin()")
62    Dim min As Double
63    min = oObj.getMin()
64    bOK = True
65    Test.MethodTested("getMin()", bOK)
66
67    Test.StartMethod("setMin()")
68    oObj.setMin(min + 1.1)
69    bOK = oObj.getMin() = (min + 1.1)
70    Test.MethodTested("setMin()", bOK)
71
72    Test.StartMethod("getMax()")
73    Dim max As Double
74    max = oObj.getMax()
75    bOK = True
76    Test.MethodTested("getMax()", bOK)
77
78    Test.StartMethod("setMax()")
79    oObj.setMax(max + 1.1)
80    bOK = oObj.getMax() = (max + 1.1)
81    Test.MethodTested("setMax()", bOK)
82
83    Test.StartMethod("getFirst()")
84    Dim first As Double
85    first = oObj.getFirst()
86    bOK = True
87    Test.MethodTested("getFirst()", bOK)
88
89    Test.StartMethod("setFirst()")
90    oObj.setFirst(first + 1.1)
91    bOK = oObj.getFirst() = first + 1.1
92    Test.MethodTested("setFirst()", bOK)
93
94    Test.StartMethod("getLast()")
95    Dim last As Double
96    last = oObj.getLast()
97    bOK = True
98    Test.MethodTested("getLast()", bOK)
99
100    Test.StartMethod("setLast()")
101    oObj.setLast(last + 1.1)
102    bOK = oObj.getLast() = (last + 1.1)
103    Test.MethodTested("setLast()", bOK)
104
105    Test.StartMethod("getSpinSize()")
106    Dim spinSize As Double
107    spinSize = oObj.getSpinSize()
108    bOK = True
109    Test.MethodTested("getSpinSize()", bOK)
110
111    Test.StartMethod("setSpinSize()")
112    oObj.setSpinSize(spinSize + 1.1)
113    bOK = oObj.getSpinSize() = (spinSize + 1.1)
114    Test.MethodTested("setSpinSize()", bOK)
115
116    Test.StartMethod("getDecimalDigits()")
117    Dim digits As Integer
118    digits = oObj.getDecimalDigits()
119    bOK = True
120    Test.MethodTested("getDecimalDigits()", bOK)
121
122    Test.StartMethod("setDecimalDigits()")
123    oObj.setDecimalDigits(digits + 1)
124    bOK = oObj.getDecimalDigits() = (digits + 1)
125    Test.MethodTested("setDecimalDigits()", bOK)
126
127    Test.StartMethod("isStrictFormat()")
128    Dim strict As Boolean
129    strict = oObj.isStrictFormat()
130    bOK = True
131    Test.MethodTested("isStrictFormat()", bOK)
132
133    Test.StartMethod("setStrictFormat()")
134    oObj.setStrictFormat(Not strict)
135    bOK = oObj.isStrictFormat() &lt;&gt; strict
136    Test.MethodTested("setStrictFormat()", bOK)
137
138Exit Sub
139ErrHndl:
140    Test.Exception()
141    bOK = false
142    resume next
143End Sub
144</script:module>
145