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="lang_XTypeProvider" 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 38Sub RunTest() 39 40'************************************************************************* 41' INTERFACE: 42' com.sun.star.lang.XTypeProvider 43'************************************************************************* 44On Error Goto ErrHndl 45 Dim bOK As Boolean 46 Dim n As Integer 47 Dim vTypes As Variant 48 Dim IDs1(15) As Integer 49 Dim IDs2(15) As Integer 50 51 Test.StartMethod("getTypes()") 52 bOK = false 53 vTypes = oObj.getTypes() 54 For n = lBound(vTypes()) to UBound(vTypes()) 55 If vTypes(n).Name = cIfcLongName Then 56 Out.Log("Type of Object " & n & " is " & vTypes(n).Name & ". Same as Interface => ok!" 57 bOK = true 58 Else 59 Out.Log("Type of Object " & n & " is " & vTypes(n).Name 60 End If 61 Next n 62 Test.MethodTested("getTypes()", bOK) 63 64 Test.StartMethod("getImplementationId()") 65 bOK = true 66 IDs1() = oObj.getImplementationId() 67 IDs2() = oObj.getImplementationId() 68 69 bOK = bOK AND ubound(IDs1()) = ubound(IDs2()) 70 bOK = bOK AND ubound(IDs1()) = 15 71 if (bOK) then 72 for n = lBound(IDs1()) to lBound(IDs2()) 73 bOK = bOK AND IDs1(n) = IDs2(n) 74 Next n 75 end if 76 77 if (NOT bOK) then 78 Out.Log("Returned IDs are NOT identical!") 79 end if 80 Test.MethodTested("getImplementationId()", bOK) 81 82Exit Sub 83ErrHndl: 84 Test.Exception() 85 bOK = false 86 resume next 87End Sub 88</script:module> 89