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 : thorsten.bosbach@oracle.com
30 '* short description : File / New-Saving-Loading-Saving-Loading
32 '\***********************************************************************
36 PrintLog Chr(13)+"****** File / New-Saving-Loading-Saving-Loading ******"
37 gApplication = "WRITER"
41 gApplication = "IMPRESS"
49 gApplication = "MASTERDOCUMENT"
54 ' --------------------------------------------------------------------------------
56 testcase tFileLoadSave
66 Dim vExtension(10) as string
68 DefFilter$ = hGetFilter( "current" )
70 if gApplication = "HTML" then
71 'hGetFilternameExtension is able to read more than one extension entry
72 vExtension() = hGetFilternameExtension("writer_web_HTML")
73 DokName1$ = "ls_test1" & "." & vExtension(0)
74 Dokname2$ = "ls_test2" & "." & vExtension(0)
76 DokName1$ = "ls_test1" & hGetSuffix( "current" )
77 DokName2$ = "ls_test2" & hGetSuffix( "current" )
80 PrintLog Chr(13)+"** " + gApplication
84 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
85 Kontext "DocumentWriter"
86 DocumentWriter.TypeKeys gApplication + " => Load - Save - Load - Save<Return>"
87 DocumentWriter.TypeKeys "- first saving / loading<Return>"
90 if gApplication = "CALC" then
91 Kontext "DocumentCalc"
92 DocumentCalc.TypeKeys "Testdokument => Load - Save - Load - Save<Return>"
93 DocumentCalc.TypeKeys "- first saving / loading<Return>"
96 if gApplication = "MATH" then
97 SchreibenInMathDok "a over 2 = 3 over d"
101 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
102 hRechteckErstellen ( 30, 30, 60, 60 )
105 DefaultPfad$ = ConvertPath ( gOfficePath + "user\work\" )
106 Datei1$ = ConvertPath ( DefaultPfad$+DokName1 )
107 Datei2$ = ConvertPath ( DefaultPfad$+DokName2 )
109 if app.Dir (Datei1$) <> "" then app.kill Datei1$
110 if app.Dir (Datei2$) <> "" then app.kill Datei2$
113 PrintLog "- first saving"
114 hFileSaveAsKill ( Datei1$ )
116 PrintLog "- change and save"
117 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
118 Kontext "DocumentWriter"
119 DocumentWriter.TypeKeys "- file/save<Return>"
122 if gApplication = "CALC" then
123 Kontext "DocumentCalc"
124 DocumentCalc.TypeKeys "- file/save<Return>"
127 if gApplication = "MATH" then
128 SchreibenInMathDok "file save : 4 over 5 = 3 over d"
132 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
133 hRechteckErstellen ( 10, 10, 20, 20 )
139 Call hCloseDocument()
141 PrintLog "- first loading"
142 hFileOpen ( Datei1$ )
145 if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
146 Kontext "DocumentWriter"
147 gMouseClick ( 50, 50 )
148 Kontext "DocumentWriter"
149 DocumentWriter.TypeKeys "<Down>", 4
150 DocumentWriter.TypeKeys "<Return>- second saving / loading"
153 if gApplication = "CALC" then
154 Kontext "DocumentCalc"
155 gMouseClick ( 50, 50 )
156 DocumentCalc.TypeKeys "<Down>", 4
157 DocumentCalc.TypeKeys "<Return>- second saving / loading"
160 if gApplication = "MATH" then
161 SchreibenInMathDok "file save : 4 over 5 = 3 over d"
165 if gApplication = "DRAW" OR gApplication = "IMPRESS" then
166 hRechteckErstellen ( 65, 65, 75, 75 )
169 PrintLog "- second saving"
170 hFileSaveAsKill ( Datei2$ )
173 PrintLog "- second loading"
174 hFileOpen ( Datei2$ )
177 if Navigator.Exists(5) then Navigator.Close