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="sheet_XDataPilotDescriptor" 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.sheet.XDataPilotDescriptor
41'*************************************************************************
42On Error Goto ErrHndl
43    Dim bOK, bOK1 As Boolean
44    Dim Tag, oldTag As String
45    Dim oldRange, newRange, FD As Object
46    Dim Range As New com.sun.star.table.CellRangeAddress
47    Dim Fields() As Object
48
49    Test.StartMethod("getTag()")
50    bOK = true
51    bOK = bOK AND NOT isNULL(oObj.getTag())
52    Test.MethodTested("getTag()", bOK)
53
54    Test.StartMethod("setTag()")
55    bOK = true
56    Tag = cIfcShortName
57    oldTag = oObj.getTag()
58    oObj.SetTag(Tag)
59    bOK = bOK AND (oldTag &lt;&gt; oObj.getTag())
60    oObj.setTag(oldTag)
61    Test.MethodTested("setTag()", bOK)
62
63    Test.StartMethod("getSourceRange()")
64    bOK = true
65    bOK = bOK AND NOT isNULL(oObj.getSourceRange())
66    Test.MethodTested("getSourceRange()", bOK)
67
68    Test.StartMethod("setSourceRange()")
69    bOK = true
70    Range.Sheet = 0
71    Range.StartColumn = 1
72    Range.StartRow = 1
73    Range.EndColumn = 4
74    Range.EndRow = 4
75
76    oldRange = oObj.getSourceRange
77    oObj.setSourceRange(Range)
78    newRange = oObj.getSourceRange
79    bOK1 = false
80    bOK1 = bOK1 OR newRange.Sheet &lt;&gt; oldRange.Sheet
81    bOK1 = bOK1 OR newRange.StartColumn &lt;&gt; oldRange.StartColumn
82    bOK1 = bOK1 OR newRange.EndColumn &lt;&gt; oldRange.EndColumn
83    bOK1 = bOK1 OR newRange.StartRow &lt;&gt; oldRange.StartRow
84    bOK1 = bOK1 OR newRange.EndRow &lt;&gt; oldRange.EndRow
85    bOK = bOK AND bOK1
86
87    oObj.setSourceRange(oldRange)
88    Test.MethodTested("setSourceRange()", bOK)
89
90    Test.StartMethod("getFilterDescriptor()")
91    bOK = true
92    FD = oObj.getFilterDescriptor
93    bOK = (NOT isNULL(FD)) AND (ubound(FD.getFilterFields) &gt; 0)
94    Test.MethodTested("getFilterDescriptor()", bOK)
95
96    Test.StartMethod("getDataPilotFields()")
97    bOK = true
98    Fields = oObj.getDataPilotFields
99    bOK = NOT isNULL(Fields)
100    Test.MethodTested("getDataPilotFields()", bOK)
101
102    Test.StartMethod("getColumnFields()")
103    bOK = true
104    Fields = oObj.getColumnFields
105    bOK = NOT isNULL(Fields)
106    Test.MethodTested("getColumnFields()", bOK)
107
108    Test.StartMethod("getRowFields()")
109    bOK = true
110    Fields = oObj.getRowFields
111    bOK = NOT isNULL(Fields)
112    Test.MethodTested("getRowFields()", bOK)
113
114    Test.StartMethod("getPageFields()")
115    bOK = true
116    Fields = oObj.getPageFields()
117    bOK = NOT isNULL(Fields)
118    Test.MethodTested("getPageFields()", bOK)
119
120    Test.StartMethod("getDataFields()")
121    bOK = true
122    Fields = oObj.getDataFields
123    bOK = bOK AND NOT isNULL(Fields)
124    Test.MethodTested("getDataFields()", bOK)
125
126    Test.StartMethod("getHiddenFields()")
127    bOK = true
128    Fields = oObj.getHiddenFields()
129    bOK = NOT isNULL(Fields)
130    Test.MethodTested("getHiddenFields()", bOK)
131
132Exit Sub
133ErrHndl:
134    Test.Exception()
135    bOK = false
136    resume next
137End Sub
138</script:module>
139