1*b1cdbd2cSJim Jagielski<?xml version="1.0" encoding="UTF-8"?>
2*b1cdbd2cSJim Jagielski<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3*b1cdbd2cSJim Jagielski<script:module xmlns:script="http://openoffice.org/2000/script" script:name="beans_XPropertySet" script:language="StarBasic">
4*b1cdbd2cSJim Jagielski
5*b1cdbd2cSJim Jagielski
6*b1cdbd2cSJim Jagielski'*************************************************************************
7*b1cdbd2cSJim Jagielski'
8*b1cdbd2cSJim Jagielski'  Licensed to the Apache Software Foundation (ASF) under one
9*b1cdbd2cSJim Jagielski'  or more contributor license agreements.  See the NOTICE file
10*b1cdbd2cSJim Jagielski'  distributed with this work for additional information
11*b1cdbd2cSJim Jagielski'  regarding copyright ownership.  The ASF licenses this file
12*b1cdbd2cSJim Jagielski'  to you under the Apache License, Version 2.0 (the
13*b1cdbd2cSJim Jagielski'  "License"); you may not use this file except in compliance
14*b1cdbd2cSJim Jagielski'  with the License.  You may obtain a copy of the License at
15*b1cdbd2cSJim Jagielski'
16*b1cdbd2cSJim Jagielski'    http://www.apache.org/licenses/LICENSE-2.0
17*b1cdbd2cSJim Jagielski'
18*b1cdbd2cSJim Jagielski'  Unless required by applicable law or agreed to in writing,
19*b1cdbd2cSJim Jagielski'  software distributed under the License is distributed on an
20*b1cdbd2cSJim Jagielski'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21*b1cdbd2cSJim Jagielski'  KIND, either express or implied.  See the License for the
22*b1cdbd2cSJim Jagielski'  specific language governing permissions and limitations
23*b1cdbd2cSJim Jagielski'  under the License.
24*b1cdbd2cSJim Jagielski'
25*b1cdbd2cSJim Jagielski'*************************************************************************
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski
28*b1cdbd2cSJim Jagielski
29*b1cdbd2cSJim Jagielski
30*b1cdbd2cSJim Jagielski
31*b1cdbd2cSJim Jagielski'*************************************************************************
32*b1cdbd2cSJim Jagielski'Change-Listener needs bound-Properties
33*b1cdbd2cSJim Jagielski'Veto-Listener needs constrained-Propperties
34*b1cdbd2cSJim Jagielski
35*b1cdbd2cSJim Jagielski'*************************************************************************
36*b1cdbd2cSJim Jagielski
37*b1cdbd2cSJim Jagielski
38*b1cdbd2cSJim Jagielski
39*b1cdbd2cSJim Jagielski
40*b1cdbd2cSJim JagielskiConst BOUND = 2
41*b1cdbd2cSJim JagielskiConst CONSTRAINED = 4
42*b1cdbd2cSJim JagielskiConst MAYBENULL = 8
43*b1cdbd2cSJim JagielskiConst READONLY = 16
44*b1cdbd2cSJim Jagielski
45*b1cdbd2cSJim JagielskiDim aBoundProps() As String
46*b1cdbd2cSJim JagielskiDim aConstrainedProps() As String
47*b1cdbd2cSJim JagielskiDim aNormalProps() As String
48*b1cdbd2cSJim JagielskiDim aReadOnlyProps() As String
49*b1cdbd2cSJim Jagielski
50*b1cdbd2cSJim JagielskiDim nBoundCount As Integer
51*b1cdbd2cSJim JagielskiDim nConstrainedCount As Integer
52*b1cdbd2cSJim JagielskiDim nNormalCount As Integer
53*b1cdbd2cSJim JagielskiDim nReadOnlyCount As Integer
54*b1cdbd2cSJim Jagielski
55*b1cdbd2cSJim JagielskiDim aAllProps As Object
56*b1cdbd2cSJim Jagielski
57*b1cdbd2cSJim JagielskiDim vetoCalled1 As Boolean
58*b1cdbd2cSJim JagielskiDim propCalled1 As Boolean
59*b1cdbd2cSJim JagielskiDim vetoCalled2 As Boolean
60*b1cdbd2cSJim JagielskiDim propCalled2 As Boolean
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski
63*b1cdbd2cSJim JagielskiSub RunTest()
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski'*************************************************************************
66*b1cdbd2cSJim Jagielski' INTERFACE:
67*b1cdbd2cSJim Jagielski' com.sun.star.beans.XPropertySet
68*b1cdbd2cSJim Jagielski'*************************************************************************
69*b1cdbd2cSJim JagielskiOn Error Goto ErrHndl
70*b1cdbd2cSJim JagielskiIf (bErrHndl) Then On Error Goto ErrHndl
71*b1cdbd2cSJim Jagielski    Dim oPCListener1 As Object
72*b1cdbd2cSJim Jagielski    Dim oVListener1 As Object
73*b1cdbd2cSJim Jagielski    Dim oPCListener2 As Object
74*b1cdbd2cSJim Jagielski    Dim oVListener2 As Object
75*b1cdbd2cSJim Jagielski    Dim bOK As boolean
76*b1cdbd2cSJim Jagielski
77*b1cdbd2cSJim Jagielski    Test.StartMethod("getPropertySetInfo()")
78*b1cdbd2cSJim Jagielski    bOK = true
79*b1cdbd2cSJim Jagielski    bOK = NOT isNULL(oObj.PropertySetInfo)
80*b1cdbd2cSJim Jagielski    Test.MethodTested("getPropertySetInfo()", bOK)
81*b1cdbd2cSJim Jagielski
82*b1cdbd2cSJim Jagielski    Out.Log("Get properties()")
83*b1cdbd2cSJim Jagielski    bOK = GetProps()
84*b1cdbd2cSJim Jagielski
85*b1cdbd2cSJim Jagielski    Out.Log("Create Listeners")
86*b1cdbd2cSJim Jagielski    oPCListener1 = createUNOListener("CB1_","com.sun.star.beans.XPropertyChangeListener")
87*b1cdbd2cSJim Jagielski    oVListener1 = createUNOListener("CB1_","com.sun.star.beans.XVetoableChangeListener")
88*b1cdbd2cSJim Jagielski    oPCListener2 = createUNOListener("CB2_","com.sun.star.beans.XPropertyChangeListener")
89*b1cdbd2cSJim Jagielski    oVListener2 = createUNOListener("CB2_","com.sun.star.beans.XVetoableChangeListener")
90*b1cdbd2cSJim Jagielski
91*b1cdbd2cSJim Jagielski    Test.StartMethod("getPropertyValue()")
92*b1cdbd2cSJim Jagielski    bOK = true
93*b1cdbd2cSJim Jagielski    bOK = bOK AND test_getPropertyValue()
94*b1cdbd2cSJim Jagielski    Test.MethodTested("getPropertyValue()", bOK)
95*b1cdbd2cSJim Jagielski
96*b1cdbd2cSJim Jagielski    Test.StartMethod("setPropertyValue()")
97*b1cdbd2cSJim Jagielski    bOK = true
98*b1cdbd2cSJim Jagielski    Dim bReadOnlyOK As Boolean
99*b1cdbd2cSJim Jagielski    Dim bNormalOK As Boolean
100*b1cdbd2cSJim Jagielski    bReadOnlyOK = false
101*b1cdbd2cSJim Jagielski    bNormalOK = false
102*b1cdbd2cSJim Jagielski    Dim bCVOK As boolean
103*b1cdbd2cSJim Jagielski
104*b1cdbd2cSJim Jagielski    if (nReadOnlyCount = 0) then
105*b1cdbd2cSJim Jagielski        bReadOnlyOK = true
106*b1cdbd2cSJim Jagielski        Out.Log("No ReadOnly properties!")
107*b1cdbd2cSJim Jagielski    else
108*b1cdbd2cSJim Jagielski        for i = 0 to nReadOnlyCount - 1
109*b1cdbd2cSJim Jagielski            Out.Log("READONLY: '" &amp; aReadOnlyProps(i) &amp; "'")
110*b1cdbd2cSJim Jagielski            if (aReadOnlyProps(i) = "Preview") then
111*b1cdbd2cSJim Jagielski                bCVOK = true
112*b1cdbd2cSJim Jagielski            else
113*b1cdbd2cSJim Jagielski                bCVOK = PropertyTester.TestPropertyWithoutParams(aReadOnlyProps(i), true)
114*b1cdbd2cSJim Jagielski            end if
115*b1cdbd2cSJim Jagielski            Out.Log(bCVOK)
116*b1cdbd2cSJim Jagielski            Out.Log("")
117*b1cdbd2cSJim Jagielski            bReadOnlyOK = bReadOnlyOK OR bCVOK
118*b1cdbd2cSJim Jagielski        next i
119*b1cdbd2cSJim Jagielski    end if
120*b1cdbd2cSJim Jagielski
121*b1cdbd2cSJim Jagielski    bOK = bOK AND bReadOnlyOK
122*b1cdbd2cSJim Jagielski
123*b1cdbd2cSJim Jagielski    if (nNormalCount = 0) then
124*b1cdbd2cSJim Jagielski        bNormalOK = true
125*b1cdbd2cSJim Jagielski        Out.Log("No Normal properties!")
126*b1cdbd2cSJim Jagielski    else
127*b1cdbd2cSJim Jagielski        for i = 0 to nNormalCount - 1
128*b1cdbd2cSJim Jagielski            Out.Log("NORMAL: '" &amp; aNormalProps(i) &amp; "'")
129*b1cdbd2cSJim Jagielski            bCVOK = PropertyTester.TestPropertyWithoutParams(aNormalProps(i), false)
130*b1cdbd2cSJim Jagielski            Out.Log(bCVOK)
131*b1cdbd2cSJim Jagielski            Out.Log("")
132*b1cdbd2cSJim Jagielski            bNormalOK = bNormalOK OR bCVOK
133*b1cdbd2cSJim Jagielski        next i
134*b1cdbd2cSJim Jagielski    end if
135*b1cdbd2cSJim Jagielski
136*b1cdbd2cSJim Jagielski    bOK = bOK AND bNormalOK
137*b1cdbd2cSJim Jagielski
138*b1cdbd2cSJim Jagielski    Test.MethodTested("setPropertyValue()", bOK)
139*b1cdbd2cSJim Jagielski
140*b1cdbd2cSJim Jagielski    Test.StartMethod("addVetoableChangeListener()")
141*b1cdbd2cSJim Jagielski    Test.StartMethod("removeVetoableChangeListener()")
142*b1cdbd2cSJim Jagielski    Dim bAddVeto As Boolean
143*b1cdbd2cSJim Jagielski    Dim bRmvVeto As Boolean
144*b1cdbd2cSJim Jagielski    bRmvVeto = true
145*b1cdbd2cSJim Jagielski    bAddVeto = true
146*b1cdbd2cSJim Jagielski
147*b1cdbd2cSJim Jagielski    if (nConstrainedCount = 0) then
148*b1cdbd2cSJim Jagielski        Out.Log("No Constrained properties!")
149*b1cdbd2cSJim Jagielski        bAddVeto = true
150*b1cdbd2cSJim Jagielski        bRmvVeto = true
151*b1cdbd2cSJim Jagielski    else
152*b1cdbd2cSJim Jagielski        for i = 0 to nConstrainedCount - 1
153*b1cdbd2cSJim Jagielski            vetoCalled1 = false
154*b1cdbd2cSJim Jagielski            vetoCalled2 = false
155*b1cdbd2cSJim Jagielski            oObj.addVetoableChangeListener(aConstrainedProps(i), oVListener1)
156*b1cdbd2cSJim Jagielski            oObj.addVetoableChangeListener(aConstrainedProps(i), oVListener2)
157*b1cdbd2cSJim Jagielski            PropertyTester.TestPropertyWithoutParams(aConstrainedProps(i), false)
158*b1cdbd2cSJim Jagielski            bAddVeto = bAddVeto OR (vetoCalled1 AND vetoCalled2)
159*b1cdbd2cSJim Jagielski            Out.Log("addVetoableChangeListener: " &amp; aConstrainedProps(i) &amp; " Listener1 must be called: " &amp; vetoCalled1)
160*b1cdbd2cSJim Jagielski            Out.Log("addVetoableChangeListener: " &amp; aConstrainedProps(i) &amp; " Listener2 must be called: " &amp; vetoCalled2)
161*b1cdbd2cSJim Jagielski
162*b1cdbd2cSJim Jagielski            vetoCalled1 = false
163*b1cdbd2cSJim Jagielski            vetoCalled2 = false
164*b1cdbd2cSJim Jagielski            oObj.removeVetoableChangeListener(aConstrainedProps(i), oVListener1)
165*b1cdbd2cSJim Jagielski            PropertyTester.TestPropertyWithoutParams(aConstrainedProps(i), false)
166*b1cdbd2cSJim Jagielski            bRmvVeto = bRmvVeto OR (NOT vetoCalled1 AND vetoCalled2)
167*b1cdbd2cSJim Jagielski            Out.Log("removeVetoableChangeListener: " &amp; aConstrainedProps(i) &amp; " Listener1 must not be called: " &amp; NOT vetoCalled1)
168*b1cdbd2cSJim Jagielski            Out.Log("removeVetoableChangeListener: " &amp; aConstrainedProps(i) &amp; " Listener2 must not be called: " &amp; NOT vetoCalled2)
169*b1cdbd2cSJim Jagielski            oObj.removeVetoableChangeListener(aConstrainedProps(i), oVListener2)
170*b1cdbd2cSJim Jagielski        next i
171*b1cdbd2cSJim Jagielski    end if
172*b1cdbd2cSJim Jagielski    Test.MethodTested("addVetoableChangeListener()", bAddVeto)
173*b1cdbd2cSJim Jagielski    Test.MethodTested("removeVetoableChangeListener()", bRmvVeto)
174*b1cdbd2cSJim Jagielski
175*b1cdbd2cSJim Jagielski    Test.StartMethod("addPropertyChangeListener()")
176*b1cdbd2cSJim Jagielski    Test.StartMethod("removePropertyChangeListener()")
177*b1cdbd2cSJim Jagielski    Dim bAddProp As Boolean
178*b1cdbd2cSJim Jagielski    Dim bRmvProp As Boolean
179*b1cdbd2cSJim Jagielski    bRmvProp = true
180*b1cdbd2cSJim Jagielski    bAddProp = true
181*b1cdbd2cSJim Jagielski
182*b1cdbd2cSJim Jagielski    if (nBoundCount = 0) then
183*b1cdbd2cSJim Jagielski        Out.Log("No Bound properties!")
184*b1cdbd2cSJim Jagielski        bAddProp = true
185*b1cdbd2cSJim Jagielski        bRmvProp = true
186*b1cdbd2cSJim Jagielski    else
187*b1cdbd2cSJim Jagielski        for i = 0 to nBoundCount - 1
188*b1cdbd2cSJim Jagielski            propCalled1 = false
189*b1cdbd2cSJim Jagielski            propCalled2 = false
190*b1cdbd2cSJim Jagielski            oObj.addPropertyChangeListener(aBoundProps(i), oPCListener1)
191*b1cdbd2cSJim Jagielski            oObj.addPropertyChangeListener(aBoundProps(i), oPCListener2)
192*b1cdbd2cSJim Jagielski            PropertyTester.TestPropertyWithoutParams(aBoundProps(i), false)
193*b1cdbd2cSJim Jagielski            bAddProp = bAddProp OR (propCalled1 AND propCalled2)
194*b1cdbd2cSJim Jagielski            Out.Log("addPropertyChangeListener: " &amp; aBoundProps(i) &amp; " Listener1 must be called :" &amp; propCalled1)
195*b1cdbd2cSJim Jagielski            Out.Log("addPropertyChangeListener: " &amp; aBoundProps(i) &amp; " Listener2 must be called :" &amp; propCalled2)
196*b1cdbd2cSJim Jagielski
197*b1cdbd2cSJim Jagielski            propCalled1 = false
198*b1cdbd2cSJim Jagielski            propCalled2 = false
199*b1cdbd2cSJim Jagielski            oObj.removePropertyChangeListener(aBoundProps(i), oPCListener1)
200*b1cdbd2cSJim Jagielski            PropertyTester.TestPropertyWithoutParams(aBoundProps(i), false)
201*b1cdbd2cSJim Jagielski            bRmvProp = bRmvProp OR (NOT propCalled1 AND propCalled2)
202*b1cdbd2cSJim Jagielski            Out.Log("removePropertyChangeListener: " &amp; aBoundProps(i) &amp; " Listener must not be called: " &amp; NOT propCalled)
203*b1cdbd2cSJim Jagielski            oObj.removePropertyChangeListener(aBoundProps(i), oPCListener2)
204*b1cdbd2cSJim Jagielski        next i
205*b1cdbd2cSJim Jagielski    end if
206*b1cdbd2cSJim Jagielski
207*b1cdbd2cSJim Jagielski    Test.MethodTested("addPropertyChangeListener()", bAddProp)
208*b1cdbd2cSJim Jagielski    Test.MethodTested("removePropertyChangeListener()", bRmvProp)
209*b1cdbd2cSJim Jagielski
210*b1cdbd2cSJim Jagielski    ReCreateObj()
211*b1cdbd2cSJim Jagielski
212*b1cdbd2cSJim JagielskiExit Sub
213*b1cdbd2cSJim JagielskiErrHndl:
214*b1cdbd2cSJim Jagielski    Test.Exception()
215*b1cdbd2cSJim Jagielski    bOK = false
216*b1cdbd2cSJim Jagielski    resume next
217*b1cdbd2cSJim JagielskiEnd Sub
218*b1cdbd2cSJim Jagielski
219*b1cdbd2cSJim JagielskiFunction GetProps() As Boolean
220*b1cdbd2cSJim JagielskiOn Error Goto ErrHndl
221*b1cdbd2cSJim Jagielski    Dim bOK as Boolean
222*b1cdbd2cSJim Jagielski    Dim i As Integer
223*b1cdbd2cSJim Jagielski    Dim attr As Variant
224*b1cdbd2cSJim Jagielski    bOK = true
225*b1cdbd2cSJim Jagielski
226*b1cdbd2cSJim Jagielski    aAllProps = oObj.propertySetInfo.getProperties
227*b1cdbd2cSJim Jagielski    nNormalCount = 0
228*b1cdbd2cSJim Jagielski    nBoundCount = 0
229*b1cdbd2cSJim Jagielski    nConstrainedCount = 0
230*b1cdbd2cSJim Jagielski    nReadOnlyCount = 0
231*b1cdbd2cSJim Jagielski
232*b1cdbd2cSJim Jagielski    'first we should find out how many properties of different kinds exists
233*b1cdbd2cSJim Jagielski    for i = lbound(aAllProps) to ubound(aAllProps)
234*b1cdbd2cSJim Jagielski        attr = aAllProps(i).Attributes
235*b1cdbd2cSJim Jagielski        if (attr AND READONLY) OR (attr AND BOUND) OR (attr AND CONSTRAINED) then
236*b1cdbd2cSJim Jagielski            if (attr AND BOUND) then
237*b1cdbd2cSJim Jagielski                nBoundCount = nBoundCount + 1
238*b1cdbd2cSJim Jagielski            end if
239*b1cdbd2cSJim Jagielski            if (attr AND CONSTRAINED) then
240*b1cdbd2cSJim Jagielski                nConstrainedCount = nConstrainedCount + 1
241*b1cdbd2cSJim Jagielski            end if
242*b1cdbd2cSJim Jagielski            if (attr AND READONLY) then
243*b1cdbd2cSJim Jagielski                nReadOnlyCount = nReadOnlyCount + 1
244*b1cdbd2cSJim Jagielski            end if
245*b1cdbd2cSJim Jagielski        else
246*b1cdbd2cSJim Jagielski            if (NOT isNULL(oObj.getPropertyValue(aAllProps(i).Name))) then
247*b1cdbd2cSJim Jagielski                nNormalCount = nNormalCount + 1
248*b1cdbd2cSJim Jagielski            end if
249*b1cdbd2cSJim Jagielski        end if
250*b1cdbd2cSJim Jagielski    next i
251*b1cdbd2cSJim Jagielski
252*b1cdbd2cSJim Jagielski    Out.Log("" &amp; nNormalCount &amp; " Normal properties found")
253*b1cdbd2cSJim Jagielski    Out.Log("" &amp; nBoundCount &amp; " Bound properties found")
254*b1cdbd2cSJim Jagielski    Out.Log("" &amp; nConstrainedCount &amp; " Constrained properties found")
255*b1cdbd2cSJim Jagielski    Out.Log("" &amp; nReadOnlyCount &amp; " ReadOnly properties found")
256*b1cdbd2cSJim Jagielski
257*b1cdbd2cSJim Jagielski    Dim AN(nNormalCount) As String
258*b1cdbd2cSJim Jagielski    aNormalProps = AN()
259*b1cdbd2cSJim Jagielski
260*b1cdbd2cSJim Jagielski    Dim AB(nBoundCount) As String
261*b1cdbd2cSJim Jagielski    aBoundProps = AB()
262*b1cdbd2cSJim Jagielski
263*b1cdbd2cSJim Jagielski    Dim AC(nConstrainedCount) As String
264*b1cdbd2cSJim Jagielski    aConstrainedProps = AC()
265*b1cdbd2cSJim Jagielski
266*b1cdbd2cSJim Jagielski    Dim AR(nReadOnlyCount) As String
267*b1cdbd2cSJim Jagielski    aReadOnlyProps = AR()
268*b1cdbd2cSJim Jagielski
269*b1cdbd2cSJim Jagielski   'Filling up arrays...
270*b1cdbd2cSJim Jagielski
271*b1cdbd2cSJim Jagielski    nNormalCount = 0
272*b1cdbd2cSJim Jagielski    nBoundCount = 0
273*b1cdbd2cSJim Jagielski    nConstrainedCount = 0
274*b1cdbd2cSJim Jagielski    nReadOnlyCount = 0
275*b1cdbd2cSJim Jagielski    for i = lbound(aAllProps) to ubound(aAllProps)
276*b1cdbd2cSJim Jagielski        attr = aAllProps(i).Attributes
277*b1cdbd2cSJim Jagielski        if (attr AND READONLY) OR (attr AND BOUND) OR (attr AND CONSTRAINED) then
278*b1cdbd2cSJim Jagielski            if (attr AND BOUND) then
279*b1cdbd2cSJim Jagielski                aBoundProps(nBoundCount) = aAllProps(i).Name
280*b1cdbd2cSJim Jagielski                nBoundCount = nBoundCount + 1
281*b1cdbd2cSJim Jagielski            end if
282*b1cdbd2cSJim Jagielski            if (attr AND CONSTRAINED) then
283*b1cdbd2cSJim Jagielski                aConstrainedProps(nConstrainedCount) = aAllProps(i).Name
284*b1cdbd2cSJim Jagielski                nConstrainedCount = nConstrainedCount + 1
285*b1cdbd2cSJim Jagielski            end if
286*b1cdbd2cSJim Jagielski            if (attr AND READONLY) then
287*b1cdbd2cSJim Jagielski                aReadOnlyProps(nReadOnlyCount) = aAllProps(i).Name
288*b1cdbd2cSJim Jagielski                nReadOnlyCount = nReadOnlyCount + 1
289*b1cdbd2cSJim Jagielski            end if
290*b1cdbd2cSJim Jagielski        else
291*b1cdbd2cSJim Jagielski            if (NOT isNULL(oObj.getPropertyValue(aAllProps(i).Name))) then
292*b1cdbd2cSJim Jagielski                aNormalProps(nNormalCount) = aAllProps(i).Name
293*b1cdbd2cSJim Jagielski                nNormalCount = nNormalCount + 1
294*b1cdbd2cSJim Jagielski            end if
295*b1cdbd2cSJim Jagielski        end if
296*b1cdbd2cSJim Jagielski    next i
297*b1cdbd2cSJim Jagielski
298*b1cdbd2cSJim Jagielski    GetProps = bOK
299*b1cdbd2cSJim JagielskiExit Function
300*b1cdbd2cSJim JagielskiErrHndl:
301*b1cdbd2cSJim Jagielski    Test.Exception()
302*b1cdbd2cSJim Jagielski    resume next
303*b1cdbd2cSJim JagielskiEnd Function
304*b1cdbd2cSJim Jagielski
305*b1cdbd2cSJim JagielskiFunction test_GetPropertyValue() As Boolean
306*b1cdbd2cSJim JagielskiOn Error goto ErrHndl
307*b1cdbd2cSJim Jagielski
308*b1cdbd2cSJim Jagielski    Dim bOK As Boolean
309*b1cdbd2cSJim Jagielski    Dim i As Integer
310*b1cdbd2cSJim Jagielski    Dim propName As String
311*b1cdbd2cSJim Jagielski    Dim propVal As Variant
312*b1cdbd2cSJim Jagielski    bOK = false
313*b1cdbd2cSJim Jagielski
314*b1cdbd2cSJim Jagielski    for i = lbound(aAllProps) to ubound(aAllProps)
315*b1cdbd2cSJim Jagielski        propName = aAllProps(i).Name
316*b1cdbd2cSJim Jagielski        propVal = oObj.getPropertyValue(propName)
317*b1cdbd2cSJim Jagielski        bOK = true
318*b1cdbd2cSJim Jagielski        if (isNULL(propVal)) AND NOT(aAllProps(i).Attributes AND MAYBENULL) then
319*b1cdbd2cSJim Jagielski                Out.Log(cIfcShortName &amp; " " &amp; aAllProps(i).Name &amp; " is NULL, but it is not MAYBENULL")
320*b1cdbd2cSJim Jagielski        end if
321*b1cdbd2cSJim Jagielski    next i
322*b1cdbd2cSJim Jagielski
323*b1cdbd2cSJim Jagielski    test_GetPropertyValue() = bOK
324*b1cdbd2cSJim JagielskiExit Function
325*b1cdbd2cSJim JagielskiErrHndl:
326*b1cdbd2cSJim Jagielski    Test.Exception()
327*b1cdbd2cSJim Jagielski    bOK = false
328*b1cdbd2cSJim Jagielski    resume next
329*b1cdbd2cSJim JagielskiEnd Function
330*b1cdbd2cSJim Jagielski
331*b1cdbd2cSJim JagielskiSub CB1_propertyChange
332*b1cdbd2cSJim Jagielski    Out.Log("CallBack 'PropertyChange' for listener 1 was called.")
333*b1cdbd2cSJim Jagielski    propCalled1 = true
334*b1cdbd2cSJim Jagielski    CB1_propertyChange = true
335*b1cdbd2cSJim JagielskiEnd Sub
336*b1cdbd2cSJim Jagielski
337*b1cdbd2cSJim JagielskiSub CB1_vetoableChange
338*b1cdbd2cSJim Jagielski    Out.Log("CallBack 'vetoableChange' for listener 1 was called.")
339*b1cdbd2cSJim Jagielski    vetoCalled1 = true
340*b1cdbd2cSJim JagielskiEnd Sub
341*b1cdbd2cSJim Jagielski
342*b1cdbd2cSJim JagielskiSub CB2_propertyChange
343*b1cdbd2cSJim Jagielski    Out.Log("CallBack 'PropertyChange' for listener 2 was called.")
344*b1cdbd2cSJim Jagielski    propCalled2 = true
345*b1cdbd2cSJim Jagielski    CB2_propertyChange = true
346*b1cdbd2cSJim JagielskiEnd Sub
347*b1cdbd2cSJim Jagielski
348*b1cdbd2cSJim JagielskiSub CB2_vetoableChange
349*b1cdbd2cSJim Jagielski    Out.Log("CallBack 'vetoableChange' for listener 2 was called.")
350*b1cdbd2cSJim Jagielski    vetoCalled2 = true
351*b1cdbd2cSJim JagielskiEnd Sub
352*b1cdbd2cSJim Jagielski</script:module>
353