1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: ctrl_Clipboard.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:41 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : Clipboard test with controls between all application
38 '\***********************************************************************
42 call tFromText 'copy control from text document and paste it to the other application and check
43 call tFromCalc 'copy control from calc document and paste it to the other application and check
44 call tFromDraw 'copy control from draw document and paste it to the other application and check
45 call tFromImpress 'copy control from impress document and paste it to the other application and check
48 '--------------------------------------------------------------------------------------
51 '/// Open a new document and empty clipboard
52 printlog "Open a new document and empty clipboard"
54 Kontext "DocumentWriter"
55 DocumentWriter.TypeKeys "tt_doc" , true
60 call hToolbarSelect("FormControls",true)
62 Kontext "FormControls"
65 '/// insert a Push Button
66 printlog "insert a Push Button"
67 call hDrawingWithSelection ( 20, 20, 30, 30 )
69 Kontext "FormControls"
70 ControlProperties.Click
72 Kontext "ControlPropertiesTabControl"
73 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
75 '/// set control property: Name
76 printlog "set control property"
77 Kontext "TabGeneralControl"
78 if TabGeneralControl.exists(3) then
79 NameText.setText("FromText")
80 else warnlog "control property browser could not be opend"
83 '/// copy control to clipboard
84 printlog "copy control to clipboard"
85 Kontext "DocumentWriter"
86 DocumentWriter.TypeKeys "<F6>", TRUE
88 DocumentWriter.TypeKeys "<COPY>", TRUE
91 printlog "close document"
94 '/// open new document (to repeat for all documents except the document you copy from)
95 dim i as integer 'counter
97 '/// paste control from clipboard and open control property browser
100 printlog "-- Text to Calc Clipboard Test --"
101 printlog "open a new Calc document"
103 printlog "paste control from clipboard"
104 Kontext "DocumentCalc"
105 DocumentCalc.TypeKeys "<PASTE>", TRUE
107 printlog "open control property browser from context"
108 DocumentCalc.TypeKeys "<SHIFT F10>", TRUE
109 call hMenuSelectNr(4)
112 gApplication = "DRAW"
113 printlog "-- Text to Draw Clipboard Test --"
114 printlog "open a new Draw document"
116 printlog "paste control from clipboard"
117 Kontext "DocumentDraw"
118 DocumentDraw.TypeKeys "<PASTE>", TRUE
120 printlog "open control property browser from context"
121 DocumentDraw.TypeKeys "<SHIFT F10>", TRUE
122 call hMenuSelectNr(2)
125 gApplication = "IMPRESS"
126 printlog "-- Text to Impress Clipboard Test --"
127 printlog "open a new Impress document"
129 printlog "paste control from clipboard"
130 Kontext "DocumentImpress"
131 DocumentImpress.TypeKeys "<PASTE>", TRUE
133 printlog "open control property browser from context"
134 DocumentImpress.TypeKeys "<SHIFT F10>", TRUE
135 call hMenuSelectNr(2)
138 Kontext "ControlPropertiesTabControl"
139 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
141 '/// check if control was correctly stored in clipboard
142 Kontext "TabGeneralControl"
143 if TabGeneralControl.exists(3) then
144 if NameText.getText <> "FromText" then
145 warnlog "Control is not saved correctly"
146 else printlog "control was saved correctly"
148 else warnlog "Control property browser could not be opend"
152 printlog "close document"
156 printlog "*** Testcase End ***"
160 '--------------------------------------------------------------------------------------
163 '/// Open a new document and empty clipboard
164 printlog "Open a new document and empty clipboard"
165 gApplication = "CALC"
167 Kontext "DocumentCalc"
168 DocumentCalc.TypeKeys "tt_doc" , true
173 call hToolbarSelect("FormControls",true)
175 Kontext "FormControls"
178 '/// insert a Push Button
179 printlog "insert a Push Button"
180 call hDrawingWithSelection ( 20, 20, 30, 30 )
182 Kontext "FormControls"
183 ControlProperties.Click
185 Kontext "ControlPropertiesTabControl"
186 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
188 '/// set control property: Name
189 printlog "set control property"
190 Kontext "TabGeneralControl"
191 if TabGeneralControl.exists(3) then
192 NameText.setText("FromCalc")
193 else warnlog "control property browser could not be opend"
196 '/// copy control to clipboard
197 printlog "copy control to clipboard"
198 Kontext "DocumentCalc"
199 DocumentCalc.TypeKeys "<F6>", TRUE
201 DocumentCalc.TypeKeys "<COPY>", TRUE
204 printlog "close document"
207 '/// open new document (to repeat for all documents except the document you copy from)
208 dim i as integer 'counter
210 '/// paste control from clipboard and open control property browser
212 gApplication = "WRITER"
213 printlog "-- Calc to Text Clipboard Test --"
214 printlog "open a new Text document"
216 printlog "paste control from clipboard"
217 Kontext "DocumentWriter"
218 DocumentWriter.TypeKeys "<PASTE>", TRUE
220 printlog "open control property browser from context"
221 DocumentWriter.TypeKeys "<SHIFT F10>", TRUE
222 call hMenuSelectNr(4)
225 gApplication = "DRAW"
226 printlog "-- Calc to Draw Clipboard Test --"
227 printlog "open a new Draw document"
229 printlog "paste control from clipboard"
230 Kontext "DocumentDraw"
231 DocumentDraw.TypeKeys "<PASTE>", TRUE
233 printlog "open control property browser from context"
234 DocumentDraw.TypeKeys "<SHIFT F10>", TRUE
235 call hMenuSelectNr(2)
238 gApplication = "IMPRESS"
239 printlog "-- Calc to Impress Clipboard Test --"
240 printlog "open a new Impress document"
242 printlog "paste control from clipboard"
243 Kontext "DocumentImpress"
244 DocumentImpress.TypeKeys "<PASTE>", TRUE
246 printlog "open control property browser from context"
247 DocumentImpress.TypeKeys "<SHIFT F10>", TRUE
248 call hMenuSelectNr(2)
251 Kontext "ControlPropertiesTabControl"
252 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
254 '/// check if control was correctly stored in clipboard
255 Kontext "TabGeneralControl"
256 if TabGeneralControl.exists(3) then
257 if NameText.getText <> "FromCalc" then
258 warnlog "Control is not saved correctly. Name should be FromCalc but it is " + NameText.getText
260 printlog "control was saved correctly"
262 else warnlog "Control property browser could not be opend"
266 printlog "close document"
270 printlog "*** Testcase End ***"
274 '--------------------------------------------------------------------------------------
277 '/// Open a new document and empty clipboard
278 printlog "Open a new document and empty clipboard"
279 gApplication = "DRAW"
281 Kontext "DocumentDraw"
282 DocumentDraw.TypeKeys "tt_doc" , true
287 call hToolbarSelect("FormControls",true)
289 Kontext "FormControls"
292 '/// insert a Push Button
293 printlog "insert a Push Button"
294 call hDrawingWithSelection ( 20, 20, 30, 30 )
296 Kontext "FormControls"
297 ControlProperties.Click
299 Kontext "ControlPropertiesTabControl"
300 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
302 '/// set control property: Name
303 printlog "set control property"
304 Kontext "TabGeneralControl"
305 if TabGeneralControl.exists(3) then
306 NameText.setText("FromDraw")
307 else warnlog "control property browser could not be opend"
310 '/// copy control to clipboard
311 printlog "copy control to clipboard"
312 Kontext "DocumentDraw"
313 DocumentDraw.TypeKeys "<F6>", TRUE
315 DocumentDraw.TypeKeys "<COPY>", TRUE
318 printlog "close document"
321 '/// open new document (to repeat for all documents except the document you copy from)
322 dim i as integer 'counter
324 '/// paste control from clipboard and open control property browser
326 gApplication = "WRITER"
327 printlog "-- Draw to Text Clipboard Test --"
328 printlog "open a new Text document"
330 printlog "paste control from clipboard"
331 Kontext "DocumentWriter"
332 DocumentWriter.TypeKeys "<PASTE>", TRUE
334 printlog "open control property browser from context"
335 DocumentWriter.TypeKeys "<SHIFT F10>", TRUE
336 call hMenuSelectNr(4)
339 gApplication = "CALC"
340 printlog "-- Draw to Calc Clipboard Test --"
341 printlog "open a new Calc document"
343 printlog "paste control from clipboard"
344 Kontext "DocumentCalc"
345 DocumentCalc.TypeKeys "<PASTE>", TRUE
347 printlog "open control property browser from context"
348 DocumentCalc.TypeKeys "<SHIFT F10>", TRUE
349 call hMenuSelectNr(4)
352 gApplication = "IMPRESS"
353 printlog "-- Draw to Impress Clipboard Test --"
354 printlog "open a new Impress document"
356 printlog "paste control from clipboard"
357 Kontext "DocumentImpress"
358 DocumentImpress.TypeKeys "<PASTE>", TRUE
360 printlog "open control property browser from context"
361 DocumentImpress.TypeKeys "<SHIFT F10>", TRUE
362 call hMenuSelectNr(2)
365 Kontext "ControlPropertiesTabControl"
366 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
368 '/// check if control was correctly stored in clipboard
369 Kontext "TabGeneralControl"
370 if TabGeneralControl.exists(3) then
371 if NameText.getText <> "FromDraw" then
372 warnlog "Control is not saved correctly"
373 else printlog "control was saved correctly"
375 else warnlog "Control property browser could not be opend"
379 printlog "close document"
383 printlog "*** Testcase End ***"
387 '--------------------------------------------------------------------------------------
388 testcase tFromImpress
390 '/// Open a new document and empty clipboard
391 printlog "Open a new document and empty clipboard"
392 gApplication = "IMPRESS"
394 Kontext "DocumentImpress"
395 DocumentImpress.TypeKeys "tt_doc" , true
400 call hToolbarSelect("FormControls",true)
402 Kontext "FormControls"
405 '/// insert a Push Button
406 printlog "insert a Push Button"
407 call hDrawingWithSelection ( 20, 20, 30, 30 )
409 Kontext "FormControls"
410 ControlProperties.Click
412 Kontext "ControlPropertiesTabControl"
413 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
415 '/// set control property: Name
416 printlog "set control property"
417 Kontext "TabGeneralControl"
418 if TabGeneralControl.exists(3) then
419 NameText.setText("FromImpress")
420 else warnlog "control property browser could not be opend"
423 '/// copy control to clipboard
424 printlog "copy control to clipboard"
425 Kontext "DocumentImpress"
426 DocumentImpress.TypeKeys "<F6>", TRUE
428 DocumentImpress.TypeKeys "<COPY>", TRUE
431 printlog "close document"
434 '/// open new document (to repeat for all documents except the document you copy from)
435 dim i as integer 'counter
437 '/// paste control from clipboard and open control property browser
439 gApplication = "WRITER"
440 printlog "-- Impress to Text Clipboard Test --"
441 printlog "open a new Text document"
443 printlog "paste control from clipboard"
444 Kontext "DocumentWriter"
445 DocumentWriter.TypeKeys "<PASTE>", TRUE
447 printlog "open control property browser from context"
448 DocumentWriter.TypeKeys "<SHIFT F10>", TRUE
449 call hMenuSelectNr(4)
452 gApplication = "CALC"
453 printlog "-- Impress to Calc Clipboard Test --"
454 printlog "open a new Calc document"
456 printlog "paste control from clipboard"
457 Kontext "DocumentCalc"
458 DocumentCalc.TypeKeys "<PASTE>", TRUE
460 printlog "open control property browser from context"
461 DocumentCalc.TypeKeys "<SHIFT F10>", TRUE
462 call hMenuSelectNr(4)
465 gApplication = "DRAW"
466 printlog "-- Impress to Draw Clipboard Test --"
467 printlog "open a new Draw document"
469 printlog "paste control from clipboard"
470 Kontext "DocumentDraw"
471 DocumentDraw.TypeKeys "<PASTE>", TRUE
473 printlog "open control property browser from context"
474 DocumentDraw.TypeKeys "<SHIFT F10>", TRUE
475 call hMenuSelectNr(2)
478 Kontext "ControlPropertiesTabControl"
479 ControlPropertiesTabControl.setPage TabGeneralControl 'make shure that tabpage general in property is choosen
481 '/// check if control was correctly stored in clipboard
482 Kontext "TabGeneralControl"
483 if TabGeneralControl.exists(3) then
484 if NameText.getText <> "FromImpress" then
485 warnlog "Control is not saved correctly"
486 else printlog "control was saved correctly"
488 else warnlog "Control property browser could not be opend"
492 printlog "close document"
496 printlog "*** Testcase End ***"