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_XCell" 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: table_XCell.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.table.XCell
50 '*************************************************************************
53 Dim aFormula As String
57 Test.StartMethod(
"setFormula()")
59 Out.Log(
"setFormula(""=2+2"")")
60 oObj.setFormula(
"=2+2")
61 Test.MethodTested(
"setFormula()", bOK)
63 Test.StartMethod(
"getFormula()")
65 aFormula = oObj.getFormula()
66 Out.Log(
"getFormula() returned '" & aFormula
& "'")
67 bOK = bOK AND inStr(
1, aFormula,
"2+2")
68 Test.MethodTested(
"getFormula()", bOK)
70 Test.StartMethod(
"getValue()")
72 aValue = oObj.getValue()
73 bOK = bOK AND aValue =
4
74 Test.MethodTested(
"getValue()", bOK)
76 Test.StartMethod(
"setValue()")
79 bOK = bOK AND oObj.getValue =
10
80 Test.MethodTested(
"setValue()", bOK)
82 Test.StartMethod(
"getType()")
84 aType = oObj.getType()
85 bOK = bOK AND (aType = com.sun.star.table.CellContentType.EMPTY OR _
86 aType = com.sun.star.table.CellContentType.VALUE OR _
87 aType = com.sun.star.table.CellContentType.TEXT OR _
88 aType = com.sun.star.table.CellContentType.FORMULA)
89 Test.MethodTested(
"getType()", bOK)
91 Test.StartMethod(
"getError()")
93 bOK = bOK AND (oObj.getError() =
0)
94 oObj.setFormula(
"=sqrt(-2)")
95 bOK = bOK AND (oObj.getError()
<> 0)
96 Test.MethodTested(
"getError()", bOK)