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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : thorsten.bosbach@oracle.com
30 '* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types
32 '\******************************************************************************
39 gApplication = "WRITER"
43 PrintLog "- Writer : Chart without table"
44 hUseAsyncSlot( "InsertObjectChart" )
46 Kontext "DocumentChart"
47 if ( DocumentChart.Exists( 5 ) ) then
50 if ( ChartType.Exists( 5 ) ) then
53 warnlog "Chart Type dialog did bot occour."
55 Kontext "DocumentChart"
56 DocumentChart.TypeKeys "<ESCAPE>"
57 Kontext "DocumentWriter"
58 DocumentWriter.TypeKeys "<DELETE>"
60 warnlog "Chart has not been inserted."
63 PrintLog "- Writer : Chart out of a table only with numbers"
64 hUseAsyncSlot( "InsertTableWriter" )
66 Kontext "TabelleEinfuegenWriter"
67 if ( TabelleEinfuegenWriter.exists( 1 ) ) then
70 TabelleEinfuegenWriter.OK
71 TabelleEinfuegenWriter.notExists( 2 )
73 warnlog( "Dialog <TabelleEinfuegenWriter> did not open" )
76 Kontext "DocumentWriter"
80 DocumentWriter.TypeKeys sText$
81 DocumentWriter.TypeKeys "<Right>"
83 DocumentWriter.TypeKeys "<Down>"
84 DocumentWriter.TypeKeys "<Left>", 3
87 hUseAsyncSlot( "InsertObjectChart" )
88 hStepThroughChartWizard()
90 Kontext "DocumentChart"
91 DocumentChart.typeKeys "<ESCAPE>"
92 Kontext "DocumentWriter"
93 DocumentWriter.TypeKeys "<Delete>"
95 DocumentWriter.TypeKeys "<Down>", 20
96 DocumentWriter.TypeKeys "<Return>", 2
98 PrintLog "- Writer : Chart out of a table only with chars"
99 hUseAsyncSlot( "InsertTableWriter" )
101 Kontext "TabelleEinfuegenWriter"
102 if ( TabelleEinfuegenWriter.exists( 1 ) ) then
105 TabelleEinfuegenWriter.OK
106 TabelleEinfuegenWriter.notExists( 2 )
108 warnlog( "Dialog <TabelleEinfuegenWriter> did not open" )
111 Kontext "DocumentWriter"
115 DocumentWriter.TypeKeys "Hallo" + sText$
116 DocumentWriter.TypeKeys "<Right>"
118 DocumentWriter.TypeKeys "<Down>"
119 DocumentWriter.TypeKeys "<Left>", 3
122 hUseAsyncSlot( "InsertObjectChart" )
123 hStepThroughChartWizard()
125 Kontext "DocumentChart"
126 DocumentChart.typeKeys "<ESCAPE>"
127 Kontext "DocumentWriter"
128 DocumentWriter.TypeKeys "<Delete>"
130 DocumentWriter.TypeKeys "<Down>", 20
131 DocumentWriter.TypeKeys "<Return>", 2
133 PrintLog "- Writer : Math"
135 hUseAsyncSlot( "InsertObjectFormulaWriter" )
138 Kontext "DocumentWriter"
139 DocumentWriter.TypeKeys "<Delete>"
141 PrintLog "- Writer : floating frame"
142 hUseAsyncSlot( "InsertFloatingFrame" )
144 printlog( "Properties dialog for floating frame should open" )
145 Kontext "TabEigenschaften"
146 if ( TabEigenschaften.exists( 1 ) and TabEigenschaften.isVisible() ) then
148 printlog( "Name the floating frame, close the dialog" )
149 FrameName.SetText "Hallo"
150 Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
153 TabEigenSchaften.notExists( 2 )
157 printlog( "Close the writer document" )
158 Kontext "DocumentWriter"
159 DocumentWriter.TypeKeys "<Delete>"
166 '*******************************************************************************
175 const ICWAIT as Integer = 2
177 dim iCurrentPos as integer
178 dim iColumn as integer
181 const CHART_OBJECT_DEFAULT_POSITION_X = 30
182 const CHART_OBJECT_DEFAULT_POSITION_Y = 30
183 const OUTSIDE_CHART_OBJECT_X = 1
184 const OUTSIDE_CHART_OBJECT_Y = 1
185 const CURSOR_MOVEMENT_RETRIES = 20
186 const SELECT_CELLS_X = 7
187 const SELECT_CELLS_Y = 7
189 gApplication = "CALC"
191 brc = hCreateDocument()
193 warnlog( "Failed to create new " & gApplication & " document" )
196 PrintLog "- Calc : Chart without data"
199 hStepThroughChartWizard()
201 kontext "DocumentChart"
202 DocumentChart.typeKeys( "<ESCAPE>" )
204 Kontext "DocumentCalc"
205 gMouseClick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
208 ' If the OLE object is in selection mode the Drawing Object Bar should be
209 ' visible. As we do not know exactly where on the spreadsheet the object
210 ' appears we move from the upper left to the lower right corner of the
211 ' document until we hit an OLE object and the Drawing Object Bar is enabled.
212 ' Then <DEL> is sent to the document hopefully deleting the object.
214 for iCurrentPos = 1 to 9
216 kontext "DocumentCalc"
217 gMouseClick( 10 * iCurrentPos , 10 * iCurrentPos )
219 Kontext "DrawingObjectBar"
220 if ( DrawingObjectBar.exists( 1 ) ) then
222 kontext "DocumentCalc"
223 DocumentCalc.TypeKeys( "<Delete>" )
224 printlog( "Found drawing object, executed <DEL> on the object" )
229 qaerrorlog( "Drawing object not hit, trying again" )
238 PrintLog "- Calc : Chart with data"
240 kontext "DocumentCalc"
241 DocumentCalc.TypeKeys( "<MOD1 HOME>" )
242 for iColumn = 1 to SELECT_CELLS_Y
243 for iRow = 1 to SELECT_CELLS_X
244 hTypeKeys ( iColumn * iRow )
245 hTypeKeys ( "<Return>" )
247 DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES )
248 DocumentCalc.TypeKeys( "<Right>", iColumn )
251 DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES )
252 call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y )
256 hStepThroughChartWizard()
258 Kontext "DocumentCalc"
259 DocumentCalc.typeKeys("<escape>")
262 PrintLog "- Calc : Chart for a table only with text"
264 Kontext "DocumentCalc"
265 DocumentCalc.TypeKeys( "<MOD1 HOME>" )
266 for iColumn = 1 to SELECT_CELLS_Y
267 for iRow = 1 to SELECT_CELLS_X
268 hTypeKeys ( "Hallo<Return>" )
270 DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES
271 DocumentCalc.TypeKeys "<Right>", iColumn
274 DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES
275 call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y )
279 hStepThroughChartWizard()
281 Kontext "DocumentCalc"
282 gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
285 PrintLog( "- Calc : Math" )
287 InsertObjectFormulaCalc
290 gMouseClick ( 50, 99 )
293 PrintLog( "- Calc : floating frame" )
297 Kontext "TabEigenschaften"
298 FrameName.SetText( "Hallo" )
299 Inhalt.SetText( ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) )
301 TabEigenschaften.OK()
304 gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
307 brc = hDestroyDocument()
311 '*******************************************************************************
316 Dim iMenuCount(1) as integer
318 gApplication = "DRAW"
322 PrintLog "- Draw : Math"
323 InsertObjectFormulaDraw
326 gMouseClick ( 1 , 1 )
329 DocumentDraw.TypeKeys "<Delete>"
331 PrintLog "- Draw : Chart"
334 iMenuCount(0) = menuGetItemCount
338 hUseAsyncSlot( "InsertObjectChart" )
341 Kontext "DocumentChart"
342 DocumentChart.useMenu
343 iMenuCount(1) = menuGetItemCount
345 if iMenuCount(0) = iMenuCount(1) then
346 warnlog "Menu bar didn't change after inserting OLE object; It should be different from: " +iMenuCount(0)
348 printlog "Menu bar did change; from: " + iMenuCount(0) + "; to: " + iMenuCount(1)
351 gMouseClick ( 1 , 1 )
354 DocumentDraw.TypeKeys "<Delete>"
359 PrintLog "- Draw : Calc"
361 InsertSpreadsheetDraw
364 gMouseClick ( 1 , 1 )
367 DocumentDraw.TypeKeys "<Delete>"
369 PrintLog "- Draw : floating frame"
374 Kontext "TabEigenschaften"
376 FrameName.SetText "Hallo"
377 Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
382 gMouseClick ( 1 , 1 )
385 DocumentDraw.TypeKeys "<Delete>"
394 '*******************************************************************************
400 gApplication = "IMPRESS"
404 PrintLog "- Impress : Math"
406 InsertObjectFormulaDraw
409 gMouseClick ( 1 , 1 )
412 DocumentImpress.TypeKeys "<Delete>"
415 PrintLog "- Impress : Chart"
418 hUseAsyncSlot( "InsertObjectChart" )
421 gMouseClick ( 1 , 1 )
424 DocumentImpress.TypeKeys "<Delete>"
430 PrintLog "- Impress : Calc"
432 InsertSpreadsheetDraw
435 gMouseClick ( 1 , 1 )
438 DocumentImpress.TypeKeys "<Delete>"
441 PrintLog "- Impress : floating frame"
446 Kontext "TabEigenschaften"
447 FrameName.SetText "Hallo"
449 Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
454 gMouseClick ( 1 , 1 )
460 DocumentImpress.TypeKeys "<Delete>"