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_XSheetCondition" script:
language=
"StarBasic">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 ' Copyright
2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: sheet_XSheetCondition.xba,v $
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:
47 '*************************************************************************
49 ' com.sun.star.sheet.XSheetCondition
50 '*************************************************************************
53 Dim oldOperator As Variant
54 Dim oldFormula As String
55 Dim oPos As com.sun.star.table.CellAddress
56 Dim newPos As New com.sun.star.table.CellAddress
58 Test.StartMethod(
"setOperator()")
59 Test.StartMethod(
"getOperator()")
61 oldOperator = oObj.getOperator()
62 oObj.setOperator(com.sun.star.sheet.ConditionOperator.LESS)
63 bOK = bOK AND oObj.getOperator()
<> oldOperator
64 oObj.setOperator(oldOperator)
65 Test.MethodTested(
"getOperator()", bOK)
66 Test.MethodTested(
"setOperator()", bOK)
68 Test.StartMethod(
"getFormula1()")
69 Test.StartMethod(
"setFormula1()")
71 oldFormula = oObj.getFormula1()
73 bOK = bOK AND oObj.getFormula1() =
"1"
74 oObj.setFormula1(oldFormula)
75 Test.MethodTested(
"getFormula1()", bOK)
76 Test.MethodTested(
"setFormula1()", bOK)
78 Test.StartMethod(
"getFormula2()")
79 Test.StartMethod(
"setFormula2()")
81 oldFormula = oObj.getFormula2()
83 bOK = bOK AND oObj.getFormula2() =
"2"
84 oObj.setFormula2(oldFormula)
85 Test.MethodTested(
"getFormula2()", bOK)
86 Test.MethodTested(
"setFormula2()", bOK)
88 Test.StartMethod(
"getSourcePosition()")
89 Test.StartMethod(
"setSourcePosition()")
91 oPos = oObj.getSourcePosition()
92 bOK = bOK AND oPos.Column
>=
0
93 newPos.Sheet = oPos.Sheet
94 newPos.Column = oPos.Column +
1
95 newPos.Row = oPos.Row +
1
96 oObj.setSourcePosition(newPos)
97 bOK = bOK AND oObj.getSourcePosition().Column = oPos.Column +
1
98 Test.MethodTested(
"getSourcePosition()", bOK)
99 Test.MethodTested(
"setSourcePosition()", bOK)