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: w_insertgraphic5.inc,v $
13 '* last change: $Author: fredrikh $ $Date: 2008-06-18 15:03:54 $
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 : helge.delfs@sun.com
36 '* short description : Test of the insert graphic function - 4
38 '************************************************************************
40 ' #1 tInsertGraphic_41 'Test checkbox 'Keep image size'
41 ' #1 tInsertGraphic_42 'Test checkbox 'Keep scale'
42 ' #1 tInsertGraphic_43 'Test spacing in tabpage 'wrap'
43 ' #1 tInsertGraphic_44 'Set the possible Options for the different Wrap types
44 ' #1 tInsertGraphic_45 'Test Scale in Corp tabpage
45 ' #1 tInsertGraphic_46 'Test Image size in Corp tabpage
46 ' #1 tInsertGraphic_47 'Test Restore via "Original Size" button
47 ' #1 tInsertGraphic_48 'Test link area via a embeded file
48 ' #1 tInsertGraphic_49 'Test link area via a linked file
50 '\***********************************************************************
52 testcase tInsertGraphic_41
58 Dim sScaleWidth as String
59 Dim sScaleHeight as String
60 Dim sImageWidth as String
61 Dim sImageHeight as String
65 sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
66 sRight = "1"+ gSeperator + "00" + gMeasurementUnit
67 sUp = "1"+ gSeperator + "00" + gMeasurementUnit
68 sBottom = "1"+ gSeperator + "00" + gMeasurementUnit
70 PrintLog "- Test checkbox 'Keep image size'"
71 '/// Test checkbox 'Keep image size'
75 '/// Insert a graphics
76 fInsertGraphics("game.bmp")
78 '/// Format / Graphic / Crop , check 'Keep image size' ,
79 '/// - increase the value , check if "keep image size" is efficient
80 fFormatGraphic("TabZuschneiden")
82 GroesseBeibehalten.Check
85 sScaleWidth = MassstabBreite.GetText
86 sScaleHeight = MassstabHoehe.GetText
87 sImageWidth = GroesseBreite.GetText
88 sImageHeight = GroesseHoehe.GetText
90 PrintLog "- increase Left "
94 if StrToDouble(MassstabBreite.GetText) <= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
95 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
96 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
97 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
99 sScaleWidth = MassstabBreite.GetText
101 PrintLog "- increase Right"
102 Rechts.SetText sRight
105 if StrToDouble(MassstabBreite.GetText) <= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
106 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
107 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
108 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
110 sScaleWidth = MassstabBreite.GetText
112 PrintLog "- increase Top "
116 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
117 if StrToDouble(MassstabHoehe.GetText) <= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
118 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
119 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
121 sScaleHeight = MassstabHoehe.GetText
123 PrintLog "- increase Bottom "
124 Unten.SetText sBottom
127 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
128 if StrToDouble(MassstabHoehe.GetText) <= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
129 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
130 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
132 TabZuschneiden.Cancel
134 '/// - decrease value , check if "keep image size" is efficient
135 fFormatGraphic("TabZuschneiden")
137 GroesseBeibehalten.Check
140 sScaleWidth = MassstabBreite.GetText
141 sScaleHeight = MassstabHoehe.GetText
142 sImageWidth = GroesseBreite.GetText
143 sImageHeight = GroesseHoehe.GetText
145 PrintLog "- decrease Left "
146 Links.SetText "-" + sLeft
149 if StrToDouble(MassstabBreite.GetText) >= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
150 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
151 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
152 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
154 sScaleWidth = MassstabBreite.GetText
156 PrintLog "- decrease Right"
157 Rechts.SetText "-" + sRight
160 if StrToDouble(MassstabBreite.GetText) >= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
161 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
162 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
163 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
165 sScaleWidth = MassstabBreite.GetText
167 PrintLog "- decrease Top "
168 Oben.SetText "-" + sUp
171 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
172 if StrToDouble(MassstabHoehe.GetText) >= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
173 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
174 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
176 sScaleHeight = MassstabHoehe.GetText
178 PrintLog "- decrease Bottom "
179 Unten.SetText "-" + sBottom
182 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
183 if StrToDouble(MassstabHoehe.GetText) >= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
184 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
185 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
187 TabZuschneiden.Cancel
193 '-------------------------------------------------------------------------------------------
195 testcase tInsertGraphic_42
200 Dim sBottom as String
201 Dim sScaleWidth as String
202 Dim sScaleHeight as String
203 Dim sImageWidth as String
204 Dim sImageHeight as String
205 Dim dDummy1 as double
206 Dim dDummy2 as double
208 sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
209 sRight = "1"+ gSeperator + "00" + gMeasurementUnit
210 sUp = "1"+ gSeperator + "00" + gMeasurementUnit
211 sBottom = "1"+ gSeperator + "00" + gMeasurementUnit
213 PrintLog "- Test checkbox 'Keep scale'"
214 '/// Test checkbox 'Keep scale'
218 '/// Insert a graphics
219 fInsertGraphics("game.bmp")
221 '/// Format / Graphic / Crop , check Keep scale
222 '/// - increase the value
223 fFormatGraphic("TabZuschneiden")
225 MassstabBeibehalten.Check
228 sScaleWidth = MassstabBreite.GetText
229 sScaleHeight = MassstabHoehe.GetText
230 sImageWidth = GroesseBreite.GetText
231 sImageHeight = GroesseHoehe.GetText
233 PrintLog "- increase Left "
237 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
238 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
239 if StrToDouble(GroesseBreite.GetText) >= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
240 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
242 sImageWidth = GroesseBreite.GetText
244 PrintLog "- increase Right"
245 Rechts.SetText sRight
248 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
249 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
250 if StrToDouble(GroesseBreite.GetText) >= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
251 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
253 sImageWidth = GroesseBreite.GetText
255 PrintLog "- increase Top "
259 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
260 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
261 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
262 if StrToDouble(GroesseHoehe.GetText) >= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
264 sImageHeight = GroesseHoehe.GetText
266 PrintLog "- increase Bottom "
267 Unten.SetText sBottom
270 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
271 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
272 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
273 if StrToDouble(GroesseHoehe.GetText) >= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
275 TabZuschneiden.Cancel
277 '/// - decrease value
278 fFormatGraphic("TabZuschneiden")
280 MassstabBeibehalten.Check
283 sScaleWidth = MassstabBreite.GetText
284 sScaleHeight = MassstabHoehe.GetText
285 sImageWidth = GroesseBreite.GetText
286 sImageHeight = GroesseHoehe.GetText
288 PrintLog "- decrease Left "
289 Links.SetText "-" + sLeft
292 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
293 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
294 if StrToDouble(GroesseBreite.GetText) <= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
295 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
297 sImageWidth = GroesseBreite.GetText
299 PrintLog "- decrease Right"
300 Rechts.SetText "-" + sRight
303 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
304 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
305 if StrToDouble(GroesseBreite.GetText) <= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
306 if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
308 sImageWidth = GroesseBreite.GetText
310 PrintLog "- decrease Top "
311 Oben.SetText "-" + sUp
314 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
315 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
316 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
317 if StrToDouble(GroesseHoehe.GetText) <= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
319 sImageHeight = GroesseHoehe.GetText
321 PrintLog "- decrease Bottom "
322 Unten.SetText "-" + sBottom
325 if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
326 if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
327 if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
328 if StrToDouble(GroesseHoehe.GetText) <= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
330 TabZuschneiden.Cancel
336 '-------------------------------------------------------------------------------------------
338 testcase tInsertGraphic_43
343 Dim sBottom as String
345 sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
346 sRight = "2"+ gSeperator + "00" + gMeasurementUnit
347 sUp = "3"+ gSeperator + "00" + gMeasurementUnit
348 sBottom = "4"+ gSeperator + "00" + gMeasurementUnit
350 PrintLog "- Test spacing in tabpage 'wrap'"
351 '/// Test spacing in tabpage 'wrap'
355 '/// Insert a graphics
356 fInsertGraphics("game.bmp")
358 '/// Format / Graphic / Wrap , set value in spacing area
359 fFormatGraphic("TabUmlauf")
363 AbstaendeLinks.SetText sLeft
365 AbstaendeRechts.SetText sRight
367 AbstaendeOben.SetText sUp
369 AbstaendeUnten.SetText sBottom
373 '/// Check if the set value is correct
374 fFormatGraphic("TabUmlauf")
375 if AbstaendeLinks.GetText <> sLeft then warnlog "Spacing - Lefe isn't correct!"
376 if AbstaendeRechts.GetText <> sRight then warnlog "Spacing - Right isn't correct!"
377 if AbstaendeOben.GetText <> sUp then warnlog "Spacing - Top isn't correct!"
378 if AbstaendeUnten.GetText <> sBottom then warnlog "Spacing - Bottom isn't correct!"
385 '-------------------------------------------------------------------------------------------
387 testcase tInsertGraphic_44
389 PrintLog "- Set the possible Options for the different Wrap types"
390 '/// Set the possible Options for the different Wrap types
394 '/// Insert a graphics
395 fInsertGraphics("Bughunter.jpg")
397 PrintLog " 1. No Wrap:"
398 '/// Format / Graphic / tabpage Wrap - No page , check possible options
399 fFormatGraphic("TabUmlauf")
403 if ErsterAbsatz.IsEnabled = TRUE then Warnlog "Checkbox - First paragraph should be unenabled!"
404 if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
405 if Kontur.IsEnabled = TRUE then Warnlog "Checkbox - Contour should be unenabled!"
406 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
409 PrintLog " 2. Before:"
410 '/// Format / Graphic / tabpage Wrap - Before , check possible options
411 fFormatGraphic("TabUmlauf")
415 if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
416 if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
417 if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
418 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
422 if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
425 PrintLog " 3. After:"
426 '/// Format / Graphic / tabpage Wrap - After , check possible options
427 fFormatGraphic("TabUmlauf")
431 if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
432 if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
433 if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
434 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
438 if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
441 PrintLog " 4. Parallel:"
442 '/// Format / Graphic / tabpage Wrap - Parallel , check possible options
443 fFormatGraphic("TabUmlauf")
447 if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
448 if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
449 if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
450 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
454 if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
457 PrintLog " 5. Through:"
458 '/// Format / Graphic / tabpage Wrap - Through , check possible options
459 fFormatGraphic("TabUmlauf")
463 if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
464 if ImHintergrund.IsEnabled <> TRUE then Warnlog "Checkbox - In background should be enabled!"
465 if Kontur.IsEnabled = TRUE then Warnlog "Checkbox - Contour should be unenabled!"
466 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
469 PrintLog " 6. Optimal:"
470 '/// Format / Graphic / tabpage Wrap - Optimal , check possible options
471 fFormatGraphic("TabUmlauf")
475 if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
476 if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
477 if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
478 if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
482 if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
489 '-------------------------------------------------------------------------------------------
491 testcase tInsertGraphic_45
493 Dim sScaleWidth as String
494 Dim sScaleHeight as String
495 Dim sImageWidth as String
496 Dim sImageHeight as String
499 sScaleHeight = "100%"
501 PrintLog "- Test Scale in Corp tabpage"
502 '/// Test Scale in Corp tabpage
506 '/// Insert a graphics
507 fInsertGraphics("game.bmp")
510 '/// Format/Graphic tabpage corp , double Scale (width and height)
511 fFormatGraphic("TabZuschneiden")
513 MassstabBreite.SetText sScaleWidth
514 MassstabHoehe.SetText sScaleHeight
517 fFormatGraphic("TabZuschneiden")
519 sImageWidth = GroesseBreite.GetText
520 sImageHeight = GroesseHoehe.GetText
523 sScaleHeight = "200%"
525 MassstabBreite.SetText sScaleWidth
527 MassstabHoehe.SetText sScaleHeight
530 sImageWidth = Str(StrToDouble(sImageWidth) *2) + gMeasurementUnit
531 sImageHeight = Str(StrToDouble(sImageHeight)*2) + gMeasurementUnit
533 '/// Check if the image size (width and height) are changed corresponding
534 if fCalculateTolerance(GroesseBreite.GetText , sImageWidth) > 0.03 then
535 Warnlog "Image Width is wrong, should be " + sImageWidth + " but get " + GroesseBreite.GetText
538 if fCalculateTolerance(GroesseHoehe.GetText , sImageHeight) > 0.03 then
539 Warnlog "Image Height is wrong, should be " + sImageHeight + " but get " + GroesseHoehe.GetText
541 TabZuschneiden.Cancel
547 '-------------------------------------------------------------------------------------------
549 testcase tInsertGraphic_46
551 Dim sScaleWidth as String
552 Dim sScaleHeight as String
553 Dim sImageWidth as String
554 Dim sImageHeight as String
556 sImageWidth = "4"+ gSeperator + "00" + gMeasurementUnit
557 sImageHeight = "2"+ gSeperator + "80" + gMeasurementUnit
559 PrintLog "- Test Image size in Corp tabpage"
560 '/// Test Image size in Corp tabpage
564 '/// Insert a graphics
565 fInsertGraphics("game.bmp")
568 '/// Format/Graphic tabpage corp , double Imagin size (width and height)
569 fFormatGraphic("TabZuschneiden")
571 GroesseBreite.SetText sImageWidth
572 GroesseHoehe.SetText sImageHeight
575 fFormatGraphic("TabZuschneiden")
577 sScaleWidth = MassstabBreite.GetText
578 sScaleHeight = MassstabHoehe.GetText
580 sImageWidth = "8"+ gSeperator + "00" + gMeasurementUnit
581 sImageHeight = "5"+ gSeperator + "60" + gMeasurementUnit
583 GroesseBreite.SetText sImageWidth
585 GroesseHoehe.SetText sImageHeight
588 '/// Check if the Scale(width and height) are changed corresponding
589 if Abs(StrToDouble(sScaleWidth) *2 - StrToDouble(MassstabBreite.GetText) ) > 2 then
590 Warnlog "Scale Width is wrong, should be " + Str(StrToDouble(sScaleWidth) *2) + "%" + " but get " + MassstabBreite.GetText
593 if Abs(StrToDouble(sScaleHeight) *2 - StrToDouble(MassstabHoehe.GetText) ) > 2 then
594 Warnlog "Scale Height is wrong, should be " + Str(StrToDouble(sScaleHeight)*2) + "%" + " but get " + MassstabHoehe.GetText
596 TabZuschneiden.Cancel
602 '-------------------------------------------------------------------------------------------
604 testcase tInsertGraphic_47
606 Dim sScaleWidth as String
607 Dim sScaleHeight as String
608 Dim sImageWidth as String
609 Dim sImageHeight as String
610 Dim sNewImageWidth as String
611 Dim sNewImageHeight as String
613 sNewImageWidth = "8"+ gSeperator + "00" + gMeasurementUnit
614 sNewImageHeight = "5"+ gSeperator + "60" + gMeasurementUnit
616 PrintLog "- Test Restore via 'Original Size' button"
617 '/// Test Restore via "Original Size" button
621 '/// Insert a graphics
622 fInsertGraphics("game.bmp")
625 '/// Format/Graphic tabpage corp , double Image size (width and height)
626 fFormatGraphic("TabZuschneiden")
628 sScaleWidth = MassstabBreite.GetText
629 sScaleHeight = MassstabHoehe.GetText
630 sImageWidth = GroesseBreite.GetText
631 sImageHeight = GroesseHoehe.GetText
633 GroesseBreite.SetText sNewImageWidth
635 GroesseHoehe.SetText sNewImageHeight
638 '/// + Click 'Original size' button
639 Originalgroesse.Click
642 '/// Check if the Scale and Image size are recovered to the original size
643 if MassstabBreite.GetText <> sScaleWidth then warnlog "Scale Width isn't right !"
644 if MassstabHoehe.GetText <> sScaleHeight then warnlog "Scale Height isn't right !"
645 if GroesseBreite.GetText <> sImageWidth then warnlog "Image Width isn't right !"
646 if GroesseHoehe.GetText <> sImageHeight then warnlog "Image Height isn't right !"
647 TabZuschneiden.Cancel
653 '-------------------------------------------------------------------------------------------
655 testcase tInsertGraphic_48
657 Dim sFileName as String
659 sFileName = "game.bmp"
661 PrintLog "- Test link area via a embedded file"
662 '/// Test link area via a embedded file
666 '/// Insert a graphics (embeded)
667 InsertGraphicsFromFile
668 Kontext "GrafikEinfuegenDlg"
669 Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic\" + sFileName) )
676 '/// Format/Graphic tabpage Graphics , check if we can get [None] in file name in Link area
677 fFormatGraphic("TabGrafik")
679 if left(Dateiname.GetText , 1) <> "[" then warnlog "Should be none in file name, but get " + Dateiname.GetText
680 if Durchsuchen.IsEnabled = TRUE then Warnlog "Button should be unEnabled!"
687 '-------------------------------------------------------------------------------------------
689 testcase tInsertGraphic_49
691 Dim sFileName as String
692 Dim sHopeResult as String
694 sFileName = "game.bmp"
695 sHopeResult = fConvertBacklashToSlash(gTesttoolpath + "writer\optional\input\insertgraphic\" + sFileName)
697 if gPlatGroup <> "unx" then
698 sHopeResult = "file:///" + sHopeResult
700 sHopeResult = "file://" + sHopeResult
703 PrintLog "- Test link area via a linked file"
704 '/// Test link area via a linked file
708 '/// Insert a graphics (linked)
709 fInsertGraphics(sFileName)
711 '/// Format/Graphic tabpage Graphics , check if we can get
712 '/// + the correct name in 'file name' in Link area
713 fFormatGraphic("TabGrafik")
715 if Dateiname.GetText <> sHopeResult then warnlog "linked file name is wrong, should be " + sHopeResult + " but get " + Dateiname.GetText
719 Kontext "GrafikEinfuegenDlg"
720 if Dateiname.GetSelText <> sFileName then warnlog "file name is wrong, should be " + sFileName + " but get " + Dateiname.GetText
721 if Link.IsChecked <> TRUE then warnlog "The linked checkbox should be checked!"
722 GrafikEinfuegenDlg.Cancel
724 warnlog "Button should be enabled!"
734 '-------------------------------------------------------------------------------------------
736 function fCalculateTolerance( sNumber1 , sNumber2 )
738 '/// change 2 parameters to number , then Compare them and return the result.
740 Dim dNumber1 as Single
741 dim dNumber2 as Single
742 Dim iCommaLocation1 as integer
743 Dim iCommaLocation2 as Integer
745 'the code below 4 lines is set "2,00cm" to "2.00"cm if needed
746 iCommaLocation1 = InStr(sNumber1 , ",")
747 if iCommaLocation1 > 0 then
748 sNumber1 = Left(sNumber1 , iCommaLocation1-1) + "." + Right(sNumber1,Len(sNumber1) - iCommaLocation1)
751 iCommaLocation2 = InStr(sNumber2 , ",")
752 if iCommaLocation2 > 0 then
753 sNumber2 = Left(sNumber2 , iCommaLocation2-1) + "." + Right(sNumber2,Len(sNumber2) - iCommaLocation2)
756 dNumber1 = Val( Left(sNumber1, Len(sNumber1)-Len(gMeasurementUnit) ))
757 dNumber2 = Val( Left(sNumber2, Len(sNumber2)-Len(gMeasurementUnit) ))
758 fCalculateTolerance = Abs( dNumber1 - dNumber2 )