1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: sxc7_03.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-11 07:32:01 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : oliver.creamer@sun.com
36 '* short description : XML Calc Include File
38 '\***********************************************************************************
39 Dim Isliste(250) as string
40 Dim OutputPath as string
41 Dim iSecurityBefore as integer
44 printlog "------------------- sxc_03.inc ---------------------"
47 call tconditional_formatting
49 iSecurityBefore = hSetMacroSecurity(1)
51 call hSetMacroSecurity(iSecurityBefore)
53 call tfilter_and_subtotals1
54 call tfilter_and_subtotals4
55 call tmatrixformula_and_notes
59 '-------------------------------------------------------------------------
61 testcase tchart_export
62 printlog "+- chart_export.sdc"
63 if bDebugVersion = TRUE then
64 warnlog "#i41970# Assertion in DEBUG version breaks automated testing. This testcase will be ignored."
67 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\chart_export.sdc"))
68 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc") , "StarOffice XML (Calc)") = TRUE then
69 '/// Closing the document also if there is a verification dialog.
72 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export") )
73 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\styles.xml")) = FALSE then
74 warnlog "XML-file 'styles.xml' not well formed!"
76 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\meta.xml")) = FALSE then
77 warnlog "XML-file 'meta.xml' not well formed!"
79 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\content.xml")) = FALSE then
80 warnlog "XML-file 'content.xml' not well formed!"
82 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc"))
88 warnlog "It was not possible to save the document as XML!"
92 '-------------------------------------------------------------------------
94 testcase tconditional_formatting
95 printlog "+- conditional_formatting.sdc"
97 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\conditional_formatting.sdc"))
98 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc") , "StarOffice XML (Calc)") = TRUE then
99 '/// Closing the document also if there is a verification dialog.
100 call hCloseDocument()
102 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting") )
103 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\styles.xml")) = FALSE then
104 warnlog "XML-file 'styles.xml' not well formed!"
106 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\meta.xml")) = FALSE then
107 warnlog "XML-file 'meta.xml' not well formed!"
109 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\content.xml")) = FALSE then
110 warnlog "XML-file 'content.xml' not well formed!"
112 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc"))
118 warnlog "It was not possible to save the document as XML!"
122 '-------------------------------------------------------------------------
125 Dim cWhereCalled as string
127 printlog "+- controls01.sdc"
129 cWhereCalled = "xml::level1::inc::sxc7_03.inc::tcontrols01: "
131 '/// Open Tools/Options -> OpenOffice.org/Security
132 '/// Click on the macro security button
133 '/// Set the <b>medium</b> security level
135 if iSecurityBefore = "" then
136 QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!"
140 'if variable iSecurityBefore is not initialized and causes into an error
141 QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!"
145 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\controls01.sdc"))
147 Kontext "SecurityWarning"
148 if SecurityWarning.Exists(1) then
151 warnlog "#i80769# Macros not being loaded. Exiting test case."
152 'warnlog "No Macro Security Warning occoured while loading 'controls01.sdc'."
157 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc") , "StarOffice XML (Calc)") = TRUE then
158 '/// Closing the document also if there is a verification dialog.
159 call hCloseDocument()
161 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01") )
162 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\styles.xml")) = FALSE then
163 warnlog "XML-file 'styles.xml' not well formed!"
165 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\meta.xml")) = FALSE then
166 warnlog "XML-file 'meta.xml' not well formed!"
168 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\content.xml")) = FALSE then
169 warnlog "XML-file 'content.xml' not well formed!"
171 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc"))
172 '/// Accept the security warning and enable executing the macros.
173 Kontext "SecurityWarning"
174 if SecurityWarning.Exists(1) then
177 warnlog "Macro will not be loaded due to bug #i80769#"
178 'warnlog "No Macro Security Warning occoured while loading 'controls01.sxc'."
185 warnlog "It was not possible to save the document as XML!"
189 '-------------------------------------------------------------------------
191 testcase tdatabase_ranges
192 printlog "+- database_ranges.sdc"
194 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\database_ranges.sdc"))
195 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc") , "StarOffice XML (Calc)") = TRUE then
196 '/// Closing the document also if there is a verification dialog.
197 call hCloseDocument()
199 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges") )
200 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\styles.xml")) = FALSE then
201 warnlog "XML-file 'styles.xml' not well formed!"
203 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\meta.xml")) = FALSE then
204 warnlog "XML-file 'meta.xml' not well formed!"
206 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\content.xml")) = FALSE then
207 warnlog "XML-file 'content.xml' not well formed!"
209 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc"))
215 warnlog "It was not possible to save the document as XML!"
219 '-------------------------------------------------------------------------
221 testcase tfilter_and_subtotals1
222 printlog "+- filter_and_subtotals1"
224 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\filter_and_subtotals1.sdc"))
225 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc") , "StarOffice XML (Calc)") = TRUE then
226 '/// Closing the document also if there is a verification dialog.
227 call hCloseDocument()
229 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1") )
230 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\styles.xml")) = FALSE then
231 warnlog "XML-file 'styles.xml' not well formed!"
233 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\meta.xml")) = FALSE then
234 warnlog "XML-file 'meta.xml' not well formed!"
236 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\content.xml")) = FALSE then
237 warnlog "XML-file 'content.xml' not well formed!"
239 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc"))
245 warnlog "It was not possible to save the document as XML!"
249 '-------------------------------------------------------------------------
251 testcase tfilter_and_subtotals4
252 printlog "+- filter_and_subtotals4.sdc"
254 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\filter_and_subtotals4.sdc"))
255 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc") , "StarOffice XML (Calc)") = TRUE then
256 '/// Closing the document also if there is a verification dialog.
257 call hCloseDocument()
259 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4") )
260 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\styles.xml")) = FALSE then
261 warnlog "XML-file 'styles.xml' not well formed!"
263 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\meta.xml")) = FALSE then
264 warnlog "XML-file 'meta.xml' not well formed!"
266 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\content.xml")) = FALSE then
267 warnlog "XML-file 'content.xml' not well formed!"
269 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc"))
275 warnlog "It was not possible to save the document as XML!"
279 '-------------------------------------------------------------------------
281 testcase tmatrixformula_and_notes
282 printlog "+- matrixformula_and_notes.sdc"
284 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\matrixformula_and_notes.sdc"))
285 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc") , "StarOffice XML (Calc)") = TRUE then
286 '/// Closing the document also if there is a verification dialog.
287 call hCloseDocument()
289 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes") )
290 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\styles.xml")) = FALSE then
291 warnlog "XML-file 'styles.xml' not well formed!"
293 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\meta.xml")) = FALSE then
294 warnlog "XML-file 'meta.xml' not well formed!"
296 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\content.xml")) = FALSE then
297 warnlog "XML-file 'content.xml' not well formed!"
299 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc"))
305 warnlog "It was not possible to save the document as XML!"
309 '-------------------------------------------------------------------------
312 printlog "+- password3.sdc"
314 call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\password3.sdc"))
315 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc") , "StarOffice XML (Calc)") = TRUE then
316 '/// Closing the document also if there is a verification dialog.
317 call hCloseDocument()
319 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\password3") )
320 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\styles.xml")) = FALSE then
321 warnlog "XML-file 'styles.xml' not well formed!"
323 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\meta.xml")) = FALSE then
324 warnlog "XML-file 'meta.xml' not well formed!"
326 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\content.xml")) = FALSE then
327 warnlog "XML-file 'content.xml' not well formed!"
329 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc"))
335 warnlog "It was not possible to save the document as XML!"