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: loadsave_files.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $
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 : thorsten.bosbach@sun.com
36 '* short description : File / New-Saving-Loading-Saving-Loading
38 '\***********************************************************************
42 PrintLog Chr(13)+"****** File / New-Saving-Loading-Saving-Loading ******"
43 gApplication = "WRITER"
47 gApplication = "IMPRESS"
55 gApplication = "MASTERDOCUMENT"
60 ' --------------------------------------------------------------------------------
62 testcase tFileLoadSave
63 '///general load-save-routine for level1-test
65 '///create the document and save it ( 'edit/save as' )
74 Dim vExtension(10) as string
76 DefFilter$ = hGetFilter( "current" )
78 if gApplication = "HTML" then
79 'hGetFilternameExtension is able to read more than one extension entry
80 vExtension() = hGetFilternameExtension("writer_web_HTML")
81 DokName1$ = "ls_test1" & "." & vExtension(0)
82 Dokname2$ = "ls_test2" & "." & vExtension(0)
84 DokName1$ = "ls_test1" & hGetSuffix( "current" )
85 DokName2$ = "ls_test2" & hGetSuffix( "current" )
88 PrintLog Chr(13)+"** " + gApplication
90 '///file/new/ -> all applications ( one by one )
93 '///+ insert a short text in Writer/MasterDoc/WriterWeb document
94 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
95 Kontext "DocumentWriter"
96 DocumentWriter.TypeKeys gApplication + " => Load - Save - Load - Save<Return>"
97 DocumentWriter.TypeKeys "- first saving / loading<Return>"
100 '///+_ or insert a short text in the Calc document
101 if gApplication = "CALC" then
102 Kontext "DocumentCalc"
103 DocumentCalc.TypeKeys "Testdokument => Load - Save - Load - Save<Return>"
104 DocumentCalc.TypeKeys "- first saving / loading<Return>"
107 '///+_ or insert a short text in the Math document
108 if gApplication = "MATH" then
109 SchreibenInMathDok "a over 2 = 3 over d"
113 '///+_ or create a rectangle in a Draw/Impress document
114 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
115 hRechteckErstellen ( 30, 30, 60, 60 )
118 DefaultPfad$ = ConvertPath ( gOfficePath + "user\work\" )
119 Datei1$ = ConvertPath ( DefaultPfad$+DokName1 )
120 Datei2$ = ConvertPath ( DefaultPfad$+DokName2 )
122 if app.Dir (Datei1$) <> "" then app.kill Datei1$
123 if app.Dir (Datei2$) <> "" then app.kill Datei2$
126 '///+ save the file locally
127 PrintLog "- first saving"
128 hFileSaveAsKill ( Datei1$ )
130 '///change the file and save if again ( edit/save )
131 PrintLog "- change and save"
132 '///+ insert a short text in Writer/MasterDoc/WriterWeb document
133 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
134 Kontext "DocumentWriter"
135 DocumentWriter.TypeKeys "- file/save<Return>"
138 '///+_ or insert a short text in the Calc document
139 if gApplication = "CALC" then
140 Kontext "DocumentCalc"
141 DocumentCalc.TypeKeys "- file/save<Return>"
144 '///+_ or insert a short text in the Math document
145 if gApplication = "MATH" then
146 SchreibenInMathDok "file save : 4 over 5 = 3 over d"
150 '///+_ or create a rectangle in a Draw/Impress document
151 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
152 hRechteckErstellen ( 10, 10, 20, 20 )
155 '///+file save ( edit/save )
158 '///+close the document
160 Call hCloseDocument()
162 '///load the file again change it and save it with another name
163 PrintLog "- first loading"
164 '///+ file/open the file
165 hFileOpen ( Datei1$ )
168 '///+ insert a short text in Writer/MasterDoc/WriterWeb document
169 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
170 Kontext "DocumentWriter"
171 gMouseClick ( 50, 50 )
172 Kontext "DocumentWriter"
173 DocumentWriter.TypeKeys "<Down>", 4
174 DocumentWriter.TypeKeys "<Return>- second saving / loading"
177 '///+_ or insert a short text in the Calc document
178 if gApplication = "CALC" then
179 Kontext "DocumentCalc"
180 gMouseClick ( 50, 50 )
181 DocumentCalc.TypeKeys "<Down>", 4
182 DocumentCalc.TypeKeys "<Return>- second saving / loading"
185 '///+_ or insert a short text in the Math document
186 if gApplication = "MATH" then
187 SchreibenInMathDok "file save : 4 over 5 = 3 over d"
191 '///+_ or create a rectangle in a Draw/Impress document
192 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
193 hRechteckErstellen ( 65, 65, 75, 75 )
196 '///+file save with another name ( edit/save as )
197 PrintLog "- second saving"
198 hFileSaveAsKill ( Datei2$ )
199 '///+close the document
202 '///+open it again ( file/open )
203 PrintLog "- second loading"
204 hFileOpen ( Datei2$ )
207 if Navigator.Exists(5) then Navigator.Close