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_convertto.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 '**************************************************************************************
39 ' #1 tiAendernUmwandelnInPolygon
40 ' #1 tiModifyConvertToPolygon
41 ' #1 tdContextConvertIntoBitmap
42 ' #1 tiAendernUmwandelnInKurve
43 ' #1 tiAendernUmwandelnInPolygonGrafik
44 ' #1 tiAendernUmwandelnIn3D
45 ' #1 tiAendernUmwandelnIn3DRotationskoerper
46 ' #1 tiAendernUmwandelnInMetaFile
47 '\*************************************************************************************
49 ' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\columbia.dxf")
50 ' Call hGrafikEinfuegen ConvertPath ( gTesttoolPath + "global\input\graf_inp\enter.bmp" )
51 ' Dateiname.SetText ConvertPath ( gTesttoolPath + "global\input\graf_inp\desp.bmp" )
52 ' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\purzel.gif")
55 ' Call tdContextConvertIntoCurve
56 ' Call tdContextConvertInto3D
57 ' Call tdContextConvertInto3D_Rotationobject
58 ' Call tdContextConvertIntoMetaFile
60 testcase tiModifyConvertToPolygon
63 Dim Maxanzahl as string
64 Dim Minanzahl as string
68 hTextrahmenErstellen ("This is a text that will be transformed into a Polygon-object", 10,10,60,30)
74 ContextConvertIntoPolygon
76 ContextPositionAndSize
78 Active.SetPage TabPositionAndSize
79 Kontext "TabPositionAndSize"
86 Active.SetPage TabFont
92 if (gAsianSup OR gCTLSup) then
96 Warnlog "Asian or ctl support is enabled, but Size of font is not accessable :-("
99 Warnlog "Asian or ctl support is NOT enabled, but Size of font is not accessable :-("
101 SizeWest.SetText "96"
102 qaErrorLog "SizeWest. works"
106 SizeEast.SetText "96"
107 qaErrorLog "SizeEast. works"
112 qaErrorLog "Size. works"
117 qaErrorLog "SizeCTL. works"
124 ContextPositionAndSize
126 Active.SetPage TabPositionAndSize
127 Kontext "TabPositionAndSize"
128 '/// compare width and heigth to control is it is still text ///'
129 if ( Width.GetText = PosX or Height.GetText = PosY ) Then
130 Printlog "- Text converted into polygon"
132 Warnlog "- Convert into polygon does not work."
134 TabPositionAndSize.OK
137 Printlog "-------------------------------------------------end"
141 '/// insert graphic (input\\impress\\grafik\\sample.bmp)///'
142 Call hGrafikEinfuegen ConvertPath ( gTesttoolPath + "global\input\graf_inp\enter.bmp" )
144 ContextConvertIntoPolygon
145 Kontext "UmwandelnInPolygon"
147 MaxAnzahl = Farbanzahl.GetText
149 If Maxanzahl < Farbanzahl.GetText Then Warnlog "- Maximum value could be raised."
150 Farbanzahl.ToMin '/// set color to min ///'
151 MinAnzahl = Farbanzahl.GetText
152 Farbanzahl.Less 1 '/// try to set a value lower than minimum ///'
153 If Farbanzahl.GetText < Minanzahl then Warnlog "- Minimum value could be lowered."
154 Farbanzahl.SetText "2"
157 UmwandelnInPolygon.OK
159 Printlog "- object vectorized."
160 'TBO: verify nasty bug about asian/ctl support
162 call hToolsOptions ("Languagesettings", "Languages")
163 printlog "Asian: '" + Aktivieren.IsChecked + "'"
164 printlog "CTL : '" + ComplexScriptEnabled.IsChecked + "'"
165 Kontext "ExtrasOptionenDlg"
167 '-----------------------------------------------
170 endcase 'tiModifyConvertToPolygon
171 '--------------------------------------------------------
172 testcase tdContextConvertIntoBitmap
174 Call hNewDocument '/// new document ///'
176 InsertGraphicsFromFile '/// insert graphic ///'
179 if Active.Exists Then
183 Kontext "GrafikEinfuegenDlg"
185 '/// uses input\\impress\\grafik\\columbia.dxf ///
186 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\columbia.dxf")
191 if Active.Exists Then
192 Warnlog Active.GetText + ", Test will end here because of problems putting graphics into the document"
198 Kontext "DocumentImpress"
200 ContextConvertIntoBitmap '/// convert dxf file to bitmap ///'
202 Printlog "- Convert into bitmap works"
204 Warnlog "- Convert into bitmap does not work"
207 Call hCloseDocument '/// close document ///'
209 endcase 'tdContextConvertIntoBitmap
210 '--------------------------------------------------------
211 testcase tiAendernUmwandelnInKurve
213 Printlog " ----- ContextConvertIntoCurve testen"
215 Call hNewDocument '/// New impress document///'
217 Call hTextrahmenErstellen ("I test,test,test,test only, if it works for you",20,20,60,30) '/// create textbox///'
219 Kontext "DocumentImpress"
220 gMouseDoubleClick 70,70 '/// deselect textbox ///'
222 EditSelectAll '/// select textbox ///'
224 ContextConvertIntoCurve '/// convert into curve ///'
228 hTypeKeys "<SHIFT RIGHT>",3 '/// try to select 3 letters ///'
230 EditCopy '/// try edit copy to check if its still text ///'
231 Warnlog " - Convert into curve, seperate letters should not be selectable anymore"
233 Printlog " - Text converted into a curve"
236 Call hCloseDocument '/// close document ///'
238 endcase 'tiAendernUmwandelnInKurve
239 '--------------------------------------------------------
240 testcase tiAendernUmwandelnInPolygonGrafik
242 Printlog "- Context/ConvertIntoPolygon"
244 Call hNewDocument '/// new document ///'
246 InsertGraphicsFromFile '/// insert graphic (desp.bmp) ///'
248 Kontext "GrafikEinfuegenDlg"
249 '///use graphic : input\\impress\\grafik\\desp.bmp ///
250 Dateiname.SetText ConvertPath ( gTesttoolPath + "global\input\graf_inp\desp.bmp" )
253 Kontext "DocumentImpress"
257 ContextConvertIntoPolygon '/// convert into polygon ///'
258 Kontext "UmwandelnInPolygon"
259 Printlog "- Testing vectorize dialog"
260 Farbanzahl.ToMax '/// set number of colors to max ///'
261 if Farbanzahl.GetText <> "32" Then Warnlog "- Maximum value for color depth should be 32, but it is: " + Farbanzahl.GetText
262 Farbanzahl.ToMin '/// set number of colors to min ///'
264 if Farbanzahl.GetText <> "8" Then Warnlog "- Minimum value for color depth should be 8 but it is: " + Farbanzahl.GetText
266 Punktreduktion.SetText "50" '/// set point reduction to 50 ///'
268 if Punktreduktion.GetText <> "32 Pixel" Then Warnlog "- Maximum value should be 32, but it is: " + Punktreduktion.GetText
270 Punktreduktion.SetText "-50" '/// set an out of range value ///'
272 if Punktreduktion.GetText <> "0 Pixel" Then Warnlog "- Minimum value should be 0, but it is: " + Punktreduktion.GetText
273 Loecherfuellen.Uncheck '/// uncheck fill holes ///'
274 if Not Kachelgroesse.IsEnabled Then
275 Printlog "- Control disabled."
277 Warnlog "- Control should be disabled if Fill is not checked."
279 Vorschau.Click '/// open preview ///'
281 UmwandelnInPolygon.OK '/// close dialog ///'
283 Call hCloseDocument '/// close document ///'
285 endcase 'tiAendernUmwandelnInPolygonGrafik
286 '--------------------------------------------------------
287 testcase tiAendernUmwandelnIn3D
289 Printlog "- Convert into 3D"
291 sleep 1 '/// new impress document ///'
292 hRechteckErstellen (10,10,40,40) '/// create rectangle ///'
293 '/// convert into 3D ///'
298 ContextConvertInto3D '/// try to access convert ito 3d a 2nd time, should be impossible using a 3d object as source ///'
299 Printlog "- Convert into 3D works"
301 Warnlog "- Convert into 3D does not work"
303 Call hCloseDocument '/// close document '///
305 endcase 'tiAendernUmwandelnIn3D
306 '--------------------------------------------------------
307 testcase tiAendernUmwandelnIn3DRotationskoerper
309 Printlog "- ConvertInto3DRotationobject"
313 Call hNewDocument '/// new document '///
314 Kontext "DocumentImpress"
315 hRechteckErstellen (20,20,50,50) '/// create rectangle ///'
317 ContextPositionAndSize '/// get position values for the rectangle ///'
319 Active.SetPage TabPositionAndSize
320 Kontext "TabPositionAndSize"
321 PosX = PositionX.GetText
322 PosY = PositionY.GetText
323 TabPositionAndSize.OK
325 Kontext "DocumentImpress"
326 ContextConvertInto3DRotationObject '/// convert into 3d lathe object ///'
328 ContextPositionAndSize
330 Active.SetPage TabPositionAndSize '/// control changes in position values to confirm convert action ///'
331 Kontext "TabPositionAndSize"
332 if PositionX.GetText = PosX and PositionY.GetText = PosY Then Warnlog "- No change in position or dimension, converting seemd not to work"
333 TabPositionAndSize.OK
335 Call hCloseDocument '/// close document ///'
337 endcase 'tiAendernUmwandelnIn3DRotationskoerper
338 '--------------------------------------------------------
339 testcase tiAendernUmwandelnInMetaFile
341 Printlog "- ConvertIntoMetaFile"
343 Call hNewDocument '/// new document ///'
345 InsertGraphicsFromFile '/// insert graphic ///'
349 if Active.Exists Then
353 Kontext "GrafikEinfuegenDlg"
355 '/// uses input\\impress\\grafik\\desp.gif") ///
356 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\purzel.gif")
360 Kontext "DocumentImpress"
362 ContextConvertIntoMetafile '/// convert bitmap into metafile ///'
364 Printlog "- Convert into Metafile does work"
366 Warnlog "- Convert into Metafile does not work"
369 Call hCloseDocument '/// close document ///'
371 endcase 'tiAendernUmwandelnInMetaFile