blob: 4b922dca4fc2a02c99730b77b7fbaac4edd692b6 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XTypeProvider" script:language="StarBasic">
'*************************************************************************
'
' Licensed to the Apache Software Foundation (ASF) under one
' or more contributor license agreements. See the NOTICE file
' distributed with this work for additional information
' regarding copyright ownership. The ASF licenses this file
' to you under the Apache License, Version 2.0 (the
' "License"); you may not use this file except in compliance
' with the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing,
' software distributed under the License is distributed on an
' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
' KIND, either express or implied. See the License for the
' specific language governing permissions and limitations
' under the License.
'
'*************************************************************************
Sub RunTest()
'*************************************************************************
' INTERFACE:
' com.sun.star.lang.XTypeProvider
'*************************************************************************
On Error Goto ErrHndl
Dim bOK As Boolean
Dim n As Integer
Dim vTypes As Variant
Dim IDs1(15) As Integer
Dim IDs2(15) As Integer
Test.StartMethod("getTypes()")
bOK = false
vTypes = oObj.getTypes()
For n = lBound(vTypes()) to UBound(vTypes())
If vTypes(n).Name = cIfcLongName Then
Out.Log("Type of Object " &amp; n &amp; " is " &amp; vTypes(n).Name &amp; ". Same as Interface =&gt; ok!"
bOK = true
Else
Out.Log("Type of Object " &amp; n &amp; " is " &amp; vTypes(n).Name
End If
Next n
Test.MethodTested("getTypes()", bOK)
Test.StartMethod("getImplementationId()")
bOK = true
IDs1() = oObj.getImplementationId()
IDs2() = oObj.getImplementationId()
bOK = bOK AND ubound(IDs1()) = ubound(IDs2())
bOK = bOK AND ubound(IDs1()) = 15
if (bOK) then
for n = lBound(IDs1()) to lBound(IDs2())
bOK = bOK AND IDs1(n) = IDs2(n)
Next n
end if
if (NOT bOK) then
Out.Log("Returned IDs are NOT identical!")
end if
Test.MethodTested("getImplementationId()", bOK)
Exit Sub
ErrHndl:
Test.Exception()
bOK = false
resume next
End Sub
</script:module>