1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* Copyright 2008 by Sun Microsystems, Inc.
6 '* OpenOffice.org - a multi-platform office productivity suite
8 '* $RCSfile: w_220_.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:25:27 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/************************************************************************
33 '* owner : helge.delfs@sun.com
35 '* short description : CROSS-APPLICATIONS CLIPBOARD TEST (Writer)
37 '\***********************************************************************
44 Call HTMLToHTMLGraphicLinked
45 Call HTMLToHTMLControl
46 Call HTMLToHTMLFloatingFrame
50 ' ---------------------------------------------------------------------------------
52 testcase HTMLToHTMLText
54 ' if lcase(gPlatform) = "x86" and Val(mid$(gMinor, 2, Len(gMinor))) <= 129 then
55 ' QAErrorlog "#125780#Stacktrace ID: 251397"
59 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
60 printlog " Jump to beginning of document "
61 printlog " Select first paragraph "
62 printlog " Copy selected text "
63 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
64 Call sMakeReadOnlyDocumentEditable
65 printlog " Jump to beginning of document "
66 Call wTypeKeys "<Mod1 Home>"
67 Call wTypeKeys "<Shift Down><Shift End>"
71 printlog " Open new document "
73 printlog " Edit / Paste Special "
76 EditPasteSpecialWriter
78 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
79 Call hCloseDocument ' Close Source-File
80 Call hCloseDocument ' Close Target-File
84 printlog " Paste 'Text' in all available clipboard formats "
85 Kontext "InhaltEinfuegen"
86 if InhaltEinfuegen.Exists then
87 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
88 printlog " Write Clipboard format under pasted content "
89 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_text.html", "HTML")
90 printlog " Save document as ..\user\work\html_to_html_text.html"
93 printlog " Close saved document "
95 Call hFileOpen (gOfficepath + "user\work\html_to_html_text.html",false)
96 printlog " Reopen saved document "
99 printlog " Close saved document "
101 Warnlog "Dialog 'Paste Special' is not up!"
105 printlog " Close active document "
106 Do Until GetDocumentCount = 0
111 ' ----------------------------------------------------------------------------------------------
113 testcase HTMLToHTMLField
114 gApplication = "HTML"
115 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
116 printlog " Jump to beginning of document "
117 printlog " Select paragraph with 'Date Field' "
118 printlog " Copy selected text "
119 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
120 Call sMakeReadOnlyDocumentEditable
121 printlog " Jump to beginning of document "
122 Call wTypeKeys "<Mod1 Home>"
123 Call wTypeKeys "<Down>",2
124 Call wTypeKeys "<Home><Shift End>"
127 gApplication = "HTML"
128 printlog " Open new document "
130 printlog " Edit / Paste Special "
133 EditPasteSpecialWriter
135 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
136 Call hCloseDocument ' Close Source-File
137 Call hCloseDocument ' Close Target-File
141 printlog " Paste 'Field' in all available clipboard formats "
142 Kontext "InhaltEinfuegen"
143 if InhaltEinfuegen.Exists then
144 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
145 printlog " Write Clipboard format under pasted content "
146 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_field.html", "HTML")
147 printlog " Save document as ..\user\work\html_to_html_field.html"
150 printlog " Close saved document "
152 Call hFileOpen (gOfficepath + "user\work\html_to_html_field.html",false)
153 printlog " Reopen saved document "
156 printlog " Close saved document "
158 Warnlog "Dialog 'Paste Special' is not up!"
162 printlog " Close active document "
163 Do Until GetDocumentCount = 0
168 ' ----------------------------------------------------------------------------------------------
170 testcase HTMLToHTMLTable
171 gApplication = "HTML"
172 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
173 printlog " Jump to beginning of document "
174 printlog " Select 'Table' "
175 printlog " Copy selected table "
176 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
177 Call sMakeReadOnlyDocumentEditable
178 printlog " Jump to beginning of document "
179 Call wTypeKeys "<Mod1 Home>"
180 Call wTypeKeys "<Down>",5
181 Call wTypeKeys "<Mod1 A>",2
184 gApplication = "HTML"
185 printlog " Open new document "
187 printlog " Edit / Paste Special "
190 EditPasteSpecialWriter
192 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
193 Call hCloseDocument ' Close Source-File
194 Call hCloseDocument ' Close Target-File
198 printlog " Paste 'Table' in all available clipboard formats "
199 Kontext "InhaltEinfuegen"
200 if InhaltEinfuegen.Exists then
201 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
202 printlog " Write Clipboard format under pasted content "
203 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_table.html", "HTML")
204 printlog " Save document as ..\user\work\html_to_html_table.html"
207 printlog " Close saved document "
209 Call hFileOpen (gOfficepath + "user\work\html_to_html_table.html",false)
210 printlog " Reopen saved document "
213 printlog " Close saved document "
215 Warnlog "Dialog 'Paste Special' is not up!"
219 printlog " Close active document "
220 Do Until GetDocumentCount = 0
225 ' ----------------------------------------------------------------------------------------------
227 testcase HTMLToHTMLGraphicLinked
228 gApplication = "HTML"
229 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
230 printlog " Jump to beginning of document "
231 printlog " Select 'Linked Graphic' "
232 printlog " Copy selected Linked Graphic "
233 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
234 Call sMakeReadOnlyDocumentEditable
235 printlog " Jump to beginning of document "
236 Call wTypeKeys "<Mod1 Home>"
237 Call wTypeKeys ( "<Shift F4>" )
240 gApplication = "HTML"
241 printlog " Open new document "
243 printlog " Edit / Paste Special "
246 EditPasteSpecialWriter
248 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
249 Call hCloseDocument ' Close Source-File
250 Call hCloseDocument ' Close Target-File
254 printlog " Paste 'Linked Graphic' in all available clipboard formats "
255 Kontext "InhaltEinfuegen"
256 if InhaltEinfuegen.Exists then
257 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
258 printlog " Write Clipboard format under pasted content "
259 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_graphic1.html", "HTML")
260 printlog " Save document as ..\user\work\html_to_html_graphic1.html"
263 printlog " Close saved document "
265 Call hFileOpen (gOfficepath + "user\work\html_to_html_graphic1.html",false)
266 printlog " Reopen saved document "
269 printlog " Close saved document "
271 Warnlog "Dialog 'Paste Special' is not up!"
275 printlog " Close active document "
276 Do Until GetDocumentCount = 0
281 ' ----------------------------------------------------------------------------------------------
283 testcase HTMLToHTMLControl
284 gApplication = "HTML"
285 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
286 printlog " Jump to beginning of document "
287 printlog " Select 'Control' "
288 printlog " Copy selected Control "
289 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
290 Call sMakeReadOnlyDocumentEditable
291 printlog " Jump to beginning of document "
292 Call wTypeKeys "<Mod1 Home>"
293 Call wTypeKeys ( "<Shift F4>" )
294 Call wTypeKeys "<Tab>"
297 gApplication = "HTML"
298 printlog " Open new document "
300 printlog " Edit / Paste Special "
303 EditPasteSpecialWriter
305 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
306 Call hCloseDocument ' Close Source-File
307 Call hCloseDocument ' Close Target-File
311 printlog " Paste 'Control' in all available clipboard formats "
312 Kontext "InhaltEinfuegen"
313 if InhaltEinfuegen.Exists then
314 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
315 printlog " Write Clipboard format under pasted content "
316 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_control.html", "HTML")
317 printlog " Save document as ..\user\work\html_to_html_control.html"
320 printlog " Close saved document "
322 Call hFileOpen (gOfficepath + "user\work\html_to_html_control.html",false)
323 printlog " Reopen saved document "
326 printlog " Close saved document "
328 Warnlog "Dialog 'Paste Special' is not up!"
332 printlog " Close active document "
333 Do Until GetDocumentCount = 0
338 ' ----------------------------------------------------------------------------------------------
340 testcase HTMLToHTMLFloatingFrame
341 gApplication = "HTML"
342 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
343 printlog " Jump to beginning of document "
344 printlog " Select 'Floating Frame' "
345 printlog " Copy selected Floating Frame "
346 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
347 Call sMakeReadOnlyDocumentEditable
348 printlog " Jump to beginning of document "
349 Call wTypeKeys "<Mod1 Home>"
350 Call wTypeKeys ( "<Shift F4>" )
351 Call wTypeKeys "<Tab>",2
355 Warnlog "Edit / Copy is disabled ! Maybe object not selected!"
359 gApplication = "HTML"
360 printlog " Open new document "
362 printlog " Edit / Paste Special "
365 EditPasteSpecialWriter
367 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
368 Call hCloseDocument ' Close Source-File
369 Call hCloseDocument ' Close Target-File
373 printlog " Paste 'Floating Frame' in all available clipboard formats "
374 Kontext "InhaltEinfuegen"
375 if InhaltEinfuegen.Exists then
376 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
377 printlog " Write Clipboard format under pasted content "
378 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_html_float.html", "HTML")
379 printlog " Save document as ..\user\work\html_to_html_float.html"
382 printlog " Close saved document "
384 Call hFileOpen (gOfficepath + "user\work\html_to_html_float.html",false)
385 printlog " Reopen saved document "
388 printlog " Close saved document "
390 Warnlog "Dialog 'Paste Special' is not up!"
394 printlog " Close active document "
395 Do Until GetDocumentCount = 0