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'  Licensed to the Apache Software Foundation (ASF) under one
9'  or more contributor license agreements.  See the NOTICE file
10'  distributed with this work for additional information
11'  regarding copyright ownership.  The ASF licenses this file
12'  to you under the Apache License, Version 2.0 (the
13'  "License"); you may not use this file except in compliance
14'  with the License.  You may obtain a copy of the License at
15'
16'    http://www.apache.org/licenses/LICENSE-2.0
17'
18'  Unless required by applicable law or agreed to in writing,
19'  software distributed under the License is distributed on an
20'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21'  KIND, either express or implied.  See the License for the
22'  specific language governing permissions and limitations
23'  under the License.
24'
25'*************************************************************************
26
27
28
29
30
31' Be sure that all variables are dimensioned:
32option explicit
33
34
35
36Sub RunTest()
37
38'*************************************************************************
39' INTERFACE:
40' com.sun.star.table.XTableChart
41'*************************************************************************
42On Error Goto ErrHndl
43    Dim bOK As Boolean
44    Dim tAddr(0) As New com.sun.star.table.CellRangeAddress
45    Dim objAddr As Object
46
47    Test.StartMethod("getHasColumnHeaders()")
48    bOK = true
49    bOK = bOK AND NOT isNULL(oObj.getHasColumnHeaders())
50    Test.MethodTested("getHasColumnHeaders()", bOK)
51
52    Test.StartMethod("setHasColumnHeaders()")
53    bOK = true
54    oObj.setHasColumnHeaders(true)
55    bOK = bOK AND oObj.getHasColumnHeaders() = true
56    oObj.setHasColumnHeaders(false)
57    bOK = bOK AND oObj.getHasColumnHeaders() = false
58    Test.MethodTested("setHasColumnHeaders()", bOK)
59
60    Test.StartMethod("getHasRowHeaders()")
61    bOK = true
62    bOK = bOK AND NOT isNULL(oObj.getHasRowHeaders())
63    Test.MethodTested("getHasRowHeaders()", bOK)
64
65    Test.StartMethod("setHasRowHeaders()")
66    bOK = true
67    oObj.setHasRowHeaders(true)
68    bOK = bOK AND oObj.getHasRowHeaders()
69    oObj.setHasRowHeaders(false)
70    bOK = bOK AND oObj.getHasRowHeaders() = false
71    Test.MethodTested("setHasRowHeaders()", bOK)
72
73    Test.StartMethod("getRanges()")
74    bOK = true
75    bOK = bOK AND NOT isNULL(oObj.getRanges())
76    Test.MethodTested("getRanges()", bOK)
77
78    Test.StartMethod("setRanges()")
79    bOK = true
80    tAddr(0).Sheet = 0
81    tAddr(0).StartRow = 0
82    tAddr(0).StartColumn = 0
83    tAddr(0).EndRow = 3
84    tAddr(0).EndColumn = 3
85
86    oObj.setRanges(tAddr())
87    objAddr = oObj.getRanges()
88    bOK = bOK AND NOT isNULL(objAddr)
89    if bOK then
90        Out.Log("oChart.getRanges() returned array of " &amp; ubound(objAddr) + 1 &amp; " element(s)")
91        bOK = bOK AND (ubound(objAddr) &lt;&gt; -1)
92    end if
93    Test.MethodTested("setRanges()", bOK)
94
95Exit Sub
96ErrHndl:
97    Test.Exception()
98    bOK = false
99    resume next
100End Sub
101</script:module>
102