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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : oliver.craemer@oracle.com
30 '* short description : Chart resource test - Menu FILE
32 '************************************************************************
42 '\************************************************************************
45 '///<u><b>Dialog test after invocation of File::Close</b></u
46 '/// Load new document
48 '/// Insert default chart
52 '/// Leave wizard with OK
54 printlog "Left Chart wizard with OK"
58 printlog "File / Close executed"
67 '/// Check for File Save dialo
68 Kontext "SpeichernDlg"
69 '/// Cancel File Save dialog
78 '-----------------------------------------------------------
80 testcase tFileSaveAsOTS
81 '///<u><b>Save the test file as OpenDocument Spreadsheet Template (.ots)</b></u>
82 Dim sOutputFile as string
84 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.ots" )
86 '/// Load simple chart document
87 if fLoadVerySimpleChartAndSaveLocal() > 0 then
88 warnlog "Loading test document failed!"
91 printlog "Test document successfully been loaded."
93 '/// Select first OLE using the navigator
95 printlog "First OLE selected via navigator"
96 '/// Edit / Object / Edit to enter Inplace Mode
98 printlog "Edit / Object / Edit"
99 '/// Convert chart to 3D (just to edit document)
100 if NOT fConvertChartTo3D() then
101 warnlog "Conversion of chart to 3D failed -> Quit testcase"
105 printlog "Conversation of chart to 3D was successful."
107 '/// Unselect chart using Escape key
108 Kontext "DocumentCalc"
109 DocumentCalc.TypeKeys "<Escape>"
110 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8_template" ) then
111 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
115 '/// Clsoing the Navigator
116 Kontext "NavigatorCalc"
117 if NavigatorCalc.Exists(1) then
119 QAErrorLog "Why did fSelectFirstOLE not close this dialog?"
125 '-------------------------------------------------------------
127 testcase tFileSaveAsSXC
128 '///<u><b>Save the test file as StarOffice 6.0/7 Spreadsheet (.sxc)</b></u>
129 Dim sOutputFile as string
131 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.sxc" )
133 '/// Load simple chart document
134 if fLoadVerySimpleChartAndSaveLocal() > 0 then
135 warnlog "Loading test document failed!"
138 printlog "Loading test document was successful!"
140 '/// Select chart using navigator
142 printlog "First OLE selected via Navigator"
143 '/// Edit / Object / Edit to enter Inplace Mode
145 printlog "Edit / Object / Edit"
146 '/// Convert chart to 3D (just to edit document)
147 if NOT fConvertChartTo3D() then
148 warnlog "Conversion of chart to 3D failed -> Quit testcase"
152 '/// Unselect chart using Escape key
153 Kontext "DocumentCalc"
154 DocumentCalc.TypeKeys "<Escape>"
155 '/// Save document as StarOffice 6.0/7 Spreadsheet (.sxc)
156 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarOffice XML (Calc)") then
157 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
165 '-------------------------------------------------------------
167 testcase tFileSaveAsSTC
168 '///<u><b>Save the test file as StarOffice 6.0/7 Spreadsheet Template (.stc)</b></u>
169 Dim sOutputFile as string
171 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.stc" )
173 '/// Load simple chart document
174 if fLoadVerySimpleChartAndSaveLocal() > 0 then
175 warnlog "Loading test document seems to have failed -> Check this out!"
178 printlog "Simple chart document successfully been loaded."
180 '/// Select chart using navigator
182 '/// Edit / Object / Edit
184 '/// Convert chart to 3D (just to edit document)
185 if NOT fConvertChartTo3D() then
186 warnlog "Conversion of chart to 3D failed -> Quit testcase"
190 '/// Unselect chart using Escape key
191 Kontext "DocumentCalc"
192 DocumentCalc.TypeKeys "<Escape>"
193 '/// Save document as StarOffice 6.0/7 Spreadsheet Template (.stc)
194 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc_StarOffice_XML_Calc_Template" ) then
195 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
203 '-------------------------------------------------------------
205 testcase tFileSaveAsXLS
206 '///<u><b>Save the test file as Microsoft Excel 97/2000/XP (.xls)</b></u>
207 Dim sOutputFile as string
209 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.xls" )
211 '/// Load simple chart document <i>Testtoolpath</i>/chart2/required/input/verySimpleChart.ods
212 if fLoadVerySimpleChartAndSaveLocal() > 0 then
213 warnlog "Loading test document failed!"
216 '/// Edit / Navigator
217 '/// Select the first OLE object in the tree view of the Navigator
220 printlog "First OLE selected."
221 '/// Edit / Object / Edit to enter Inplace Mode
223 printlog "Edit / Object / Edit executed."
224 '/// Format / Chart Type
225 '/// Check 3D checkbox
226 '/// Close Chart Type dialog
227 if NOT fConvertChartTo3D() then
228 warnlog "Conversion of chart to 3D failed -> Quit testcase"
232 printlog "Chart type converted to 3D."
234 '/// Unselect chart using Escape key
235 Kontext "DocumentCalc"
236 DocumentCalc.TypeKeys "<Escape>"
237 '/// Save document as Microsoft Excel 97/2000/XP (.xls)
238 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "MS Excel 97" ) then
239 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
244 Kontext "DocumentCalc"
245 DocumentCalc.TypeKeys "<Escape>"
249 '-------------------------------------------------------------------------------
251 testcase tFileSaveAsXLT
252 '///<u><b>Save the test file as Microsoft Excel 97/2000/XP Template(.xlt)</b></u>
253 Dim sOutputFile as string
255 sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.xlt" )
257 '/// Load simple chart document <i>Testtoolpath</i>/chart2/required/input/verySimpleChart.ods
258 if fLoadVerySimpleChartAndSaveLocal() > 0 then
259 warnlog "Loading test document failed!"
262 '/// Edit / Navigator
263 '/// Select the first OLE object in the tree view of the Navigator
266 printlog "First OLE selected."
267 '/// Edit / Object / Edit to enter Inplace Mode
269 printlog "Edit / Object / Edit executed."
270 '/// Format / Chart Type
271 '/// Check 3D checkbox
272 '/// Close Chart Type dialog
273 if NOT fConvertChartTo3D() then
274 warnlog "Conversion of chart to 3D failed -> Quit testcase"
278 printlog "Chart type converted to 3D."
280 '/// Unselect chart using Escape key
281 Kontext "DocumentCalc"
282 DocumentCalc.TypeKeys "<Escape>"
283 '/// Save document as Microsoft Excel 97/2000/XP Template(.xlt)
284 if NOT hFileSaveAsWithFilterKill ( sOutputFile , "MS Excel 97 Vorlage/Template" ) then
285 warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
290 Kontext "DocumentCalc"
291 DocumentCalc.TypeKeys "<Escape>"
295 '-------------------------------------------------------------
299 printlog "Load simple chart document"
300 if fLoadVerySimpleChartAndSaveLocal() > 0 then
301 warnlog "Loading test document seems to have failed -> Check this out!"
304 printlog "Select chart using navigator"
306 printlog "Invoke Edit / Object / Edit to enter Inplace Mode"
308 printlog "Convert chart to 3D (just to edit document)"
309 if NOT fConvertChartTo3D() then
310 warnlog "Conversion of chart to 3D failed -> Quit testcase"
314 printlog "Unselect chart using Escape key"
315 Kontext "DocumentCalc"
316 DocumentCalc.TypeKeys "<Escape>"
318 printlog "File / Reload"
320 printlog "MsgBox 'Cancel all changes?' should be visible -> Commit OK"
324 printlog "Close document ///"