update dev300-m58
[ooovba.git] / testautomation / writer / optional / includes / clipboard / w_210_.inc
blob59de504ad3f2fd5875ec325c11c3d66fbba76e86
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_210_.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_210_
41     Call WriterToWriterText
42     Call WriterToWriterField
43     Call WriterToWriterTable
44     Call WriterToWriterFrame
45     Call WriterToWriterDrawingObject
46     Call WriterToWriterGraphicLinked
47     Call WriterToWriterGraphicEmbedded
48     Call WriterToWriterOLEObject
49     Call WriterToWriterControl
51 end sub
53 ' ---------------------------------------------------------------------------------
55 testcase WriterToWriterText
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
62         printlog " + Open new document "
63         Call hNewDocument
64         printlog " + Edit / Paste Special "
65         EditPasteSpecialWriter
66         Wait 500
67         printlog "  Paste 'Text' in all available clipboard formats "
68         Kontext "InhaltEinfuegen"
69         if InhaltEinfuegen.Exists then
70             printlog " + Write Clipboard format under pasted content "
71             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
72             printlog " + Save document as ..\user\work\writer_to_writer_text.odt"
73             Call hFileSaveAsWithFilterKill( gOfficepath + "user\work\writer_to_writer_text.odt" , "writer8" )
74             Wait 500
75             printlog " + Close saved document "
76             Call hCloseDocument
77             printlog " + Reopen saved document "
78             if hFileOpen (gOfficepath + "user\work\writer_to_writer_text.odt",true) = false then
79                 Kontext "Active"
80                 if Active.Exists then
81                     try
82                         Active.Yes
83                     catch
84                         Warnlog "Unable to remove checkbox: " + Active.Gettext
85                         Active.ok
86                     endcatch
87                 end if
88             end if
89             printlog " + Close saved document "
90             Call hCloseDocument
91         else
92             Warnlog "Dialog 'Paste Special' is not up!"
93             Call hCloseDocument
94             goto endsub
95         end if
96     else
97         Warnlog "Writer To Writer -> 'Text' failed !"
98     end if
99     printlog "  Close active document "
100     Do Until GetDocumentCount = 0
101         Call hCloseDocument
102     Loop
103 endcase
105 ' ----------------------------------------------------------------------------------------------
107 testcase WriterToWriterField
108     gApplication = "WRITER"
109     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
110     printlog " + Jump to beginning of document "
111     printlog " + Select paragraph with 'Date Field' "
112     printlog " + Copy selected text "
113     printlog " + Open new document "
114     if wSetClipboardtestDefaults("field") = True then
115         Call hNewDocument
116         printlog " + Edit / Paste Special "
117         EditPasteSpecialWriter
118         Wait 500
119         printlog "  Paste 'Field' in all available clipboard formats "
120         Kontext "InhaltEinfuegen"
121         if InhaltEinfuegen.Exists then
122             printlog " + Write Clipboard format under pasted content "
123             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
124             printlog " + Save document as ..\user\work\writer_to_writer_field.odt"
125             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_field.odt", "writer8")
126             sleep (2) 'Wait 500
127             printlog " + Close saved document "
128             Call hCloseDocument
129             printlog " + Reopen saved document "
130             if hFileOpen (gOfficepath + "user\work\writer_to_writer_field.odt",true) = false then
131                 Kontext "Active"
132                 if Active.Exists then
133                     try
134                         Active.Yes
135                     catch
136                         Warnlog "Unable to remove checkbox: " + Active.Gettext
137                         Active.ok
138                     endcatch
139                 end if
140             end if
141             printlog " + Close saved document "
142             Call hCloseDocument
143         else
144             Warnlog "Dialog 'Paste Special' is not up!"
145             Call hCloseDocument
146             goto endsub
147         end if
148     else
149         Warnlog "Writer To Writer -> 'Field' failed !"
150     end if
151     printlog "  Close active document "
152     Do Until GetDocumentCount = 0
153         Call hCloseDocument
154     Loop
155 endcase
157 ' ----------------------------------------------------------------------------------------------
159 testcase WriterToWriterTable
160     gApplication = "WRITER"
161     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
162     printlog " + Jump to beginning of document "
163     printlog " + Select 'Table' "
164     printlog " + Copy selected table "
165     printlog " + Open new document "
166     if wSetClipboardtestDefaults("table") = True then
167         Call hNewDocument
168         printlog " + Edit / Paste Special "
169         EditPasteSpecialWriter
170         sleep (1) 'Wait 500
171         printlog "  Paste 'Table' in all available clipboard formats "
172         Kontext "InhaltEinfuegen"
173         if InhaltEinfuegen.Exists then
174             printlog " + Write Clipboard format under pasted content "
175             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
176             printlog " + Save document as ..\user\work\writer_to_writer_table.odt"
177             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_table.odt", "writer8")
178             Wait 500
179             printlog " + Close saved document "
180             Call hCloseDocument
181             printlog " + Reopen saved document "
182             if hFileOpen (gOfficepath + "user\work\writer_to_writer_table.odt",true) = false then
183                 Kontext "Active"
184                 if Active.Exists then
185                     try
186                         Active.Yes
187                     catch
188                         Warnlog "Unable to remove checkbox: " + Active.Gettext
189                         Active.ok
190                     endcatch
191                 end if
192             end if
193             printlog " + Close saved document "
194             Call hCloseDocument
195         else
196             Warnlog "Dialog 'Paste Special' is not up!"
197             Call hCloseDocument
198             goto endsub
199         end if
200     else
201         Warnlog "Writer To Writer -> 'Table' failed !"
202     end if
203     printlog "  Close active document "
204     Do Until GetDocumentCount = 0
205         Call hCloseDocument
206     Loop
207 endcase
209 ' ----------------------------------------------------------------------------------------------
211 testcase WriterToWriterFrame
212     gApplication = "WRITER"
213     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
214     printlog " + Jump to beginning of document "
215     printlog " + Select 'Frame' "
216     printlog " + Copy selected frame "
217     printlog " + Open new document "
218     if wSetClipboardtestDefaults("frame") = True then
219         Call hNewDocument
220         printlog " + Edit / Paste Special "
221         EditPasteSpecialWriter
222         sleep (1) 'Wait 500
223         printlog "  Paste 'Table' in all available clipboard formats "
224         Kontext "InhaltEinfuegen"
225         if InhaltEinfuegen.Exists then
226             printlog " + Write Clipboard format under pasted content "
227             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"frame")
228             printlog " + Save document as ..\user\work\writer_to_writer_frame.odt"
229             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_frame.odt", "writer8")
230             WaitSlot (2000)
231             printlog " + Close saved document "
232             Call hCloseDocument
233             printlog " + Reopen saved document "
234             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_frame.odt",false)
235             printlog " + Close saved document "
236             Call hCloseDocument
237         else
238             Warnlog "Dialog 'Paste Special' is not up!"
239             Call hCloseDocument
240             goto endsub
241         end if
242     else
243         Warnlog "Writer To Writer -> 'Frame' failed !"
244     end if
245     printlog "  Close active document "
246     Do Until GetDocumentCount = 0
247         Call hCloseDocument
248     Loop
249 endcase
251 ' ----------------------------------------------------------------------------------------------
253 testcase WriterToWriterDrawingObject
254     gApplication = "WRITER"
255     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
256     printlog " + Jump to beginning of document "
257     printlog " + Select 'Drawing Object' "
258     printlog " + Copy selected Drawing Object "
259     printlog " + Open new document "
260     if wSetClipboardtestDefaults("DRAW") = True then
261         Call hNewDocument
262         printlog " + Edit / Paste Special "
263         EditPasteSpecialWriter
264         Wait 500
265         printlog "  Paste 'Table' in all available clipboard formats "
266         Kontext "InhaltEinfuegen"
267         if InhaltEinfuegen.Exists then
268             printlog " + Write Clipboard format under pasted content "
269             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
270             printlog " + Save document as ..\user\work\writer_to_writer_draw.odt"
271             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_draw.odt", "writer8")
272             WaitSlot (2000)
273             printlog " + Close saved document "
274             Call hCloseDocument
275             printlog " + Reopen saved document "
276             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_draw.odt",false)
277             printlog " + Close saved document "
278             Call hCloseDocument
279         else
280             Warnlog "Dialog 'Paste Special' is not up!"
281             Call hCloseDocument
282             goto endsub
283         end if
284     else
285        Warnlog "Writer To Writer -> 'Drawing Object' failed !"
286     end if
287     printlog "  Close active document "
288     Do Until GetDocumentCount = 0
289         Call hCloseDocument
290     Loop
291 endcase
293 ' ----------------------------------------------------------------------------------------------
295 testcase WriterToWriterGraphicLinked
296     gApplication = "WRITER"
297     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
298     printlog " + Jump to beginning of document "
299     printlog " + Select 'Linked Graphic' "
300     printlog " + Copy selected Linked Graphic "
301     printlog " + Open new document "
302     if wSetClipboardtestDefaults("graphicL") = True then
303         Call hNewDocument
304         printlog " + Edit / Paste Special "
305         EditPasteSpecialWriter
306         WaitSlot (2000)
307         printlog "  Paste 'Linked Graphic' in all available clipboard formats "
308         Kontext "InhaltEinfuegen"
309         if InhaltEinfuegen.Exists then
310             printlog " + Write Clipboard format under pasted content "
311             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
312             printlog " + Save document as ..\user\work\writer_to_writer_graphic1.odt"
313             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_graphic1.odt", "writer8")
314             Wait 500
315             printlog " + Close saved document "
316             Call hCloseDocument
317             printlog " + Reopen saved document "
318             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_graphic1.odt",false)
319             printlog " + Close saved document "
320             Call hCloseDocument
321         else
322             Warnlog "Dialog 'Paste Special' is not up!"
323             Call hCloseDocument
324             goto endsub
325         end if
326     else
327         Warnlog "Writer To Writer -> 'Linked Graphic' failed !"
328     end if
329     printlog "  Close active document "
330     Do Until GetDocumentCount = 0
331         Call hCloseDocument
332     Loop
333 endcase
335 ' ----------------------------------------------------------------------------------------------
337 testcase WriterToWriterGraphicEmbedded
338     gApplication = "WRITER"
339     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
340     printlog " + Jump to beginning of document "
341     printlog " + Select 'Embedded Graphic' "
342     printlog " + Copy selected Embedded Graphic "
343     printlog " + Open new document "
344     if wSetClipboardtestDefaults("graphicE") = True then
345         Call hNewDocument
346         printlog " + Edit / Paste Special "
347         EditPasteSpecialWriter
348         Wait 500
349         printlog "  Paste 'Embedded Graphic' in all available clipboard formats "
350         Kontext "InhaltEinfuegen"
351         if InhaltEinfuegen.Exists then
352             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicE")
353             printlog " + Write Clipboard format under pasted content "
354             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_graphic2.odt", "writer8")
355             printlog " + Save document as ..\user\work\writer_to_writer_graphic2.odt"
356             WaitSlot (2000)
357             printlog " + Close saved document "
358             Call hCloseDocument
359             printlog " + Reopen saved document "
360             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_graphic2.odt",false)
361             printlog " + Close saved document "
362             Call hCloseDocument
363         else
364             Warnlog "Dialog 'Paste Special' is not up!"
365             Call hCloseDocument
366             goto endsub
367         end if
368     else
369         Warnlog "Writer To Writer -> 'Embedded Graphic' failed !"
370     end if
371     printlog "  Close active document "
372     Do Until GetDocumentCount = 0
373         Call hCloseDocument
374     Loop
375 endcase
377 ' ----------------------------------------------------------------------------------------------
379 testcase WriterToWriterOLEObject
380     gApplication = "WRITER"
381     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
382     printlog " + Jump to beginning of document "
383     printlog " + Select 'OLE Object' "
384     printlog " + Copy selected OLE Object "
385     printlog " + Open new document "
386     if wSetClipboardtestDefaults("ole") = True then
387         Call hNewDocument
388         printlog " + Edit / Paste Special "
389         EditPasteSpecialWriter
390         Wait 500
391         printlog "  Paste 'OLE object' in all available clipboard formats "
392         Kontext "InhaltEinfuegen"
393         if InhaltEinfuegen.Exists then
394             printlog " + Write Clipboard format under pasted content "
395             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ole")
396             printlog " + Save document as ..\user\work\writer_to_writer_ole.odt"
397             Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_ole.odt", "writer8")
398             WaitSlot (2000)
399             printlog " + Close saved document "
400             Call hCloseDocument
401             printlog " + Reopen saved document "
402             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_ole.odt",false)
403             printlog " + Close saved document "
404             Call hCloseDocument
405         else
406             Warnlog "Dialog 'Paste Special' is not up!"
407             Call hCloseDocument
408             goto endsub
409         end if
410     else
411         Warnlog "Writer To Writer -> 'OLE object' failed !"
412     end if
413     printlog "  Close active document "
414     Do Until GetDocumentCount = 0
415         Call hCloseDocument
416     Loop
417 endcase
419 ' ----------------------------------------------------------------------------------------------
421 testcase WriterToWriterControl
422     gApplication = "WRITER"
423     printlog "  Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
424     printlog " + Jump to beginning of document "
425     printlog " + Select 'Control' "
426     printlog " + Copy selected Control "
427     printlog " + Open new document "
428     if wSetClipboardtestDefaults("control") = True then
429         Call hNewDocument
430         printlog " + Edit / Paste Special "
431         EditPasteSpecialWriter
432         Wait 500
433         printlog "  Paste 'Control' in all available clipboard formats "
434         Kontext "InhaltEinfuegen"
435         if InhaltEinfuegen.Exists then
436             printlog " + Write Clipboard format under pasted content "
437             Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
438             printlog " + Save document as ..\user\work\writer_to_writer_control.odt"
439             Call hFileSaveAsWithFilterKill(gOfficepath & "user\work\writer_to_writer_control.odt", "writer8")
440             WaitSlot (2000)
441             printlog " + Close saved document "
442             Call hCloseDocument
443             printlog " + Reopen saved document "
444             Call hFileOpen (gOfficepath + "user\work\writer_to_writer_control.odt",false)
445             printlog " + Close saved document "
446             Call hCloseDocument
447         else
448             Warnlog "Dialog 'Paste Special' is not up!"
449             Call hCloseDocument
450             goto endsub
451         end if
452     else
453         Warnlog "Writer To Writer -> 'Control' failed !"
454     end if
455     printlog "  Close active document "
456     Do Until GetDocumentCount = 0
457         Call hCloseDocument
458     Loop
459 endcase
461 ' ----------------------------------------------------------------------------------------------