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_213_.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 WriterToDrawField
43 Call WriterToDrawTable
44 Call WriterToDrawFrame
45 Call WriterToDrawDrawingObject
46 Call WriterToDrawGraphicLinked
47 Call WriterToDrawGraphicEmbedded
48 Call WriterToDrawOLEObject
49 Call WriterToDrawControl
53 ' ---------------------------------------------------------------------------------
55 testcase WriterToDrawText
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 "
70 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
77 printlog " Paste 'Text' in all available clipboard formats "
78 Kontext "InhaltEinfuegen"
79 if InhaltEinfuegen.Exists then
80 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
81 printlog " + Write Clipboard format under pasted content "
82 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_text.odg", "draw8")
83 printlog " + Save document as ..\user\work\writer_to_draw_text.odg"
86 printlog " + Close saved document "
88 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_text.odg",false)
89 printlog " + Reopen saved document "
92 printlog " + Close saved document "
94 Warnlog "Dialog 'Paste Special' is not up!"
99 Warnlog "Writer To Draw -> 'Text' failed !"
101 printlog " Close active document "
102 Do Until GetDocumentCount = 0
107 ' ----------------------------------------------------------------------------------------------
109 testcase WriterToDrawField
110 gApplication = "WRITER"
111 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
112 printlog " + Jump to beginning of document "
113 printlog " + Select paragraph with 'Date Field' "
114 printlog " + Copy selected text "
115 if wSetClipboardtestDefaults("field") = True then
116 gApplication = "DRAW"
117 printlog " + Open new document "
119 printlog " + Edit / Paste Special "
124 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
131 printlog " Paste 'Field' in all available clipboard formats "
132 Kontext "InhaltEinfuegen"
133 if InhaltEinfuegen.Exists then
134 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
135 printlog " + Write Clipboard format under pasted content "
136 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_field.odg", "draw8")
137 printlog " + Save document as ..\user\work\writer_to_draw_field.odg"
140 printlog " + Close saved document "
142 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_field.odg",false)
143 printlog " + Reopen saved document "
146 printlog " + Close saved document "
148 Warnlog "Dialog 'Paste Special' is not up!"
153 Warnlog "Writer To Draw -> 'Field' failed !"
155 printlog " Close active document "
156 Do Until GetDocumentCount = 0
161 ' ----------------------------------------------------------------------------------------------
163 testcase WriterToDrawTable
164 gApplication = "WRITER"
165 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
166 printlog " + Jump to beginning of document "
167 printlog " + Select 'Table' "
168 printlog " + Copy selected table "
169 if wSetClipboardtestDefaults("table") = True then
170 gApplication = "DRAW"
171 printlog " + Open new document "
173 printlog " + Edit / Paste Special "
178 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
185 printlog " Paste 'Table' in all available clipboard formats "
186 Kontext "InhaltEinfuegen"
187 if InhaltEinfuegen.Exists then
188 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
189 printlog " + Write Clipboard format under pasted content "
190 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_table.odg", "draw8")
191 printlog " + Save document as ..\user\work\writer_to_draw_table.odg"
194 printlog " + Close saved document "
196 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_table.odg",false)
197 printlog " + Reopen saved document "
200 printlog " + Close saved document "
202 Warnlog "Dialog 'Paste Special' is not up!"
207 Warnlog "Writer To Draw -> 'Table' failed !"
209 printlog " Close active document "
210 Do Until GetDocumentCount = 0
215 ' ----------------------------------------------------------------------------------------------
217 testcase WriterToDrawFrame
218 gApplication = "WRITER"
219 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
220 printlog " + Jump to beginning of document "
221 printlog " + Select 'Frame' "
222 printlog " + Copy selected frame "
223 if wSetClipboardtestDefaults("frame") = True then
224 gApplication = "DRAW"
225 printlog " + Open new document "
227 printlog " + Edit / Paste Special "
232 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
239 printlog " Paste 'Table' in all available clipboard formats "
240 Kontext "InhaltEinfuegen"
241 if InhaltEinfuegen.Exists then
242 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"frame")
243 printlog " + Write Clipboard format under pasted content "
244 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_frame.odg", "draw8")
245 printlog " + Save document as ..\user\work\writer_to_draw_frame.odg"
248 printlog " + Close saved document "
250 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_frame.odg",false)
251 printlog " + Reopen saved document "
254 printlog " + Close saved document "
256 Warnlog "Dialog 'Paste Special' is not up!"
261 Warnlog "Writer To Draw -> 'Frame' failed !"
263 printlog " Close active document "
264 Do Until GetDocumentCount = 0
269 ' ----------------------------------------------------------------------------------------------
271 testcase WriterToDrawDrawingObject
272 gApplication = "WRITER"
273 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
274 printlog " + Jump to beginning of document "
275 printlog " + Select 'Drawing Object' "
276 printlog " + Copy selected Drawing Object "
277 if wSetClipboardtestDefaults("DRAW") = True then
278 gApplication = "DRAW"
279 printlog " + Open new document "
281 printlog " + Edit / Paste Special "
286 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
293 printlog " Paste 'Table' in all available clipboard formats "
294 Kontext "InhaltEinfuegen"
295 if InhaltEinfuegen.Exists then
296 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
297 printlog " + Write Clipboard format under pasted content "
298 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_draw.odg", "draw8")
299 printlog " + Save document as ..\user\work\writer_to_draw_draw.odg"
302 printlog " + Close saved document "
304 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_draw.odg",false)
305 printlog " + Reopen saved document "
308 printlog " + Close saved document "
310 Warnlog "Dialog 'Paste Special' is not up!"
315 Warnlog "Writer To Draw -> 'Drawing Object' failed !"
317 printlog " Close active document "
318 Do Until GetDocumentCount = 0
323 ' ----------------------------------------------------------------------------------------------
325 testcase WriterToDrawGraphicLinked
326 EnableQaErrors = true
327 gApplication = "WRITER"
328 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
329 printlog " + Jump to beginning of document "
330 printlog " + Select 'Linked Graphic' "
331 printlog " + Copy selected Linked Graphic "
332 if wSetClipboardtestDefaults("graphicL") = True then
333 gApplication = "DRAW"
334 printlog " + Open new document "
336 printlog " + Edit / Paste Special "
341 warnlog "Check why linked graphic fails !"
348 printlog " Paste 'Linked Graphic' in all available clipboard formats "
349 Kontext "InhaltEinfuegen"
350 if InhaltEinfuegen.Exists then
351 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
352 printlog " + Write Clipboard format under pasted content "
353 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_graphic1.odg", "draw8")
354 printlog " + Save document as ..\user\work\writer_to_draw_graphic1.odg"
357 printlog " + Close saved document "
359 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_graphic1.odg",false)
360 printlog " + Reopen saved document "
363 printlog " + Close saved document "
365 Warnlog "Dialog 'Paste Special' is not up!"
370 Warnlog "Writer To Draw -> 'Linked Graphic' failed !"
372 printlog " Close active document "
373 Do Until GetDocumentCount = 0
376 EnableQaErrors = false
379 ' ----------------------------------------------------------------------------------------------
381 testcase WriterToDrawGraphicEmbedded
382 gApplication = "WRITER"
383 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
384 printlog " + Jump to beginning of document "
385 printlog " + Select 'Embedded Graphic' "
386 printlog " + Copy selected Embedded Graphic "
387 if wSetClipboardtestDefaults("graphicE") = True then
388 gApplication = "DRAW"
389 printlog " + Open new document "
391 printlog " + Edit / Paste Special "
396 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
403 printlog " Paste 'Embedded Graphic' in all available clipboard formats "
404 Kontext "InhaltEinfuegen"
405 if InhaltEinfuegen.Exists then
406 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicE")
407 printlog " + Write Clipboard format under pasted content "
408 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_graphic2.odg", "draw8")
409 printlog " + Save document as ..\user\work\writer_to_draw_graphic2.odg"
412 printlog " + Close saved document "
414 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_graphic2.odg",false)
415 printlog " + Reopen saved document "
418 printlog " + Close saved document "
420 Warnlog "Dialog 'Paste Special' is not up!"
425 Warnlog "Writer To Draw -> 'Embedded Graphic' failed !"
427 printlog " Close active document "
428 Do Until GetDocumentCount = 0
433 ' ----------------------------------------------------------------------------------------------
435 testcase WriterToDrawOLEObject
436 gApplication = "WRITER"
437 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
438 printlog " + Jump to beginning of document "
439 printlog " + Select 'OLE Object' "
440 printlog " + Copy selected OLE Object "
441 if wSetClipboardtestDefaults("ole") = True then
442 gApplication = "DRAW"
443 printlog " + Open new document "
445 printlog " + Edit / Paste Special "
450 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
457 printlog " Paste 'OLE object' in all available clipboard formats "
458 Kontext "InhaltEinfuegen"
459 if InhaltEinfuegen.Exists then
460 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ole")
461 printlog " + Write Clipboard format under pasted content "
462 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_ole.odg", "draw8")
463 printlog " + Save document as ..\user\work\writer_to_draw_ole.odg"
466 printlog " + Close saved document "
468 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_ole.odg",false)
469 printlog " + Reopen saved document "
472 printlog " + Close saved document "
474 Warnlog "Dialog 'Paste Special' is not up!"
479 Warnlog "Writer To Draw -> 'OLE object' failed !"
481 printlog " Close active document "
482 Do Until GetDocumentCount = 0
487 ' ----------------------------------------------------------------------------------------------
489 testcase WriterToDrawControl
490 gApplication = "WRITER"
491 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
492 printlog " + Jump to beginning of document "
493 printlog " + Select 'Control' "
494 printlog " + Copy selected Control "
495 if wSetClipboardtestDefaults("control") = True then
496 gApplication = "DRAW"
497 printlog " + Open new document "
499 printlog " + Edit / Paste Special "
504 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
511 printlog " Paste 'Control' in all available clipboard formats "
512 Kontext "InhaltEinfuegen"
513 if InhaltEinfuegen.Exists then
514 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
515 printlog " + Write Clipboard format under pasted content "
516 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_draw_control.odg", "draw8")
517 printlog " + Save document as ..\user\work\writer_to_draw_control.odg"
520 printlog " + Close saved document "
522 Call hFileOpen (gOfficepath + "user\work\writer_to_draw_control.odg",false)
523 printlog " + Reopen saved document "
526 printlog " + Close saved document "
528 Warnlog "Dialog 'Paste Special' is not up!"
533 Warnlog "Writer To Draw -> 'Control' failed !"
535 printlog " Close active document "
536 Do Until GetDocumentCount = 0