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_XTabControllerModel" 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' Be sure that all variables are dimensioned: 38option explicit 39 40'************************************************************************* 41' This Interface/Service test depends on the following GLOBAL variables, 42' which must be specified in the object creation: 43 44' Global XTabControlModel1 as Object 45' Global XTabControlModel2 as Object 46 47'************************************************************************* 48 49 50 51 52 53 54 55Sub RunTest() 56 57'************************************************************************* 58' INTERFACE: 59' com.sun.star.awt.XTabControllerModel 60'************************************************************************* 61On Error Goto ErrHndl 62 Dim bOK As Boolean 63 Dim ModelSeq1(0), ModelSeq2(0) As Variant 64 Dim ReturnModel(), ReturnSeq2(), ReturnSeq1() As Variant 65 Dim ReturnName, cName As String 66 67 cName = "XTabControllerModel" 68 69 Test.StartMethod("setGroupControl()") 70 bOK = true 71 oObj.setGroupControl(false) 72 Test.StartMethod("getGroupControl()") 73 bOK = bOK AND NOT oObj.getGroupControl() 74 oObj.setGroupControl(true) 75 bOK = bOK AND oObj.getGroupControl() 76 Test.MethodTested("getGroupControl()", bOK) 77 Test.MethodTested("setGroupControl()", bOK) 78 79 Test.StartMethod("setControlModels()") 80 bOK = true 81 ModelSeq1(0) = XTabControlModel1 82 oObj.setControlModels(ModelSeq1()) 83 Test.StartMethod("getControlModels()") 84 ReturnSeq1 = oObj.getControlModels() 85 bOK = bOk AND (uBound(ReturnSeq1()) = uBound(ModelSeq1())) 86 Test.MethodTested("setControlModels()", bOK) 87 Test.MethodTested("getControlModels()", bOK) 88 89 Test.StartMethod("setGroup()") 90 bOK = true 91 ModelSeq2(0) = XTabControlModel2 92 oObj.setGroup(ModelSeq2(), cName) 93 Test.StartMethod("getGroup()") 94 oObj.getGroup(0,ReturnSeq2(), ReturnName) 95 bOK = bOK AND (ReturnName = cName) 96 bOK = bOK AND (uBound(ReturnSeq2()) = uBound(ModelSeq2())) 97 Test.MethodTested("setGroup()", bOK) 98 Test.MethodTested("getGroup()", bOK) 99 100 Test.StartMethod("getGroupCount()") 101 bOK = true 102 bOK = bOK AND (oObj.getGroupCount() > 0) 103 bOK = bOK AND isNumeric(oObj.getGroupCount()) 104 Test.MethodTested("getGroupCount()", bOK) 105 106 Test.StartMethod("getGroupByName()") 107 bOK = true 108 oObj.getGroupByName(cName, ReturnModel()) 109 Test.MethodTested("getGroupByName()", bOK) 110 111 112Exit Sub 113ErrHndl: 114 Test.Exception() 115 bOK = false 116 resume next 117End Sub 118</script:module> 119