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: g_crossfading.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:39 $
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 : wolfram.garten@sun.com
36 '* short description :
38 '**************************************************************************************
40 '\*************************************************************************************
49 dim CounterForX as integer
50 dim anothercounter as integer
52 Call hNewDocument '/// New Impress document ///'
55 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
57 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// create rectangle ///'
59 EditSelectAll '/// Select all ///'
61 EditCrossFading '/// Choose Edit / CrossFading ///'
62 kontext "Ueberblenden"
63 X = Schritte.GetText ' /// Get counter-value and save it in X ///'
64 printlog "Steps before we start the test: " + X
65 printlog "Schritte.GetText= " + Schritte.GetText
68 if Schritte.GetText <> "1" then qaerrorlog "Could not change the step-number to 1."
70 for I = 2 to 10 ' /// How many steps do you want? ///'
72 if Schritte.GetText <> I then qaerrorlog "Could not change the step-number to" + I
76 FormatUngroupDraw '/// open context menu and ungroup objects ///'
78 qaerrorlog "Could not ungroup objects"
81 hTypeKeys "<TAB>" '/// Should make the first object active ///'
83 '/// Get position and dimensions of elements ///'
85 ContextPositionAndSize
87 qaerrorlog "Couldnt call 'ContextPositionAndSize' - No object selected?"
90 active.SetPage TabPositionAndSize
92 kontext "TabPositionAndSize"
93 if TabPositionAndSize.exists (5) then
96 FirstX=PositionX.GetText '/// Tet Dimensions of first object ///'
99 qaerrorlog "Couldn't switch tab page :-( "
103 anothercounter = I+2 '/// How many objects we have on the screen ///'
105 for Y = 1 to anothercounter '/// How many times we should step to (hopefully) get back to the first one ///'
106 if Y > anothercounter then warnlog "Too many steps, something is wrong."
108 hTypeKeys "<TAB>" '/// Step to the next object ///'
110 errolog "Could not step to the next object"
112 ' Printlog "- Get position and dimensions of elements"
113 ContextPositionAndSize '/// Open Position and Size for this object ///'
116 Active.SetPage TabPositionAndSize
117 Kontext "TabPositionAndSize"
118 CheckX=PositionX.GetText '/// Get Position X for this object ///'
120 TabPositionAndSize.OK
121 Kontext "DocumentDraw"
122 CounterForX=CounterForX+1 '/// Up one on the object-counter ///'
123 if CheckX=FirstX then '/// Check if Position is the same as the first one ///'
124 if anothercounter = CounterForX then printlog "The first box is at: " + CheckX + " And we're now at " + FirstX + " = Correct steps between the objects, everything's fine."
125 printlog "We should have " + Y + " objects to go through." '/// Just here for debugging. - FHA
126 ' printlog "anothercounter= " + anothercounter '/// Just here for debugging. - FHA
127 printlog "Number of objects: " + anothercounter
130 next Y '/// End or go on with the checking-loop ///'
132 EditSelectAll '/// Select all ///'
133 EditDelete '/// Delete all ///'
135 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
137 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// Create rectangle ///'
139 EditSelectAll '/// Select all ///'
141 EditCrossFading '/// Choose Edit / CrossFading ///'
143 kontext "Ueberblenden"
146 '/// And now we're gonna check if we can separate the object into it's parts ///'
147 '/// And check if the numbers of steps / objects is correct ///'
149 Schritte.ToMin '/// Select minimum value for number of steps ///'
151 Schritte.More '/// Raise the value for number of steps with one ///'
153 printlog "Value has been restored to: " + Schritte.GetText
154 printlog "X is now: " + X
155 Attributierung.UnCheck
158 Kontext "DocumentDraw"
159 EditSelectAll '/// Select all ///'
160 EditDelete '/// Delete all ///'
162 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
164 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// Create second rectangle ///'
165 EditSelectAll '/// Select all ///'
167 EditCrossFading '/// Choose Edit / CrossFading ///'
168 Kontext "Ueberblenden"
169 if Attributierung.IsChecked = TRUE then qaerrorlog "Attributierung / was NOT unchecked."
170 GleicheOrientierung.UnCheck '/// Uncheck "same orienation" ///' -????
171 Ueberblenden.OK '/// Close CrossFading-window with "OK" ///'
173 Kontext "DocumentDraw"
174 EditSelectAll '/// Select all ///'
175 EditDelete '/// Delete all ///'
177 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
179 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// create rectangle ///'
180 EditSelectAll '/// Select all ///'
182 EditCrossFading '/// Choose Edit / CrossFading ///'
183 Kontext "Ueberblenden"
184 if GleicheOrientierung.IsChecked = TRUE then qaerrorlog "GleicheOrientierung / was NOT unchecked."
185 Attributierung.Check '/// Check "Attributing" ///' - ???
186 Ueberblenden.OK '/// Close CrossFading-window with "OK" ///'
188 Kontext "DocumentDraw"
189 EditSelectAll '/// Select all ///'
191 EditDelete '/// Delete all ///'
193 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
195 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// Create second rectangle ///'
196 EditSelectAll '/// Select all ///'
198 EditCrossFading '/// Choose Edit / CrossFading ///'
199 Kontext "Ueberblenden"
200 if Attributierung.IsChecked = FALSE then qaerrorlog "Attributierung / was NOT checked again."
201 GleicheOrientierung.UnCheck '/// Check "same orientation" ///' -????
204 Kontext "DocumentDraw"
205 EditSelectAll '/// Select all ///'
206 EditDelete '/// Delete all ///'
208 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
210 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// create rectangle ///'
211 EditSelectAll '/// Select all ///'
213 EditCrossFading '/// Choose Edit / CrossFading ///'
214 Kontext "Ueberblenden"
215 if GleicheOrientierung.IsChecked = TRUE then qaerrorlog "GleicheOrientierung / was NOT checked again."
216 GleicheOrientierung.Check '/// Check "same orientation" ///' -????
217 Ueberblenden.OK '/// Close CrossFading-window with "OK" ///'
219 Kontext "DocumentDraw"
220 EditSelectAll '/// Select all ///'
221 EditDelete '/// Delete all ///'
222 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
224 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// create rectangle ///'
225 EditSelectAll '/// Select all ///'
227 EditCrossFading '/// Choose Edit / CrossFading ///'
228 Kontext "Ueberblenden"
229 if GleicheOrientierung.IsChecked = FALSE then qaerrorlog "GleicheOrientierung / was NOT checked again."
230 GleicheOrientierung.Check '/// Check "same orientation" ///' -????
231 Ueberblenden.OK '/// Close CrossFading-window with "OK" ///'
234 Kontext "DocumentDraw" '/// EditCrossFading should not be enabled if more than two objects is selected. ///'
235 EditSelectAll '/// Select all ///'
236 EditDelete '/// Delete all ///'
239 Call hRechteckErstellen ( 5, 5, 20, 30 ) '/// Create rectangle ///'
241 Call hRechteckErstellen ( 30, 30, 70, 70 ) '/// Create second rectangle ///'
243 Call hRechteckErstellen ( 20, 20, 50, 50 ) '/// Create third rectangle ///'
245 EditSelectAll '/// Select all ///'
248 EditCrossFading '/// Choose Edit / CrossFading ///'
250 If active = "Ueberblenden" then
251 qaerrorlog "CrossFading should NOT be selectable since more than two objects is selected."
252 kontext "Ueberblenden"
253 Ueberblenden.CANCEL '/// Close CrossFading-window with "CANCEL" ///'
256 Kontext "DocumentDraw"
258 printlog "CrossFading could not be selected when more than two objects selected: Correct."
262 EditSelectAll '/// Select all ///'
263 EditDelete '/// Delete all ///'
265 warnlog "Could not select and delete all objects."
268 printlog "End of test"
270 Call hCloseDocument '/// Close document ///'
272 endcase 'tCrossfading