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_211_.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 WriterToCalcField
43 Call WriterToCalcTable
44 Call WriterToCalcFrame
45 Call WriterToCalcDrawingObject
46 Call WriterToCalcGraphicLinked 'wrn:1
47 Call WriterToCalcGraphicEmbedded
48 Call WriterToCalcOLEObject
49 Call WriterToCalcControl
53 ' ---------------------------------------------------------------------------------
55 testcase WriterToCalcText
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_calc_text.ods", "calc8")
83 printlog " Save document as ..\user\work\writer_to_calc_text.ods"
86 printlog " Close saved document "
88 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_text.ods",true)
89 printlog " Reopen saved document "
92 printlog " Close saved document "
94 Warnlog "Dialog 'Paste Special' is not up!"
99 Warnlog "Writer To Calc -> 'Text' failed !"
101 printlog " Close active document "
102 Do Until GetDocumentCount = 0
107 ' ----------------------------------------------------------------------------------------------
109 testcase WriterToCalcField
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 = "CALC"
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_calc_field.ods", "calc8")
137 printlog " Save document as ..\user\work\writer_to_calc_field.ods"
140 printlog " Close saved document "
142 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_field.ods",true)
143 printlog " Reopen saved document "
146 printlog " Close saved document "
148 Warnlog "Dialog 'Paste Special' is not up!"
153 Warnlog "Writer To Calc -> 'Field' failed !"
155 printlog " Close active document "
156 Do Until GetDocumentCount = 0
161 ' ----------------------------------------------------------------------------------------------
163 testcase WriterToCalcTable
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 = "CALC"
171 printlog " Open new document "
173 printlog " Edit / Paste Special "
178 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
184 printlog " Paste 'Table' in all available clipboard formats "
185 Kontext "InhaltEinfuegen"
186 if InhaltEinfuegen.Exists then
187 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
189 if navigator.exists then navigator.close
190 printlog " Write Clipboard format under pasted content "
192 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_table.ods", "calc8")
193 printlog " Save document as ..\user\work\writer_to_calc_table.ods"
195 printlog " Close saved document "
199 if navigator.exists then navigator.close
201 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_table.ods",false)
202 printlog " Reopen saved document "
205 printlog " Close saved document "
207 if navigator.exists then navigator.close
209 Warnlog "Dialog 'Paste Special' is not up!"
214 Warnlog "Writer To Calc -> 'Table' failed !"
216 printlog " Close active document "
217 Do Until GetDocumentCount = 0
222 ' ----------------------------------------------------------------------------------------------
224 testcase WriterToCalcFrame
225 gApplication = "WRITER"
226 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
227 printlog " Jump to beginning of document "
228 printlog " Select 'Frame' "
229 printlog " Copy selected frame "
230 if wSetClipboardtestDefaults("frame") = True then
231 gApplication = "CALC"
232 printlog " Open new document "
234 printlog " Edit / Paste Special "
239 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
246 printlog " Paste 'Table' in all available clipboard formats "
247 Kontext "InhaltEinfuegen"
248 if InhaltEinfuegen.Exists then
249 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"frame")
250 printlog " Write Clipboard format under pasted content "
251 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_frame.ods", "calc8")
252 printlog " Save document as ..\user\work\writer_to_calc_frame.ods"
255 printlog " Close saved document "
257 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_frame.ods",false)
258 printlog " Reopen saved document "
261 printlog " Close saved document "
263 Warnlog "Dialog 'Paste Special' is not up!"
268 Warnlog "Writer To Calc -> 'Frame' failed !"
270 printlog " Close active document "
271 Do Until GetDocumentCount = 0
276 ' ----------------------------------------------------------------------------------------------
278 testcase WriterToCalcDrawingObject
279 gApplication = "WRITER"
280 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
281 printlog " Jump to beginning of document "
282 printlog " Select 'Drawing Object' "
283 printlog " Copy selected Drawing Object "
284 if wSetClipboardtestDefaults("DRAW") = True then
285 gApplication = "CALC"
286 printlog " Open new document "
288 printlog " Edit / Paste Special "
293 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
300 printlog " Paste 'Table' in all available clipboard formats "
301 Kontext "InhaltEinfuegen"
302 if InhaltEinfuegen.Exists then
303 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"DRAW")
304 printlog " Write Clipboard format under pasted content "
305 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_draw.ods", "calc8")
306 printlog " Save document as ..\user\work\writer_to_calc_draw.ods"
309 printlog " Close saved document "
311 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_draw.ods",false)
312 printlog " Reopen saved document "
315 printlog " Close saved document "
317 Warnlog "Dialog 'Paste Special' is not up!"
322 Warnlog "Writer To Calc -> 'Drawing Object' failed !"
324 printlog " Close active document "
325 Do Until GetDocumentCount = 0
330 ' ----------------------------------------------------------------------------------------------
332 testcase WriterToCalcGraphicLinked
333 EnableQaErrors = true
334 gApplication = "WRITER"
335 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
336 printlog " Jump to beginning of document "
337 printlog " Select 'Linked Graphic' "
338 printlog " Copy selected Linked Graphic "
339 if wSetClipboardtestDefaults("graphicL") = True then
340 gApplication = "CALC"
341 printlog " Open new document "
343 printlog " Edit / Paste Special "
348 warnlog "Check why linked graphic fails !"
355 printlog " Paste 'Linked Graphic' in all available clipboard formats "
356 Kontext "InhaltEinfuegen"
357 if InhaltEinfuegen.Exists then
358 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
359 printlog " Write Clipboard format under pasted content "
360 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_graphic1.ods", "calc8")
361 printlog " Save document as ..\user\work\writer_to_calc_graphic1.ods"
364 printlog " Close saved document "
366 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_graphic1.ods",false)
367 printlog " Reopen saved document "
370 printlog " Close saved document "
372 Warnlog "Dialog 'Paste Special' is not up!"
377 Warnlog "Writer To Calc -> 'Linked Graphic' failed !"
379 printlog " Close active document "
380 Do Until GetDocumentCount = 0
383 EnableQaErrors = false
386 ' ----------------------------------------------------------------------------------------------
388 testcase WriterToCalcGraphicEmbedded
389 gApplication = "WRITER"
390 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
391 printlog " Jump to beginning of document "
392 printlog " Select 'Embedded Graphic' "
393 printlog " Copy selected Embedded Graphic "
394 if wSetClipboardtestDefaults("graphicE") = True then
395 gApplication = "CALC"
396 printlog " Open new document "
398 printlog " Edit / Paste Special "
403 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
410 printlog " Paste 'Embedded Graphic' in all available clipboard formats "
411 Kontext "InhaltEinfuegen"
412 if InhaltEinfuegen.Exists then
413 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicE")
414 printlog " Write Clipboard format under pasted content "
415 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_graphic2.ods", "calc8")
416 printlog " Save document as ..\user\work\writer_to_calc_graphic2.ods"
419 printlog " Close saved document "
421 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_graphic2.ods",false)
422 printlog " Reopen saved document "
425 printlog " Close saved document "
427 Warnlog "Dialog 'Paste Special' is not up!"
432 Warnlog "Writer To Calc -> 'Embedded Graphic' failed !"
434 printlog " Close active document "
435 Do Until GetDocumentCount = 0
440 ' ----------------------------------------------------------------------------------------------
442 testcase WriterToCalcOLEObject
443 gApplication = "WRITER"
444 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
445 printlog " Jump to beginning of document "
446 printlog " Select 'OLE Object' "
447 printlog " Copy selected OLE Object "
448 if wSetClipboardtestDefaults("ole") = True then
449 gApplication = "CALC"
450 printlog " Open new document "
452 printlog " Edit / Paste Special "
457 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
464 printlog " Paste 'OLE object' in all available clipboard formats "
465 Kontext "InhaltEinfuegen"
466 if InhaltEinfuegen.Exists then
467 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ole")
468 printlog " Write Clipboard format under pasted content "
469 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_ole.ods", "calc8")
470 printlog " Save document as ..\user\work\writer_to_calc_ole.ods"
473 printlog " Close saved document "
475 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_ole.ods",false)
476 printlog " Reopen saved document "
479 printlog " Close saved document "
481 Warnlog "Dialog 'Paste Special' is not up!"
486 Warnlog "Writer To Calc -> 'OLE object' failed !"
488 printlog " Close active document "
489 Do Until GetDocumentCount = 0
494 ' ----------------------------------------------------------------------------------------------
496 testcase WriterToCalcControl
497 gApplication = "WRITER"
498 printlog " Open File '..\\writer\\optional\\input\\clipboard\\writer.sxw' "
499 printlog " Jump to beginning of document "
500 printlog " Select 'Control' "
501 printlog " Copy selected Control "
502 if wSetClipboardtestDefaults("control") = True then
503 gApplication = "CALC"
504 printlog " Open new document "
506 printlog " Edit / Paste Special "
511 Warnlog "Unable to execute 'Edit / Paste / Special' -> Disabled !"
518 printlog " Paste 'Control' in all available clipboard formats "
519 Kontext "InhaltEinfuegen"
520 if InhaltEinfuegen.Exists then
521 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
522 printlog " Write Clipboard format under pasted content "
523 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_calc_control.ods", "calc8")
524 printlog " Save document as ..\user\work\writer_to_calc_control.ods"
527 printlog " Close saved document "
529 Call hFileOpen (gOfficepath + "user\work\writer_to_calc_control.ods",false)
530 printlog " Reopen saved document "
533 printlog " Close saved document "
535 Warnlog "Dialog 'Paste Special' is not up!"
540 Warnlog "Writer To Calc -> 'Control' failed !"
542 printlog " Close active document "
543 Do Until GetDocumentCount = 0