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 : gregor.hartmann@oracle.com
30 '* short description : Smoke test (load/save/clipboard)
32 '\***********************************************************************
36 ' we need the binary filters (.sxw etc.) for this test but beginning with
37 ' OOo 3.3 these are optional
38 if ( hCheckForBinfilters() ) then
39 gApplication = "WRITER"
45 gApplication = "IMPRESS"
57 gApplication = "MASTERDOCUMENT"
62 '*******************************************************************************
66 dim sUserWorkDirectory as string
67 dim sFilename_native as String
68 dim sFilter_native as string
69 dim sFilter_export as String
70 dim bExportFile as boolean
72 sUserWorkDirectory = gOfficePath & "user\work\"
75 printlog( "Current document type: " & gApplication )
77 ' set the filenames and their filters. HTML is not exported
78 if ( gApplication = "HTML" ) then
79 sFilename_native = "ls_test.html"
82 sFilename_native = "ls_test" & hGetSuffix( "current" )
85 printlog( "File (current): " & sFilename_native )
87 ' Delete the workfiles, they might have been left over by prior incomplete testrun
88 hDeleteFile( sUserWorkDirectory & sFilename_native )
90 ' Set the API filternames for the current application (native XML format)
91 select case gApplication
92 case "WRITER" : sFilter_native = "writer8"
93 case "CALC" : sFilter_native = "calc8"
94 case "DRAW" : sFilter_native = "draw8"
95 case "IMPRESS" : sFilter_native = "impress8"
96 case "MATH" : sFilter_native = "math8"
97 case "MASTERDOCUMENT" : sFilter_native = "writerglobal8"
98 case "HTML" : sFilter_native = "HTML"
99 case else : warnlog "Invalid gApplication: " & gApplication
102 printlog( "Create a new document" )
105 printlog( "Clipboard" )
108 printlog( "Save (default-fileformat): " & sFilename_native )
109 call hFileSaveAsKill ( sUserWorkDirectory & sFilename_native )
114 if ( Active.Exists( 1 ) ) then
115 warnlog( "Unexpected Active after saving: '" & active.getText & "'" )
123 printlog( "Load (default-fileformat): " & sFilename_native )
124 call hFileOpen( sUserWorkDirectory & sFilename_native )
126 if ( bExportFile ) then
127 printlog( "Change the document" )
136 hDeleteFile( sUserWorkDirectory & sFilename_native )
140 '*******************************************************************************
143 dim sSelectAll as string
145 ' In Spain Select All is CTRL+E; CTRL+A is FileOpen
146 if (iSprache=34) then
147 sSelectAll = "<Mod1 e>"
149 sSelectAll = "<Mod1 a>"
152 select case gApplication
153 case "WRITER", "HTML", "MASTERDOCUMENT"
154 kontext "documentwriter"
155 DocumentWriter.TypeKeys "This is a test.<Return>"
157 DocumentWriter.TypeKeys sSelectAll
158 DocumentWriter.TypeKeys "<Mod1 x>"
161 DocumentWriter.TypeKeys "<Mod1 v>"
164 DocumentWriter.TypeKeys sSelectAll
165 DocumentWriter.TypeKeys "<Mod1 c>"
168 DocumentWriter.TypeKeys "<Mod1 v>"
170 case "CALC" : Kontext "DocumentCalc"
171 DocumentCalc.TypeKeys "This is a test.<Return>"
172 DocumentCalc.TypeKeys "<Up>"
174 DocumentCalc.TypeKeys "<Mod1 x>"
177 DocumentCalc.TypeKeys "<Down>"
178 DocumentCalc.TypeKeys "<Mod1 v>"
181 DocumentCalc.TypeKeys "<Mod1 c>"
184 DocumentCalc.TypeKeys "<Down>"
185 DocumentCalc.TypeKeys "<Mod1 v>"
187 case "DRAW" : Kontext "DocumentDraw"
188 hRechteckErstellen ( 30, 30, 60, 60 )
191 DocumentDraw.TypeKeys sSelectAll
192 DocumentDraw.TypeKeys "<Mod1 x>"
195 DocumentDraw.TypeKeys "<Mod1 v>"
199 DocumentDraw.TypeKeys sSelectAll
200 DocumentDraw.TypeKeys "<Mod1 c>"
204 DocumentDraw.TypeKeys "<Mod1 v>"
205 case "IMPRESS": Kontext "DocumentImpress"
206 hRechteckErstellen ( 30, 30, 60, 60 )
209 DocumentImpress.TypeKeys sSelectAll
210 DocumentImpress.TypeKeys "<Mod1 x>"
213 DocumentImpress.TypeKeys "<Mod1 v>"
217 DocumentImpress.TypeKeys sSelectAll
218 DocumentImpress.TypeKeys "<Mod1 c>"
222 DocumentImpress.TypeKeys "<Mod1 v>"
223 case "MATH" : SchreibenInMathdok "a over b"
225 hUseAsyncSlot( "EditSelectAllMath" )
226 hUseAsyncSlot( "EditCut" )
228 hUseAsyncSlot( "EditPaste" )
230 hUseAsyncSlot( "EditSelectAllMath" )
231 hUseAsyncSlot( "EditCopy" )
233 hUseAsyncSlot( "EditPaste" )