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_XSpreadsheets" 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_XSpreadsheets.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:
43 '*************************************************************************
44 ' This Interface/Service test depends on the following GLOBAL variables,
45 ' which must be specified in the object creation:
47 ' - Global nGlobalLong As Long the number of sheets
49 '*************************************************************************
58 '*************************************************************************
60 ' com.sun.star.sheet.XSpreadsheets
61 '*************************************************************************
66 Dim oSheet1, oSheet2 As Object
69 Test.StartMethod(
"insertNewByName()")
71 for l =
1 to nGlobalLong
72 sname = cIfcShortName
& CStr(l)
73 oObj.insertNewByName(sname, l)
74 oSheet1 = oObj.getByName(sname)
75 oSheet2 = oObj.getByIndex(l)
76 bOK = bOK AND NOT isNull(oSheet1)
77 bOK = bOK AND NOT isNull(oSheet2)
79 bOK = bOK and oSheet1.name = oSheet2.name
82 Test.MethodTested(
"insertNewByName()", bOK)
84 Test.StartMethod(
"copyByName()")
87 sname = cIfcShortName
& "COPY"
88 oObj.copyByName(cIfcShortName
& CStr(l), sname, l )
89 oSheet1 = oObj.getByName(sname)
90 oSheet2 = oObj.getByIndex(l)
91 bOK = bOK AND NOT isNull(oSheet1)
92 bOK = bOK AND NOT isNull(oSheet2)
94 bOK = bOK AND oSheet1.name = oSheet2.name
96 Test.MethodTested(
"copyByName()", bOK)
98 Test.StartMethod(
"moveByName()")
101 sname = cIfcShortName
& "2"
102 oObj.moveByName(sname, l)
103 oSheet1 = oObj.getByName(sname)
104 oSheet2 = oObj.getByIndex(l)
105 bOK = bOK AND NOT isNull(oSheet1)
106 bOK = bOK AND NOT isNull(oSheet2)
108 bOK = bOK AND oSheet1.name = oSheet2.name
110 Out.Log(cIfcShortName
& ":" & "#1 - " & bOK)
112 sname = cIfcShortName
& "COPY"
114 oObj.moveByName(sname, l)
116 oSheet1 = oObj.getByName(sname)
117 oSheet2 = oObj.getByIndex(l)
118 bOK = bOK AND NOT isNull(oSheet1)
119 bOK = bOK AND NOT isNull(oSheet2)
121 bOK = bOK and oSheet1.name =oSheet2.name
123 Test.MethodTested(
"moveByName()", bOK)
125 nGlobalLong = nGlobalLong *
2 +
1 ' nGlobalLong :
3 default sheets where already there
126 ' nGlobalLong have been inserted
127 ' +
1 has been created by Copy