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="table_XTableChart" 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 42Sub RunTest() 43 44'************************************************************************* 45' INTERFACE: 46' com.sun.star.table.XTableChart 47'************************************************************************* 48On Error Goto ErrHndl 49 Dim bOK As Boolean 50 Dim tAddr(0) As New com.sun.star.table.CellRangeAddress 51 Dim objAddr As Object 52 53 Test.StartMethod("getHasColumnHeaders()") 54 bOK = true 55 bOK = bOK AND NOT isNULL(oObj.getHasColumnHeaders()) 56 Test.MethodTested("getHasColumnHeaders()", bOK) 57 58 Test.StartMethod("setHasColumnHeaders()") 59 bOK = true 60 oObj.setHasColumnHeaders(true) 61 bOK = bOK AND oObj.getHasColumnHeaders() = true 62 oObj.setHasColumnHeaders(false) 63 bOK = bOK AND oObj.getHasColumnHeaders() = false 64 Test.MethodTested("setHasColumnHeaders()", bOK) 65 66 Test.StartMethod("getHasRowHeaders()") 67 bOK = true 68 bOK = bOK AND NOT isNULL(oObj.getHasRowHeaders()) 69 Test.MethodTested("getHasRowHeaders()", bOK) 70 71 Test.StartMethod("setHasRowHeaders()") 72 bOK = true 73 oObj.setHasRowHeaders(true) 74 bOK = bOK AND oObj.getHasRowHeaders() 75 oObj.setHasRowHeaders(false) 76 bOK = bOK AND oObj.getHasRowHeaders() = false 77 Test.MethodTested("setHasRowHeaders()", bOK) 78 79 Test.StartMethod("getRanges()") 80 bOK = true 81 bOK = bOK AND NOT isNULL(oObj.getRanges()) 82 Test.MethodTested("getRanges()", bOK) 83 84 Test.StartMethod("setRanges()") 85 bOK = true 86 tAddr(0).Sheet = 0 87 tAddr(0).StartRow = 0 88 tAddr(0).StartColumn = 0 89 tAddr(0).EndRow = 3 90 tAddr(0).EndColumn = 3 91 92 oObj.setRanges(tAddr()) 93 objAddr = oObj.getRanges() 94 bOK = bOK AND NOT isNULL(objAddr) 95 if bOK then 96 Out.Log("oChart.getRanges() returned array of " & ubound(objAddr) + 1 & " element(s)") 97 bOK = bOK AND (ubound(objAddr) <> -1) 98 end if 99 Test.MethodTested("setRanges()", bOK) 100 101Exit Sub 102ErrHndl: 103 Test.Exception() 104 bOK = false 105 resume next 106End Sub 107</script:module> 108