merge the formfield patch from ooo-build
[ooovba.git] / testautomation / writer / optional / includes / clipboard / w_212_.inc
blob47e0d1e52235d4a62c34343e44df4e4199bb6da1
1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 '* 
4 '* Copyright 2008 by Sun Microsystems, Inc.
5 '*
6 '* OpenOffice.org - a multi-platform office productivity suite
7 '*
8 '* $RCSfile: w_212_.inc,v $
9 '*
10 '* $Revision: 1.1 $
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 '\***********************************************************************
39 sub w_212_
41     Call wDisableImpressAutopilot
42     Call WriterToImpressText
43     Call WriterToImpressField
44     Call WriterToImpressTable
45     Call WriterToImpressFrame
46     Call WriterToImpressDrawingObject
47     Call WriterToImpressGraphicLinked
48     Call WriterToImpressGraphicEmbedded
49     Call WriterToImpressOLEObject
50     Call WriterToImpressControl
52 end sub
54 ' ---------------------------------------------------------------------------------
56 testcase WriterToImpressText
57     gApplication = "WRITER"
58     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
59     printlog " Jump to beginning of document "
60     printlog " Select first paragraph "
61     printlog " Copy selected text "
62     if wSetClipboardtestDefaults("text") = True then
63         gApplication = "IMPRESS"
64         printlog " Open new document "
65         Call hNewDocument
66         printlog " Edit / Paste Special "
67         Sleep 2
68         try
69             EditPasteSpecial
70         catch
71             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
72             Call hCloseDocument
73             wait 500
74             Call hCloseDocument
75             goto endsub
76         endcatch
77         Wait 500
78         printlog " Paste 'Text' in all available clipboard formats "
79         Kontext "InhaltEinfuegen"
80         if InhaltEinfuegen.Exists then
81             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
82             printlog " Write Clipboard format under pasted content "
83             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_text.odp", "impress8")
84             printlog " Save document as ..\user\work\writer_to_impress_text.odp"
85             Wait 500
86             Call hCloseDocument
87             printlog " Close saved document "
88             wait 500
89             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_text.odp",false)
90             printlog " Reopen saved document "
91             Wait 500
92             Call hCloseDocument
93             printlog " Close saved document "
94         else
95             Warnlog "Dialog 'Paste Special' is not up!"
96             Call hCloseDocument
97             goto endsub
98         end if
99     else
100         Warnlog "Writer To Impress -> 'Text' failed !"
101     end if
102     printlog " Close active document "
103     Do Until GetDocumentCount = 0
104         Call hCloseDocument
105     Loop
106 endcase
108 ' ----------------------------------------------------------------------------------------------
110 testcase WriterToImpressField
111     gApplication = "WRITER"
112     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
113     printlog " Jump to beginning of document "
114     printlog " Select paragraph with 'Date Field' "
115     printlog " Copy selected text "
116     if wSetClipboardtestDefaults("field") = True then
117         gApplication = "IMPRESS"
118         printlog " Open new document "
119         Call hNewDocument
120         printlog " Edit / Paste Special "
121         Sleep 2
122         try
123             EditPasteSpecial
124         catch
125             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
126             Call hCloseDocument
127             wait 500
128             Call hCloseDocument
129             goto endsub
130         endcatch
131         Wait 500
132         printlog " Paste 'Field' in all available clipboard formats "
133         Kontext "InhaltEinfuegen"
134         if InhaltEinfuegen.Exists then
135             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
136             printlog " Write Clipboard format under pasted content "
137             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_field.odp", "impress8")
138             printlog " Save document as ..\user\work\writer_to_impress_field.odp"
139             Wait 500
140             Call hCloseDocument
141             printlog " Close saved document "
142             wait 500
143             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_field.odp",false)
144             printlog " Reopen saved document "
145             Wait 500
146             Call hCloseDocument
147             printlog " Close saved document "
148         else
149             Warnlog "Dialog 'Paste Special' is not up!"
150             Call hCloseDocument
151             goto endsub
152         end if
153     else
154         Warnlog "Writer To Impress -> 'Field' failed !"
155     end if
156     printlog " Close active document "
157     Do Until GetDocumentCount = 0
158         Call hCloseDocument
159     Loop
160 endcase
162 ' ----------------------------------------------------------------------------------------------
164 testcase WriterToImpressTable
165     gApplication = "WRITER"
166     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
167     printlog " Jump to beginning of document "
168     printlog " Select 'Table' "
169     printlog " Copy selected table "
170     if wSetClipboardtestDefaults("table") = True then
171         gApplication = "IMPRESS"
172         printlog " Open new document "
173         Call hNewDocument
174         printlog " Edit / Paste Special "
175         Sleep 2
176         try
177             EditPasteSpecial
178         catch
179             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
180             Call hCloseDocument
181             wait 500
182             Call hCloseDocument
183             goto endsub
184         endcatch
185         Wait 500
186         printlog " Paste 'Table' in all available clipboard formats "
187         Kontext "InhaltEinfuegen"
188         if InhaltEinfuegen.Exists then
189             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
190             printlog " Write Clipboard format under pasted content "
191             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_table.odp", "impress8")
192             printlog " Save document as ..\user\work\writer_to_impress_table.odp"
193             Wait 500
194             Call hCloseDocument
195             printlog " Close saved document "
196             wait 500
197             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_table.odp",false)
198             printlog " Reopen saved document "
199             Wait 500
200             Call hCloseDocument
201             printlog " Close saved document "
202         else
203             Warnlog "Dialog 'Paste Special' is not up!"
204             Call hCloseDocument
205             goto endsub
206         end if
207     else
208         Warnlog "Writer To Impress -> 'Table' failed !"
209     end if
210     printlog " Close active document "
211     Do Until GetDocumentCount = 0
212         Call hCloseDocument
213     Loop
214 endcase
216 ' ----------------------------------------------------------------------------------------------
218 testcase WriterToImpressFrame
219     gApplication = "WRITER"
220     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
221     printlog " Jump to beginning of document "
222     printlog " Select 'Frame' "
223     printlog " Copy selected frame "
224     if wSetClipboardtestDefaults("frame") = True then
225         gApplication = "IMPRESS"
226         printlog " Open new document "
227         Call hNewDocument
228         printlog " Edit / Paste Special "
229         Sleep 2
230         try
231             EditPasteSpecial
232         catch
233             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
234             Call hCloseDocument
235             wait 500
236             Call hCloseDocument
237             goto endsub
238         endcatch
239         Wait 500
240         printlog " Paste 'Table' in all available clipboard formats "
241         Kontext "InhaltEinfuegen"
242         if InhaltEinfuegen.Exists then
243             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"frame")
244             printlog " Write Clipboard format under pasted content "
245             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_frame.odp", "impress8")
246             printlog " Save document as ..\user\work\writer_to_impress_frame.odp"
247             Wait 500
248             Call hCloseDocument
249             printlog " Close saved document "
250             wait 500
251             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_frame.odp",false)
252             printlog " Reopen saved document "
253             Wait 500
254             Call hCloseDocument
255             printlog " Close saved document "
256         else
257             Warnlog "Dialog 'Paste Special' is not up!"
258             Call hCloseDocument
259             goto endsub
260         end if
261     else
262         Warnlog "Writer To Impress -> 'Frame' failed !"
263     end if
264     printlog " Close active document "
265     Do Until GetDocumentCount = 0
266         Call hCloseDocument
267     Loop
268 endcase
270 ' ----------------------------------------------------------------------------------------------
272 testcase WriterToImpressDrawingObject
273     gApplication = "WRITER"
274     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
275     printlog " Jump to beginning of document "
276     printlog " Select 'Drawing Object' "
277     printlog " Copy selected Drawing Object "
278     if wSetClipboardtestDefaults("DRAW") = True then
279         gApplication = "IMPRESS"
280         printlog " Open new document "
281         Call hNewDocument
282         printlog " Edit / Paste Special "
283         Sleep 2
284         try
285             EditPasteSpecial
286         catch
287             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
288             Call hCloseDocument
289             wait 500
290             Call hCloseDocument
291             goto endsub
292         endcatch
293         Wait 500
294         printlog " Paste 'Table' in all available clipboard formats "
295         Kontext "InhaltEinfuegen"
296         if InhaltEinfuegen.Exists then
297             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
298             printlog " Write Clipboard format under pasted content "
299             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_draw.odp", "impress8")
300             printlog " Save document as ..\user\work\writer_to_impress_draw.odp"
301             Wait 500
302             Call hCloseDocument
303             printlog " Close saved document "
304             wait 500
305             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_draw.odp",false)
306             printlog " Reopen saved document "
307             Wait 500
308             Call hCloseDocument
309             printlog " Close saved document "
310         else
311             Warnlog "Dialog 'Paste Special' is not up!"
312             Call hCloseDocument
313             goto endsub
314         end if
315     else
316         Warnlog "Writer To Impress -> 'Drawing Object' failed !"
317     end if
318     printlog " Close active document "
319     Do Until GetDocumentCount = 0
320         Call hCloseDocument
321     Loop
322 endcase
324 ' ----------------------------------------------------------------------------------------------
326 testcase WriterToImpressGraphicLinked
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 = "IMPRESS"
334         printlog " Open new document "
335         Call hNewDocument
336         printlog " Edit / Paste Special "
337         Sleep 2
338         try
339             EditPasteSpecial
340         catch
341             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
342             Call hCloseDocument
343             wait 500
344             Call hCloseDocument
345             goto endsub
346         endcatch
347         Wait 500
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_impress_graphic1.odp", "impress8")
354             printlog " Save document as ..\user\work\writer_to_impress_graphic1.odp"
355             Wait 500
356             Call hCloseDocument
357             printlog " Close saved document "
358             wait 500
359             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_graphic1.odp",false)
360             printlog " Reopen saved document "
361             Wait 500
362             Call hCloseDocument
363             printlog " Close saved document "
364         else
365             Warnlog "Dialog 'Paste Special' is not up!"
366             Call hCloseDocument
367             goto endsub
368         end if
369     else
370         Warnlog "Writer To Impress -> 'Linked Graphic' failed !"
371     end if
372     printlog " Close active document "
373     Do Until GetDocumentCount = 0
374         Call hCloseDocument
375     Loop
376 endcase
378 ' ----------------------------------------------------------------------------------------------
380 testcase WriterToImpressGraphicEmbedded
381     gApplication = "WRITER"
382     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
383     printlog " Jump to beginning of document "
384     printlog " Select 'Embedded Graphic' "
385     printlog " Copy selected Embedded Graphic "
386     if wSetClipboardtestDefaults("graphicE") = True then
387         gApplication = "IMPRESS"
388         printlog " Open new document "
389         Call hNewDocument
390         printlog " Edit / Paste Special "
391         Sleep 2
392         try
393             EditPasteSpecial
394         catch
395             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
396             Call hCloseDocument
397             wait 500
398             Call hCloseDocument
399             goto endsub
400         endcatch
401         Wait 500
402         printlog " Paste 'Embedded Graphic' in all available clipboard formats "
403         Kontext "InhaltEinfuegen"
404         if InhaltEinfuegen.Exists then
405             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicE")
406             printlog " Write Clipboard format under pasted content "
407             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_graphic2.odp", "impress8")
408             printlog " Save document as ..\user\work\writer_to_impress_graphic2.odp"
409             Wait 500
410             Call hCloseDocument
411             printlog " Close saved document "
412             wait 500
413             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_graphic2.odp",false)
414             printlog " Reopen saved document "
415             Wait 500
416             Call hCloseDocument
417             printlog " Close saved document "
418         else
419             Warnlog "Dialog 'Paste Special' is not up!"
420             Call hCloseDocument
421             goto endsub
422         end if
423     else
424         Warnlog "Writer To Impress -> 'Embedded Graphic' failed !"
425     end if
426     printlog " Close active document "
427     Do Until GetDocumentCount = 0
428         Call hCloseDocument
429     Loop
430 endcase
432 ' ----------------------------------------------------------------------------------------------
434 testcase WriterToImpressOLEObject
435     gApplication = "WRITER"
436     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
437     printlog " Jump to beginning of document "
438     printlog " Select 'OLE Object' "
439     printlog " Copy selected OLE Object "
440     if wSetClipboardtestDefaults("ole") = True then
441         gApplication = "IMPRESS"
442         printlog " Open new document "
443         Call hNewDocument
444         printlog " Edit / Paste Special "
445         Sleep 2
446         try
447             EditPasteSpecial
448         catch
449             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
450             Call hCloseDocument
451             wait 500
452             Call hCloseDocument
453             goto endsub
454         endcatch
455         Wait 500
456         printlog " Paste 'OLE object' in all available clipboard formats "
457         Kontext "InhaltEinfuegen"
458         if InhaltEinfuegen.Exists then
459             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ole")
460             printlog " Write Clipboard format under pasted content "
461             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_ole.odp", "impress8")
462             printlog " Save document as ..\user\work\writer_to_impress_ole.odp"
463             Wait 500
464             Call hCloseDocument
465             printlog " Close saved document "
466             wait 500
467             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_ole.odp",false)
468             printlog " Reopen saved document "
469             Wait 500
470             Call hCloseDocument
471             printlog " Close saved document "
472         else
473             Warnlog "Dialog 'Paste Special' is not up!"
474             Call hCloseDocument
475             goto endsub
476         end if
477     else
478         Warnlog "Writer To Impress -> 'OLE object' failed !"
479     end if
480     printlog " Close active document "
481     Do Until GetDocumentCount = 0
482         Call hCloseDocument
483     Loop
484 endcase
486 ' ----------------------------------------------------------------------------------------------
488 testcase WriterToImpressControl
489     gApplication = "WRITER"
490     printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
491     printlog " Jump to beginning of document "
492     printlog " Select 'Control' "
493     printlog " Copy selected Control "
494     if wSetClipboardtestDefaults("control") = True then
495         gApplication = "IMPRESS"
496         printlog " Open new document "
497         Call hNewDocument
498         printlog " Edit / Paste Special "
499         Sleep 2
500         try
501             EditPasteSpecial
502         catch
503             Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
504             Call hCloseDocument
505             wait 500
506             Call hCloseDocument
507             goto endsub
508         endcatch
509         Wait 500
510         printlog " Paste 'Control' in all available clipboard formats "
511         Kontext "InhaltEinfuegen"
512         if InhaltEinfuegen.Exists then
513             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
514             printlog " Write Clipboard format under pasted content "
515             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_impress_control.odp", "impress8")
516             printlog " Save document as ..\user\work\writer_to_impress_control.odp"
517             Wait 500
518             Call hCloseDocument
519             printlog " Close saved document "
520             wait 500
521             Call hFileOpen (gOfficepath + "user\work\writer_to_impress_control.odp",false)
522             printlog " Reopen saved document "
523             Wait 500
524             Call hCloseDocument
525             printlog " Close saved document "
526         else
527             Warnlog "Dialog 'Paste Special' is not up!"
528             Call hCloseDocument
529             goto endsub
530         end if
531     else
532         Warnlog "Writer To Impress -> 'Control' failed !"
533     end if
534     printlog " Close active document "
535     Do Until GetDocumentCount = 0
536         Call hCloseDocument
537     Loop
538 endcase