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: ch2_file.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 14:27: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.craemer@sun.com
36 '* short description : Chart resource test - Menu FILE
38 '************************************************************************
50 '\************************************************************************
53 '///<u><b>Dialog test after invocation of File::Close</b></u
54 '/// Load new document
56 '/// Insert default chart
60 '/// Leave wizard with OK
62 printlog "Left Chart wizard with OK"
66 printlog "File / Close executed"
75 '/// Check for File Save dialo
76 Kontext "SpeichernDlg"
77 '/// Cancel File Save dialog
86 '-----------------------------------------------------------
88 testcase tFileSaveAsOTS
89 '///<u><b>Save the test file as OpenDocument Spreadsheet Template (.ots)</b></u>
90 Dim sOutputFile as string
92 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.ots" )
94 '/// Load simple chart document
95 if fLoadVerySimpleChartAndSaveLocal() > 0 then
96 warnlog "Loading test document failed!"
99 printlog "Test document successfully been loaded."
101 '/// Select first OLE using the navigator
103 printlog "First OLE selected via navigator"
104 '/// Edit / Object / Edit to enter Inplace Mode
106 printlog "Edit / Object / Edit"
107 '/// Convert chart to 3D (just to edit document)
108 if NOT fConvertChartTo3D() then
109 warnlog "Conversion of chart to 3D failed -> Quit testcase"
113 printlog "Conversation of chart to 3D was successful."
115 '/// Unselect chart using Escape key
116 Kontext "DocumentCalc"
117 DocumentCalc.TypeKeys "<Escape>"
118 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8_template" ) then
119 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
123 '/// Clsoing the Navigator
124 Kontext "NavigatorCalc"
125 if NavigatorCalc.Exists(1) then
127 QAErrorLog "Why did fSelectFirstOLE not close this dialog?"
133 '-------------------------------------------------------------
135 testcase tFileSaveAsSXC
136 '///<u><b>Save the test file as StarOffice 6.0/7 Spreadsheet (.sxc)</b></u>
137 Dim sOutputFile as string
139 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.sxc" )
141 '/// Load simple chart document
142 if fLoadVerySimpleChartAndSaveLocal() > 0 then
143 warnlog "Loading test document failed!"
146 printlog "Loading test document was successful!"
148 '/// Select chart using navigator
150 printlog "First OLE selected via Navigator"
151 '/// Edit / Object / Edit to enter Inplace Mode
153 printlog "Edit / Object / Edit"
154 '/// Convert chart to 3D (just to edit document)
155 if NOT fConvertChartTo3D() then
156 warnlog "Conversion of chart to 3D failed -> Quit testcase"
160 '/// Unselect chart using Escape key
161 Kontext "DocumentCalc"
162 DocumentCalc.TypeKeys "<Escape>"
163 '/// Save document as StarOffice 6.0/7 Spreadsheet (.sxc)
164 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarOffice XML (Calc)") then
165 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
173 '-------------------------------------------------------------
175 testcase tFileSaveAsSTC
176 '///<u><b>Save the test file as StarOffice 6.0/7 Spreadsheet Template (.stc)</b></u>
177 Dim sOutputFile as string
179 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.stc" )
181 '/// Load simple chart document
182 if fLoadVerySimpleChartAndSaveLocal() > 0 then
183 warnlog "Loading test document seems to have failed -> Check this out!"
186 printlog "Simple chart document successfully been loaded."
188 '/// Select chart using navigator
190 '/// Edit / Object / Edit
192 '/// Convert chart to 3D (just to edit document)
193 if NOT fConvertChartTo3D() then
194 warnlog "Conversion of chart to 3D failed -> Quit testcase"
198 '/// Unselect chart using Escape key
199 Kontext "DocumentCalc"
200 DocumentCalc.TypeKeys "<Escape>"
201 '/// Save document as StarOffice 6.0/7 Spreadsheet Template (.stc)
202 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc_StarOffice_XML_Calc_Template" ) then
203 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
211 '-------------------------------------------------------------
213 testcase tFileSaveAsXLS
214 '///<u><b>Save the test file as Microsoft Excel 97/2000/XP (.xls)</b></u>
215 Dim sOutputFile as string
217 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.xls" )
219 '/// Load simple chart document <i>Testtoolpath</i>/chart2/required/input/verySimpleChart.ods
220 if fLoadVerySimpleChartAndSaveLocal() > 0 then
221 warnlog "Loading test document failed!"
224 '/// Edit / Navigator
225 '/// Select the first OLE object in the tree view of the Navigator
228 printlog "First OLE selected."
229 '/// Edit / Object / Edit to enter Inplace Mode
231 printlog "Edit / Object / Edit executed."
232 '/// Format / Chart Type
233 '/// Check 3D checkbox
234 '/// Close Chart Type dialog
235 if NOT fConvertChartTo3D() then
236 warnlog "Conversion of chart to 3D failed -> Quit testcase"
240 printlog "Chart type converted to 3D."
242 '/// Unselect chart using Escape key
243 Kontext "DocumentCalc"
244 DocumentCalc.TypeKeys "<Escape>"
245 '/// Save document as Microsoft Excel 97/2000/XP (.xls)
246 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "MS Excel 97" ) then
247 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
252 Kontext "DocumentCalc"
253 DocumentCalc.TypeKeys "<Escape>"
257 '-------------------------------------------------------------------------------
259 testcase tFileSaveAsXLT
260 '///<u><b>Save the test file as Microsoft Excel 97/2000/XP Template(.xlt)</b></u>
261 Dim sOutputFile as string
263 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.xlt" )
265 '/// Load simple chart document <i>Testtoolpath</i>/chart2/required/input/verySimpleChart.ods
266 if fLoadVerySimpleChartAndSaveLocal() > 0 then
267 warnlog "Loading test document failed!"
270 '/// Edit / Navigator
271 '/// Select the first OLE object in the tree view of the Navigator
274 printlog "First OLE selected."
275 '/// Edit / Object / Edit to enter Inplace Mode
277 printlog "Edit / Object / Edit executed."
278 '/// Format / Chart Type
279 '/// Check 3D checkbox
280 '/// Close Chart Type dialog
281 if NOT fConvertChartTo3D() then
282 warnlog "Conversion of chart to 3D failed -> Quit testcase"
286 printlog "Chart type converted to 3D."
288 '/// Unselect chart using Escape key
289 Kontext "DocumentCalc"
290 DocumentCalc.TypeKeys "<Escape>"
291 '/// Save document as Microsoft Excel 97/2000/XP Template(.xlt)
292 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "MS Excel 97 Vorlage/Template" ) then
293 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
298 Kontext "DocumentCalc"
299 DocumentCalc.TypeKeys "<Escape>"
303 '-------------------------------------------------------------
305 testcase tFileSaveAsSDC
306 '///<u><b>Save the test file as StarCalc 5.0 (.sdc)</b></u>
307 Dim sOutputFile as string
309 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.sdc" )
311 '/// Load simple chart document
312 if fLoadVerySimpleChartAndSaveLocal() > 0 then
313 warnlog "Loading test document seems to have failed -> Check this out!"
316 '/// Select chart using navigator
318 '/// Invoke Edit::Object::Edit to enter Inplace Mode
320 '/// Convert chart to 3D (just to edit document)
321 if NOT fConvertChartTo3D() then
322 warnlog "Conversion of chart to 3D failed -> Quit testcase"
326 '/// Unselect chart using Escape key
327 Kontext "DocumentCalc"
328 DocumentCalc.TypeKeys "<Escape>"
329 '/// Save document as StarCalc 5.0 (.sdc)
330 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarCalc 5.0" ) then
331 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
336 Kontext "DocumentCalc"
337 DocumentCalc.TypeKeys "<Escape>"
341 '-------------------------------------------------------------
343 testcase tFileSaveAsVOR
344 '///<u><b>Save the test file as StarCalc 5.0 Template(.vor)</b></u>
345 Dim sOutputFile as string
347 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.vor" )
349 '/// Load simple chart document
350 if fLoadVerySimpleChartAndSaveLocal() > 0 then
351 warnlog "Loading test document seems to have failed -> Check this out!"
354 '/// Select chart using navigator
356 '/// Invoke Edit::Object::Edit to enter Inplace Mode
358 '/// Convert chart to 3D (just to edit document)
359 if NOT fConvertChartTo3D() then
360 warnlog "Conversion of chart to 3D failed -> Quit testcase"
364 '/// Unselect chart using Escape key
365 Kontext "DocumentCalc"
366 DocumentCalc.TypeKeys "<Escape>"
367 '/// Save document as StarCalc 5.0 Template(.vor)
368 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarCalc 5.0 Vorlage/Template" ) then
369 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
374 Kontext "DocumentCalc"
375 DocumentCalc.TypeKeys "<Escape>"
379 '-------------------------------------------------------------
382 printlog "Load simple chart document"
383 if fLoadVerySimpleChartAndSaveLocal() > 0 then
384 warnlog "Loading test document seems to have failed -> Check this out!"
387 printlog "Select chart using navigator"
389 printlog "Invoke Edit / Object / Edit to enter Inplace Mode"
391 printlog "Convert chart to 3D (just to edit document)"
392 if NOT fConvertChartTo3D() then
393 warnlog "Conversion of chart to 3D failed -> Quit testcase"
397 printlog "Unselect chart using Escape key"
398 Kontext "DocumentCalc"
399 DocumentCalc.TypeKeys "<Escape>"
401 printlog "File / Reload"
403 printlog "MsgBox 'Cancel all changes?' should be visible -> Commit OK"
407 printlog "Close document ///"