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_215_.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 '\***********************************************************************
41 Call CalcToWriterText1
42 Call CalcToWriterText2
43 Call CalcToWriterCalculation
44 Call CalcToWriterHyperlink1
45 Call CalcToWriterHyperlink2
46 Call CalcToWriterDrawObject
51 '--------------------------------------------------------
53 testcase CalcToWriterText1
55 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
56 printlog " Jump to beginning of document "
57 printlog " Select cell <A2> "
58 printlog " Copy selected text "
59 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
60 Call sMakeReadOnlyDocumentEditable
61 Kontext "DocumentCalc"
62 printlog " Jump to beginning of document "
63 DocumentCalc.TypeKeys "<Mod1 Home>"
64 DocumentCalc.TypeKeys "<Down>"
66 gApplication = "WRITER"
67 printlog " Open a new writerdocument "
71 EditPasteSpecialWriter
73 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
79 printlog " Paste 'Text' in all available clipboard formats "
80 Kontext "InhaltEinfuegen"
81 if InhaltEinfuegen.Exists then
82 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ctext")
83 printlog " Write Clipboard format under pasted content "
84 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_textformat_wholecell.odt", "writer8")
85 printlog " Save document as ..\user\work\writer_to_writer_textformat_wholecell.odt"
88 printlog " Close saved document "
90 printlog " Reopen saved document "
91 if hFileOpen (gOfficepath + "user\work\writer_to_writer_textformat_wholecell.odt",true) = false then
97 Warnlog "Unable to remove checkbox: " + Active.Gettext
103 printlog " Close saved document "
106 Warnlog "Dialog 'Paste Special' is not up!"
110 printlog " Close active document "
114 ' ---------------------------------------------------------------------------------
116 testcase CalcToWriterText2
117 gApplication = "CALC"
118 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
119 printlog " Jump to beginning of document "
120 printlog " Select cell <A1>, press F2 and select all "
121 printlog " Copy selected text "
122 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
123 Call sMakeReadOnlyDocumentEditable
124 Kontext "DocumentCalc"
125 printlog " Jump to beginning of document "
126 DocumentCalc.TypeKeys "<Mod1 Home>"
127 DocumentCalc.TypeKeys "<Down>"
128 DocumentCalc.TypeKeys "<F2>"
129 DocumentCalc.TypeKeys "<Mod1 A>"
131 gApplication = "WRITER"
132 printlog " Open a new writerdocument "
136 EditPasteSpecialWriter
138 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
144 printlog " Paste 'Text' in all available clipboard formats "
145 Kontext "InhaltEinfuegen"
146 if InhaltEinfuegen.Exists then
147 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
148 printlog " Write Clipboard format under pasted content "
149 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_textformat_cellcontent.odt", "writer8")
150 printlog " Save document as ..\user\work\writer_to_writer_textformat_cellcontent.odt"
152 printlog " Close saved document "
155 printlog " Reopen saved document "
156 Call hFileOpen (gOfficepath + "user\work\writer_to_writer_textformat_cellcontent.odt",false)
158 printlog " Close saved document "
161 Warnlog "Dialog 'Paste Special' is not up!"
165 printlog " Close active document "
169 ' ---------------------------------------------------------------------------------
171 testcase CalcToWriterCalculation
172 gApplication = "CALC"
173 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
174 printlog " Jump to beginning of document "
175 printlog " Select cell <A5:C5> "
176 printlog " Copy selected text "
177 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
178 Call sMakeReadOnlyDocumentEditable
179 Kontext "DocumentCalc"
180 printlog " Jump to beginning of document "
181 DocumentCalc.TypeKeys "<Mod1 Home>"
182 DocumentCalc.TypeKeys "<Down>",4
183 DocumentCalc.TypeKeys "<Shift Right>", 2
185 gApplication = "WRITER"
186 printlog " Open a new writerdocument "
190 EditPasteSpecialWriter
192 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
198 printlog " Paste 'Text' in all available clipboard formats "
199 Kontext "InhaltEinfuegen"
200 if InhaltEinfuegen.Exists then
201 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ctext")
202 printlog " Write Clipboard format under pasted content "
203 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_calculation_cellformat.odt", "writer8")
204 printlog " Save document as ..\user\work\writer_to_writer_calculation_cellformat.odt"
207 printlog " Close saved document "
209 printlog " Reopen saved document "
210 if hFileOpen (gOfficepath + "user\work\writer_to_writer_calculation_cellformat.odt",true) = false then
212 if Active.Exists then
216 Warnlog "Unable to remove checkbox: " + Active.Gettext
222 printlog " Close saved document "
225 Warnlog "Dialog 'Paste Special' is not up!"
229 printlog " Close active document "
233 ' ---------------------------------------------------------------------------------
235 testcase CalcToWriterHyperlink1
236 gApplication = "CALC"
237 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
238 printlog " Jump to beginning of document "
239 printlog " Select cell <A8> "
240 printlog " Copy selected text "
241 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
242 Call sMakeReadOnlyDocumentEditable
243 Kontext "DocumentCalc"
244 printlog " Jump to beginning of document "
245 DocumentCalc.TypeKeys "<Mod1 Home>"
246 DocumentCalc.TypeKeys "<Down>",7
248 gApplication = "WRITER"
249 printlog " Open a new writerdocument "
253 EditPasteSpecialWriter
255 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
261 printlog " Paste 'Text' in all available clipboard formats "
262 Kontext "InhaltEinfuegen"
263 if InhaltEinfuegen.Exists then
264 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ctext")
265 printlog " Write Clipboard format under pasted content "
266 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_hyperlink_wholecell.odt", "writer8")
267 printlog " Save document as ..\user\work\writer_to_writer_hyperlink_wholecell.odt"
270 printlog " Close saved document "
272 printlog " Reopen saved document "
273 if hFileOpen (gOfficepath + "user\work\writer_to_writer_hyperlink_wholecell.odt",true) = false then
275 if Active.Exists then
279 Warnlog "Unable to remove checkbox: " + Active.Gettext
285 printlog " Close saved document "
288 Warnlog "Dialog 'Paste Special' is not up!"
292 printlog " Close active document "
296 ' ---------------------------------------------------------------------------------
298 testcase CalcToWriterHyperlink2
299 gApplication = "CALC"
300 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
301 printlog " Jump to beginning of document "
302 printlog " Select cell <A8> "
303 printlog " Copy selected text "
304 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
305 Call sMakeReadOnlyDocumentEditable
306 Kontext "DocumentCalc"
307 printlog " Jump to beginning of document "
308 DocumentCalc.TypeKeys "<Mod1 Home>"
309 DocumentCalc.TypeKeys "<Down>",7
310 DocumentCalc.TypeKeys "<F2>"
311 DocumentCalc.TypeKeys "<Mod1 A>"
313 gApplication = "WRITER"
314 printlog " Open a new writerdocument "
318 EditPasteSpecialWriter
320 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
326 printlog " Paste 'Text' in all available clipboard formats "
327 Kontext "InhaltEinfuegen"
328 if InhaltEinfuegen.Exists then
329 printlog " Write Clipboard format under pasted content "
330 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
331 printlog " Save document as ..\user\work\writer_to_writer_hyperlink_cellcontent.odt"
332 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_hyperlink_cellcontent.odt", "writer8")
334 printlog " Close saved document "
337 printlog " Reopen saved document "
338 Call hFileOpen (gOfficepath + "user\work\writer_to_writer_hyperlink_cellcontent.odt",false)
340 printlog " Close saved document "
343 Warnlog "Dialog 'Paste Special' is not up!"
347 printlog " Close active document "
351 ' ---------------------------------------------------------------------------------
353 testcase CalcToWriterDrawObject
354 gApplication = "CALC"
355 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
356 printlog " Jump to beginning of document "
357 printlog " Select Drawing object "
358 printlog " Copy selected object "
359 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
360 Call sMakeReadOnlyDocumentEditable
361 Kontext "DocumentCalc"
362 printlog " Jump to beginning of document "
363 Call wNavigatorAuswahl(8,1)
365 gApplication = "WRITER"
366 printlog " Open a new writerdocument "
370 EditPasteSpecialWriter
372 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
378 printlog " Paste 'Text' in all available clipboard formats "
379 Kontext "InhaltEinfuegen"
380 if InhaltEinfuegen.Exists then
381 printlog " Write Clipboard format under pasted content "
382 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ctext")
383 printlog " Save document as ..\user\work\writer_to_writer_draw.odt"
384 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_draw.odt", "writer8")
386 printlog " Close saved document "
389 printlog " Reopen saved document "
390 Call hFileOpen (gOfficepath + "user\work\writer_to_writer_draw.odt",false)
392 printlog " Close saved document "
395 Warnlog "Dialog 'Paste Special' is not up!"
399 printlog " Close active document "
403 ' ---------------------------------------------------------------------------------
405 testcase CalcToWriterOLE
406 gApplication = "CALC"
407 printlog " Open File '..\\writer\\optional\\input\\clipboard\\calc.sxc' "
408 printlog " Jump to beginning of document "
409 printlog " Select OLE-Object "
410 printlog " Copy selected object "
411 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\calc.sxc")
412 Call sMakeReadOnlyDocumentEditable
413 Kontext "DocumentCalc"
414 printlog " Jump to beginning of document "
415 Call wNavigatorAuswahl(6,1)
417 gApplication = "WRITER"
418 printlog " Open a new writerdocument "
422 EditPasteSpecialWriter
424 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
430 printlog " Paste 'Text' in all available clipboard formats "
431 Kontext "InhaltEinfuegen"
432 if InhaltEinfuegen.Exists then
433 printlog " Write Clipboard format under pasted content "
434 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"ctext")
435 printlog " Save document as ..\user\work\writer_to_writer_ole.odt"
436 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\writer_to_writer_ole.odt", "writer8")
438 printlog " Close saved document "
441 printlog " Reopen saved document "
442 Call hFileOpen (gOfficepath + "user\work\writer_to_writer_ole.odt",false)
444 printlog " Close saved document "
447 Warnlog "Dialog 'Paste Special' is not up!"
451 printlog " Close active document "