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_222_.inc,v $
12 '* last change: $Author: fredrikh $ $Date: 2008-06-18 15:03:48 $
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 '\***********************************************************************
41 Call DrawToWriterScrollingText
42 Call DrawToWriterGroupedObject
44 Call DrawToWriterFontwork
45 Call DrawToWriterBullets
46 Call DrawToWriterDimensionLines
47 Call DrawToWriterConnectors
51 '------------------------------------------------------------------------------
53 testcase DrawToWriterScrollingText
56 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
57 printlog " Jump to beginning of document "
58 printlog " Select Scrolling text "
59 printlog " Copy selected text "
60 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
61 Call sMakeReadOnlyDocumentEditable
62 Kontext "DocumentDraw"
63 printlog " Jump to beginning of document "
64 DocumentDraw.TypeKeys "<Tab>"
66 gApplication = "WRITER"
67 printlog " Open a new writerdocument "
71 EditPasteSpecialWriter
73 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
74 Call hCloseDocument ' Close Source-File
75 Call hCloseDocument ' Close Target-File
79 printlog " Paste 'Scrolling Text' in all available clipboard formats "
80 Kontext "InhaltEinfuegen"
81 if InhaltEinfuegen.Exists then
82 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
83 printlog " Write Clipboard format under pasted content "
84 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_scrolling_text.odt", "writer8")
85 printlog " Save document as ..\user\work\draw_to_writer_scrolling_text.odt"
88 printlog " Close saved document "
90 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_scrolling_text.odt",false)
91 printlog " Reopen saved document "
94 printlog " Close saved document "
96 Warnlog "Dialog 'Paste Special' is not up!"
100 printlog " Close active document "
101 Do Until GetDocumentCount = 0
106 ' ---------------------------------------------------------------------------------
108 testcase DrawToWriterGroupedObject
110 gApplication = "DRAW"
111 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
112 printlog " Jump to beginning of document "
113 printlog " Select Grouped Object "
114 printlog " Copy selected Object "
115 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
116 Call sMakeReadOnlyDocumentEditable
117 Kontext "DocumentDraw"
118 printlog " Jump to beginning of document "
119 DocumentDraw.TypeKeys "<Tab>",2
121 gApplication = "WRITER"
122 printlog " Open a new writerdocument "
126 EditPasteSpecialWriter
128 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
129 Call hCloseDocument ' Close Source-File
130 Call hCloseDocument ' Close Target-File
134 printlog " Paste 'Text' in all available clipboard formats "
135 Kontext "InhaltEinfuegen"
136 if InhaltEinfuegen.Exists then
137 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
138 printlog " Write Clipboard format under pasted content "
139 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_grouped_object.odt", "writer8")
140 printlog " Save document as ..\user\work\draw_to_writer_grouped_object.odt"
143 printlog " Close saved document "
145 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_grouped_object.odt",false)
146 printlog " Reopen saved document "
149 printlog " Close saved document "
151 Warnlog "Dialog 'Paste Special' is not up!"
155 printlog " Close active document "
156 Do Until GetDocumentCount = 0
161 ' ---------------------------------------------------------------------------------
163 testcase DrawToWriter3D
165 gApplication = "DRAW"
166 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
167 printlog " Jump to beginning of document "
168 printlog " Select cell <A5:C5> "
169 printlog " Copy selected text "
170 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
171 Call sMakeReadOnlyDocumentEditable
172 Kontext "DocumentDraw"
173 printlog " Jump to beginning of document "
174 DocumentDraw.TypeKeys "<Tab>",3
176 gApplication = "WRITER"
177 printlog " Open a new writerdocument "
181 EditPasteSpecialWriter
183 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
184 Call hCloseDocument ' Close Source-File
185 Call hCloseDocument ' Close Target-File
189 printlog " Paste 'Text' in all available clipboard formats "
190 Kontext "InhaltEinfuegen"
191 if InhaltEinfuegen.Exists then
192 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
193 printlog " Write Clipboard format under pasted content "
194 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_3d.odt", "writer8")
195 printlog " Save document as ..\user\work\draw_to_writer_3d.odt"
198 printlog " Close saved document "
200 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_3d.odt",false)
201 printlog " Reopen saved document "
204 printlog " Close saved document "
206 Warnlog "Dialog 'Paste Special' is not up!"
210 printlog " Close active document "
211 Do Until GetDocumentCount = 0
216 ' ---------------------------------------------------------------------------------
218 testcase DrawToWriterFontwork
220 gApplication = "DRAW"
221 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
222 printlog " Jump to beginning of document "
223 printlog " Select Fontwork "
224 printlog " Copy selected Fontwork "
225 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
226 Call sMakeReadOnlyDocumentEditable
227 Kontext "DocumentDraw"
228 printlog " Jump to beginning of document "
229 DocumentDraw.TypeKeys "<Tab>",4
231 gApplication = "WRITER"
232 printlog " Open a new writerdocument "
236 EditPasteSpecialWriter
238 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
239 Call hCloseDocument ' Close Source-File
240 Call hCloseDocument ' Close Target-File
244 printlog " Paste 'Text' in all available clipboard formats "
245 Kontext "InhaltEinfuegen"
246 if InhaltEinfuegen.Exists then
247 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
248 printlog " Write Clipboard format under pasted content "
249 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_fontwork.odt", "writer8")
250 printlog " Save document as ..\user\work\draw_to_writer_fontwork.odt"
253 printlog " Close saved document "
255 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_fontwork.odt",false)
256 printlog " Reopen saved document "
259 printlog " Close saved document "
261 Warnlog "Dialog 'Paste Special' is not up!"
265 printlog " Close active document "
266 Do Until GetDocumentCount = 0
271 ' ---------------------------------------------------------------------------------
273 testcase DrawToWriterBullets
275 gApplication = "DRAW"
276 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
277 printlog " Jump to beginning of document "
278 printlog " Select Bullets "
279 printlog " Copy selected Bullets "
280 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
281 Call sMakeReadOnlyDocumentEditable
282 Kontext "DocumentDraw"
283 printlog " Jump to beginning of document "
284 DocumentDraw.TypeKeys "<Tab>",5
286 gApplication = "WRITER"
287 printlog " Open a new writerdocument "
291 EditPasteSpecialWriter
293 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
294 Call hCloseDocument ' Close Source-File
295 Call hCloseDocument ' Close Target-File
299 printlog " Paste 'Text' in all available clipboard formats "
300 Kontext "InhaltEinfuegen"
301 if InhaltEinfuegen.Exists then
302 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
303 printlog " Write Clipboard format under pasted content "
304 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_bullets.odt", "writer8")
305 printlog " Save document as ..\user\work\draw_to_writer_bullets.odt"
308 printlog " Close saved document "
310 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_bullets.odt",false)
311 printlog " Reopen saved document "
314 printlog " Close saved document "
316 Warnlog "Dialog 'Paste Special' is not up!"
320 printlog " Close active document "
321 Do Until GetDocumentCount = 0
326 ' ---------------------------------------------------------------------------------
328 testcase DrawToWriterDimensionLines
330 gApplication = "DRAW"
331 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
332 printlog " Jump to beginning of document "
333 printlog " Select Dimension Lines "
334 printlog " Copy selected Dimension Lines "
335 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
336 Call sMakeReadOnlyDocumentEditable
337 Kontext "DocumentDraw"
338 printlog " Jump to beginning of document "
339 DocumentDraw.TypeKeys "<PageDown>"
340 DocumentDraw.TypeKeys "<Tab>"
342 gApplication = "WRITER"
343 printlog " Open a new writerdocument "
347 EditPasteSpecialWriter
349 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
350 Call hCloseDocument ' Close Source-File
351 Call hCloseDocument ' Close Target-File
355 printlog " Paste 'Dimension Lines' in all available clipboard formats "
356 Kontext "InhaltEinfuegen"
357 if InhaltEinfuegen.Exists then
358 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
359 printlog " Write Clipboard format under pasted content "
360 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_dim_lines.odt", "writer8")
361 printlog " Save document as ..\user\work\draw_to_writer_dim_lines.odt"
364 printlog " Close saved document "
366 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_dim_lines.odt",false)
367 printlog " Reopen saved document "
370 printlog " Close saved document "
372 Warnlog "Dialog 'Paste Special' is not up!"
376 printlog " Close active document "
377 Do Until GetDocumentCount = 0
382 ' ---------------------------------------------------------------------------------
384 testcase DrawToWriterConnectors
386 gApplication = "DRAW"
387 printlog " Open File '..\\writer\\optional\\input\\clipboard\\draw.sxd' "
388 printlog " Jump to beginning of document "
389 printlog " Select Connectors "
390 printlog " Copy selected Connectors "
391 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\draw.sxd")
392 Call sMakeReadOnlyDocumentEditable
393 Kontext "DocumentDraw"
394 printlog " Jump to beginning of document "
395 DocumentDraw.TypeKeys "<PageDown>"
396 DocumentDraw.TypeKeys "<Tab>"
398 gApplication = "WRITER"
399 printlog " Open a new writerdocument "
403 EditPasteSpecialWriter
405 Warnlog "Unable to execute 'Edit / Paste Special' ! Test failed!"
406 Call hCloseDocument ' Close Source-File
407 Call hCloseDocument ' Close Target-File
411 printlog " Paste 'Connectors' in all available clipboard formats "
412 Kontext "InhaltEinfuegen"
413 if InhaltEinfuegen.Exists then
414 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
415 printlog " Write Clipboard format under pasted content "
416 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\draw_to_writer_connectors.odt", "writer8")
417 printlog " Save document as ..\user\work\draw_to_writer_connectors.odt"
420 printlog " Close saved document "
422 Call hFileOpen (gOfficepath + "user\work\draw_to_writer_connectors.odt",false)
423 printlog " Reopen saved document "
426 printlog " Close saved document "
428 Warnlog "Dialog 'Paste Special' is not up!"
432 printlog " Close active document "
433 Do Until GetDocumentCount = 0
438 '------------------------------------------------------------------------------