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_UnoControlFormattedFieldModel" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8'  Licensed to the Apache Software Foundation (ASF) under one
9'  or more contributor license agreements.  See the NOTICE file
10'  distributed with this work for additional information
11'  regarding copyright ownership.  The ASF licenses this file
12'  to you under the Apache License, Version 2.0 (the
13'  "License"); you may not use this file except in compliance
14'  with the License.  You may obtain a copy of the License at
15'
16'    http://www.apache.org/licenses/LICENSE-2.0
17'
18'  Unless required by applicable law or agreed to in writing,
19'  software distributed under the License is distributed on an
20'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21'  KIND, either express or implied.  See the License for the
22'  specific language governing permissions and limitations
23'  under the License.
24'
25'*************************************************************************
26
27
28
29
30
31
32
33Sub RunTest()
34
35'*************************************************************************
36' SERVICE:
37' com.sun.star.awt.UnoControlFormattedFieldModel
38'*************************************************************************
39On Error Goto ErrHndl
40    Dim bOK As Boolean
41    Dim newVal, oldVal As Long
42
43    PropertyTester.TestProperty("Align")
44
45    PropertyTester.TestProperty("BackgroundColor")
46
47    PropertyTester.TestProperty("Border")
48
49    PropertyTester.TestProperty("EffectiveDefault")
50
51    Test.StartMethod("EffectiveValue")
52    bOK = true
53    oldVal = oObj.EffectiveValue
54    Out.Log("value before: "+oldVal)
55    if (oldVal &lt;&gt; 9999) then
56        oObj.EffectiveValue = 9999
57    else
58        oObj.EffectiveValue = 10000
59    endif
60    newVal = oObj.EffectiveValue
61    Out.Log("value after: "+newVal)
62    bOK = bOK AND (newVal &lt;&gt; oldVal)
63    Test.MethodTested("EffectiveValue",bOK)
64
65    Test.StartMethod("EffectiveMax")
66    bOK = true
67    oldVal = oObj.EffectiveMax
68    Out.Log("value before: "+oldVal)
69    if (oldVal &lt;&gt; 100000) then
70        oObj.EffectiveMax = 100000
71    else
72        oObj.EffectiveMax = 100001
73    endif
74    newVal = oObj.EffectiveMax
75    Out.Log("value after: "+newVal)
76    bOK = bOK AND (newVal &lt;&gt; oldVal)
77    Test.MethodTested("EffectiveMax",bOK)
78
79    Test.StartMethod("EffectiveMin")
80    bOK = true
81    oldVal = oObj.EffectiveMin
82    Out.Log("value before: "+oldVal)
83    if (oldVal &lt;&gt; -100000) then
84        oObj.EffectiveMin = -100000
85    else
86        oObj.EffectiveMin = -100001
87    endif
88    newVal = oObj.EffectiveMin
89    Out.Log("value after: "+newVal)
90    bOK = bOK AND (newVal &lt;&gt; oldVal)
91    Test.MethodTested("EffectiveMin",bOK)
92
93
94    PropertyTester.TestProperty("Enabled")
95
96    PropertyTester.TestProperty("FontDescriptor")
97
98    PropertyTester.TestProperty("FormatKey")
99
100    PropertyTester.TestProperty("FormatsSupplier")
101
102    PropertyTester.TestProperty("MaxTextLen")
103
104    PropertyTester.TestProperty("Printable")
105
106    PropertyTester.TestProperty("ReadOnly")
107
108    PropertyTester.TestProperty("Spin")
109
110    PropertyTester.TestProperty("StrictFormat")
111
112    PropertyTester.TestProperty("Tabstop")
113
114    PropertyTester.TestProperty("Text")
115
116    PropertyTester.TestProperty("TextColor")
117
118    PropertyTester.TestProperty("HelpText")
119
120    PropertyTester.TestProperty("HelpURL")
121
122    PropertyTester.TestProperty("FontEmphasisMark")
123
124    PropertyTester.TestProperty("FontRelief")
125
126    PropertyTester.TestProperty("TextLineColor")
127
128    PropertyTester.TestProperty("TreatAsNumber")
129
130Exit Sub
131ErrHndl:
132    Test.Exception()
133    bOK = false
134    resume next
135End Sub
136</script:module>
137