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_214_.inc,v $
12 '* last change: $Author: fredrikh $ $Date: 2008-06-18 15:03:47 $
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 '\***********************************************************************
42 Call WriterToHTMLField
43 Call WriterToHTMLTable
44 Call WriterToHTMLFrame
45 Call WriterToHTMLDrawingObject
46 Call WriterToHTMLGraphicLinked
47 Call WriterToHTMLGraphicEmbedded
48 Call WriterToHTMLOLEObject
49 Call WriterToHTMLControl
53 ' ---------------------------------------------------------------------------------
55 testcase WriterToHTMLText
56 gApplication = "WRITER"
57 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
58 printlog " + Jump to beginning of document "
59 printlog " + Select first paragraph "
60 printlog " + Copy selected text "
61 if wSetClipboardtestDefaults("text") = True then
63 printlog " + Open new document "
65 printlog " + Edit / Paste Special "
68 EditPasteSpecialWriter
70 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
71 Call hCloseDocument ' Close Source-File
72 Call hCloseDocument ' Close Target-File
76 printlog " Paste 'Text' in all available clipboard formats "
77 Kontext "InhaltEinfuegen"
78 if InhaltEinfuegen.Exists then
79 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
80 printlog " + Write Clipboard format under pasted content "
81 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_text.html", "HTML")
82 printlog " + Save document as ..\user\work\writer_to_html_text.html"
85 printlog " + Close saved document "
87 Call hFileOpen (gOfficepath + "user\work\writer_to_html_text.html")
88 printlog " + Reopen saved document "
91 printlog " + Close saved document "
93 Warnlog "Dialog 'Paste Special' is not up!"
98 Warnlog "Writer To HTML -> 'Text' failed !"
100 printlog " Close active document "
101 Do Until GetDocumentCount = 0
106 ' ----------------------------------------------------------------------------------------------
108 testcase WriterToHTMLField
109 gApplication = "WRITER"
110 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
111 printlog " + Jump to beginning of document "
112 printlog " + Select paragraph with 'Date Field' "
113 printlog " + Copy selected text "
114 if wSetClipboardtestDefaults("field") = True then
115 gApplication = "HTML"
116 printlog " + Open new document "
118 printlog " + Edit / Paste Special "
121 EditPasteSpecialWriter
123 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
124 Call hCloseDocument ' Close Source-File
125 Call hCloseDocument ' Close Target-File
129 printlog " Paste 'Field' in all available clipboard formats "
130 Kontext "InhaltEinfuegen"
131 if InhaltEinfuegen.Exists then
132 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
133 printlog " + Write Clipboard format under pasted content "
134 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_field.html", "HTML")
135 printlog " + Save document as ..\user\work\writer_to_html_field.html"
138 printlog " + Close saved document "
140 Call hFileOpen (gOfficepath + "user\work\writer_to_html_field.html")
141 printlog " + Reopen saved document "
144 printlog " + Close saved document "
146 Warnlog "Dialog 'Paste Special' is not up!"
151 Warnlog "Writer To HTML -> 'Field' failed !"
153 printlog " Close active document "
154 Do Until GetDocumentCount = 0
159 ' ----------------------------------------------------------------------------------------------
161 testcase WriterToHTMLTable
162 gApplication = "WRITER"
163 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
164 printlog " + Jump to beginning of document "
165 printlog " + Select 'Table' "
166 printlog " + Copy selected table "
167 if wSetClipboardtestDefaults("table") = True then
168 gApplication = "HTML"
169 printlog " + Open new document "
171 printlog " + Edit / Paste Special "
174 EditPasteSpecialWriter
176 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
177 Call hCloseDocument ' Close Source-File
178 Call hCloseDocument ' Close Target-File
182 printlog " Paste 'Table' in all available clipboard formats "
183 Kontext "InhaltEinfuegen"
184 if InhaltEinfuegen.Exists then
185 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
186 printlog " + Write Clipboard format under pasted content "
187 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_table.html", "HTML")
188 printlog " + Save document as ..\user\work\writer_to_html_table.html"
191 printlog " + Close saved document "
193 Call hFileOpen (gOfficepath + "user\work\writer_to_html_table.html")
194 printlog " + Reopen saved document "
197 printlog " + Close saved document "
199 Warnlog "Dialog 'Paste Special' is not up!"
204 Warnlog "Writer To HTML -> 'Table' failed !"
206 printlog " Close active document "
207 Do Until GetDocumentCount = 0
212 ' ----------------------------------------------------------------------------------------------
214 testcase WriterToHTMLFrame
215 gApplication = "WRITER"
216 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
217 printlog " + Jump to beginning of document "
218 printlog " + Select 'Frame' "
219 printlog " + Copy selected frame "
220 if wSetClipboardtestDefaults("frame") = True then
221 gApplication = "HTML"
222 printlog " + Open new document "
224 printlog " + Edit / Paste Special "
227 EditPasteSpecialWriter
229 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
230 Call hCloseDocument ' Close Source-File
231 Call hCloseDocument ' Close Target-File
235 printlog " Paste 'Table' in all available clipboard formats "
236 Kontext "InhaltEinfuegen"
237 if InhaltEinfuegen.Exists then
238 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"frame")
239 printlog " + Write Clipboard format under pasted content "
240 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_frame.html", "HTML")
241 printlog " + Save document as ..\user\work\writer_to_html_frame.html"
244 printlog " + Close saved document "
246 Call hFileOpen (gOfficepath + "user\work\writer_to_html_frame.html")
247 printlog " + Reopen saved document "
250 printlog " + Close saved document "
252 Warnlog "Dialog 'Paste Special' is not up!"
257 Warnlog "Writer To HTML -> 'Frame' failed !"
259 printlog " Close active document "
260 Do Until GetDocumentCount = 0
265 ' ----------------------------------------------------------------------------------------------
267 testcase WriterToHTMLDrawingObject
268 gApplication = "WRITER"
269 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
270 printlog " + Jump to beginning of document "
271 printlog " + Select 'Drawing Object' "
272 printlog " + Copy selected Drawing Object "
273 if wSetClipboardtestDefaults("DRAW") = True then
274 gApplication = "HTML"
275 printlog " + Open new document "
277 printlog " + Edit / Paste Special "
280 EditPasteSpecialWriter
282 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
283 Call hCloseDocument ' Close Source-File
284 Call hCloseDocument ' Close Target-File
288 printlog " Paste 'Table' in all available clipboard formats "
289 Kontext "InhaltEinfuegen"
290 if InhaltEinfuegen.Exists then
291 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
292 printlog " + Write Clipboard format under pasted content "
293 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_draw.html", "HTML")
294 printlog " + Save document as ..\user\work\writer_to_html_draw.html"
297 printlog " + Close saved document "
299 Call hFileOpen (gOfficepath + "user\work\writer_to_html_draw.html")
300 printlog " + Reopen saved document "
303 printlog " + Close saved document "
305 Warnlog "Dialog 'Paste Special' is not up!"
310 Warnlog "Writer To HTML -> 'Drawing Object' failed !"
312 printlog " Close active document "
313 Do Until GetDocumentCount = 0
318 ' ----------------------------------------------------------------------------------------------
320 testcase WriterToHTMLGraphicLinked
321 gApplication = "WRITER"
322 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
323 printlog " + Jump to beginning of document "
324 printlog " + Select 'Linked Graphic' "
325 printlog " + Copy selected Linked Graphic "
326 if wSetClipboardtestDefaults("graphicL") = True then
327 gApplication = "HTML"
328 printlog " + Open new document "
330 printlog " + Edit / Paste Special "
333 EditPasteSpecialWriter
335 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
336 Call hCloseDocument ' Close Source-File
337 Call hCloseDocument ' Close Target-File
341 printlog " Paste 'Linked Graphic' in all available clipboard formats "
342 Kontext "InhaltEinfuegen"
343 if InhaltEinfuegen.Exists then
344 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
345 printlog " + Write Clipboard format under pasted content "
346 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_graphic1.html", "HTML")
347 printlog " + Save document as ..\user\work\writer_to_html_graphic1.html"
350 printlog " + Close saved document "
352 Call hFileOpen (gOfficepath + "user\work\writer_to_html_graphic1.html")
353 printlog " + Reopen saved document "
356 printlog " + Close saved document "
358 Warnlog "Dialog 'Paste Special' is not up!"
363 Warnlog "Writer To HTML -> 'Linked Graphic' failed !"
365 printlog " Close active document "
366 Do Until GetDocumentCount = 0
371 ' ----------------------------------------------------------------------------------------------
373 testcase WriterToHTMLGraphicEmbedded
374 gApplication = "WRITER"
375 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
376 printlog " + Jump to beginning of document "
377 printlog " + Select 'Embedded Graphic' "
378 printlog " + Copy selected Embedded Graphic "
379 if wSetClipboardtestDefaults("graphicE") = True then
380 gApplication = "HTML"
381 printlog " + Open new document "
383 printlog " + Edit / Paste Special "
386 EditPasteSpecialWriter
388 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
389 Call hCloseDocument ' Close Source-File
390 Call hCloseDocument ' Close Target-File
394 printlog " Paste 'Embedded Graphic' in all available clipboard formats "
395 Kontext "InhaltEinfuegen"
396 if InhaltEinfuegen.Exists then
397 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicE")
398 printlog " + Write Clipboard format under pasted content "
399 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_graphic2.html", "HTML")
400 printlog " + Save document as ..\user\work\writer_to_html_graphic2.html"
403 printlog " + Close saved document "
405 Call hFileOpen (gOfficepath + "user\work\writer_to_html_graphic2.html")
406 printlog " + Reopen saved document "
409 printlog " + Close saved document "
411 Warnlog "Dialog 'Paste Special' is not up!"
416 Warnlog "Writer To HTML -> 'Embedded Graphic' failed !"
418 printlog " Close active document "
419 Do Until GetDocumentCount = 0
424 ' ----------------------------------------------------------------------------------------------
426 testcase WriterToHTMLOLEObject
427 gApplication = "WRITER"
428 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
429 printlog " + Jump to beginning of document "
430 printlog " + Select 'OLE Object' "
431 printlog " + Copy selected OLE Object "
432 if wSetClipboardtestDefaults("ole") = True then
433 gApplication = "HTML"
434 printlog " + Open new document "
436 printlog " + Edit / Paste Special "
439 EditPasteSpecialWriter
441 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
442 Call hCloseDocument ' Close Source-File
443 Call hCloseDocument ' Close Target-File
447 printlog " Paste 'OLE object' in all available clipboard formats "
448 Kontext "InhaltEinfuegen"
449 if InhaltEinfuegen.Exists then
450 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ole")
451 printlog " + Write Clipboard format under pasted content "
452 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_ole.html", "HTML")
453 printlog " + Save document as ..\user\work\writer_to_html_ole.html"
456 printlog " + Close saved document "
458 Call hFileOpen (gOfficepath + "user\work\writer_to_html_ole.html")
459 printlog " + Reopen saved document "
462 printlog " + Close saved document "
464 Warnlog "Dialog 'Paste Special' is not up!"
469 Warnlog "Writer To HTML -> 'OLE object' failed !"
471 printlog " Close active document "
472 Do Until GetDocumentCount = 0
477 ' ----------------------------------------------------------------------------------------------
479 testcase WriterToHTMLControl
480 gApplication = "WRITER"
481 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
482 printlog " + Jump to beginning of document "
483 printlog " + Select 'Control' "
484 printlog " + Copy selected Control "
485 if wSetClipboardtestDefaults("control") = True then
486 gApplication = "HTML"
487 printlog " + Open new document "
489 printlog " + Edit / Paste Special "
492 EditPasteSpecialWriter
494 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
495 Call hCloseDocument ' Close Source-File
496 Call hCloseDocument ' Close Target-File
500 printlog " Paste 'Control' in all available clipboard formats "
501 Kontext "InhaltEinfuegen"
502 if InhaltEinfuegen.Exists then
503 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
504 printlog " + Write Clipboard format under pasted content "
505 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_html_control.html", "HTML")
506 printlog " + Save document as ..\user\work\writer_to_html_control.html"
509 printlog " + Close saved document "
511 Call hFileOpen (gOfficepath + "user\work\writer_to_html_control.html")
512 printlog " + Reopen saved document "
515 printlog " + Close saved document "
517 Warnlog "Dialog 'Paste Special' is not up!"
522 Warnlog "Writer To HTML -> 'Control' failed !"
524 printlog " Close active document "
525 Do Until GetDocumentCount = 0
530 '------------------------------------------------------------------------------------------------------