Update ooo320-m1
[ooovba.git] / qadevOOo / tests / basic / ifc / sheet / XDataPilotDescriptor / sheet_XDataPilotDescriptor.xba
blobfe6a55f8a9b68213b301f51224bcc5040368e2fb
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">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 '
10 ' Copyright 2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: sheet_XDataPilotDescriptor.xba,v $
16 ' $Revision: 1.3 $
18 ' This file is part of OpenOffice.org.
20 ' OpenOffice.org is free software: you can redistribute it and/or modify
21 ' it under the terms of the GNU Lesser General Public License version 3
22 ' only, as published by the Free Software Foundation.
24 ' OpenOffice.org is distributed in the hope that it will be useful,
25 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ' GNU Lesser General Public License version 3 for more details
28 ' (a copy is included in the LICENSE file that accompanied this code).
30 ' You should have received a copy of the GNU Lesser General Public License
31 ' version 3 along with OpenOffice.org. If not, see
32 ' <http://www.openoffice.org/license.html>
33 ' for a copy of the LGPLv3 License.
35 '*************************************************************************
36 '*************************************************************************
40 ' Be sure that all variables are dimensioned:
41 option explicit
45 Sub RunTest()
47 '*************************************************************************
48 ' INTERFACE:
49 ' com.sun.star.sheet.XDataPilotDescriptor
50 '*************************************************************************
51 On Error Goto ErrHndl
52 Dim bOK, bOK1 As Boolean
53 Dim Tag, oldTag As String
54 Dim oldRange, newRange, FD As Object
55 Dim Range As New com.sun.star.table.CellRangeAddress
56 Dim Fields() As Object
58 Test.StartMethod("getTag()")
59 bOK = true
60 bOK = bOK AND NOT isNULL(oObj.getTag())
61 Test.MethodTested("getTag()", bOK)
63 Test.StartMethod("setTag()")
64 bOK = true
65 Tag = cIfcShortName
66 oldTag = oObj.getTag()
67 oObj.SetTag(Tag)
68 bOK = bOK AND (oldTag &lt;&gt; oObj.getTag())
69 oObj.setTag(oldTag)
70 Test.MethodTested("setTag()", bOK)
72 Test.StartMethod("getSourceRange()")
73 bOK = true
74 bOK = bOK AND NOT isNULL(oObj.getSourceRange())
75 Test.MethodTested("getSourceRange()", bOK)
77 Test.StartMethod("setSourceRange()")
78 bOK = true
79 Range.Sheet = 0
80 Range.StartColumn = 1
81 Range.StartRow = 1
82 Range.EndColumn = 4
83 Range.EndRow = 4
85 oldRange = oObj.getSourceRange
86 oObj.setSourceRange(Range)
87 newRange = oObj.getSourceRange
88 bOK1 = false
89 bOK1 = bOK1 OR newRange.Sheet &lt;&gt; oldRange.Sheet
90 bOK1 = bOK1 OR newRange.StartColumn &lt;&gt; oldRange.StartColumn
91 bOK1 = bOK1 OR newRange.EndColumn &lt;&gt; oldRange.EndColumn
92 bOK1 = bOK1 OR newRange.StartRow &lt;&gt; oldRange.StartRow
93 bOK1 = bOK1 OR newRange.EndRow &lt;&gt; oldRange.EndRow
94 bOK = bOK AND bOK1
96 oObj.setSourceRange(oldRange)
97 Test.MethodTested("setSourceRange()", bOK)
99 Test.StartMethod("getFilterDescriptor()")
100 bOK = true
101 FD = oObj.getFilterDescriptor
102 bOK = (NOT isNULL(FD)) AND (ubound(FD.getFilterFields) &gt; 0)
103 Test.MethodTested("getFilterDescriptor()", bOK)
105 Test.StartMethod("getDataPilotFields()")
106 bOK = true
107 Fields = oObj.getDataPilotFields
108 bOK = NOT isNULL(Fields)
109 Test.MethodTested("getDataPilotFields()", bOK)
111 Test.StartMethod("getColumnFields()")
112 bOK = true
113 Fields = oObj.getColumnFields
114 bOK = NOT isNULL(Fields)
115 Test.MethodTested("getColumnFields()", bOK)
117 Test.StartMethod("getRowFields()")
118 bOK = true
119 Fields = oObj.getRowFields
120 bOK = NOT isNULL(Fields)
121 Test.MethodTested("getRowFields()", bOK)
123 Test.StartMethod("getPageFields()")
124 bOK = true
125 Fields = oObj.getPageFields()
126 bOK = NOT isNULL(Fields)
127 Test.MethodTested("getPageFields()", bOK)
129 Test.StartMethod("getDataFields()")
130 bOK = true
131 Fields = oObj.getDataFields
132 bOK = bOK AND NOT isNULL(Fields)
133 Test.MethodTested("getDataFields()", bOK)
135 Test.StartMethod("getHiddenFields()")
136 bOK = true
137 Fields = oObj.getHiddenFields()
138 bOK = NOT isNULL(Fields)
139 Test.MethodTested("getHiddenFields()", bOK)
141 Exit Sub
142 ErrHndl:
143 Test.Exception()
144 bOK = false
145 resume next
146 End Sub
147 </script:module>