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: export_graphic_2.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:17:40 $
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 : Graphics Export B-tests. (the usual suspects)
38 '\******************************************************************************
43 dim iWaitIndex as integer
47 sFilter = "PNG - Portable Network Graphic (.png)"
50 hFileOpen( gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString )
52 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
54 if PNGOptionen.Exists (2) then
59 do while PNGOptionen.Exists AND iWaitIndex < 30
61 iWaitIndex = iWaitIndex + 1
64 if ( dir(OutputGrafikTBO+sExt) <> "") then
65 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
67 warnlog "File didn't get saved :-("
73 Call hGrafikEinfuegen ( OutputGrafikTBO+sExt )
79 '-------------------------------------------------------------------------------
92 dim sDocument as string
94 sFilter = "SVM - StarView Metafile (.svm)"
97 sDocument = ConvertPath ( gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString)
100 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
101 Kontext "SVMOptionen"
102 if SVMOptionen.Exists (2) then
104 if Breite.IsEnabled then
107 if Hoehe.IsEnabled then
115 if ( dir(OutputGrafikTBO+sExt) = "") then ' inspired by bug #99932 Graphic is exported though cancel is pressed
118 warnlog "dialog was canceled, but file got saved, too :-( - i35177"
121 Warnlog "No '" & sFilter & "' -Dialog!"
126 if Active.Exists(2) then
127 Warnlog " '" & sFilter & "' has a problem"
131 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
132 Kontext "SVMOptionen"
133 if SVMOptionen.Exists (2) then
140 if ( dir(OutputGrafikTBO+sExt) <> "") then
141 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
143 warnlog "File didn't get saved :-("
149 Call hGrafikEinfuegen ( OutputGrafikTBO+sExt )
152 hFileOpen (sDocument)
155 sMakeReadOnlyDocumentEditable
157 hTypeKeys ("<escape><tab>")
158 fGetSizeXY sx1, sY, TRUE
159 if hCallExport (OutputGrafikTBO & "1" , sFilter, TRUE ) = TRUE then
160 Kontext "SVMOptionen"
161 if SVMOptionen.Exists (2) then
166 if ( dir(OutputGrafikTBO & "1" & sExt) <> "") then
167 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "1" & sExt & "'"
169 warnlog "File didn't get saved :-("
175 Call hGrafikEinfuegen ( OutputGrafikTBO & "1" & sExt )
177 fGetSizeXY sx1, sY, bTemp
178 if (bTemp = FALSE) then
179 warnlog "Selected original size NOT OK :-("
184 hRechteckErstellen ( 10, 10, 30, 40 )
185 if hCallExport (OutputGrafikTBO & "2" , sFilter, TRUE ) = TRUE then
186 Kontext "SVMOptionen"
187 if SVMOptionen.Exists (2) then
191 Groesse.Check 'Check to make settings go throught
197 if ( dir(OutputGrafikTBO & "2" & sExt) <> "") then
198 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "2" & sExt & "'"
200 warnlog "File didn't get saved :-("
204 hFileOpen (OutputGrafikTBO & "2" & sExt)
205 kontext "Filterauswahl"
206 if Filterauswahl.exists then
207 Warnlog "Error when loading the file. The Filter-dialogue came up. Test aborted."
211 kontext "DocumentDraw"
212 DocumentDraw.TypeKeys ("<escape><tab>")
215 fGetSizeXY sx1, sY, bTemp
216 if (bTemp = FALSE) then
217 warnlog "Selected original size NOT OK :-("
220 if hCallExport (OutputGrafikTBO & "3" , sFilter, TRUE ) = TRUE then
221 Kontext "SVMOptionen"
222 if SVMOptionen.Exists (2) then
225 if (LiberalMeasurement(sx1, sX2)) <> TRUE then
226 if (val(str(StrToDouble(sx1)+5)) >= StrToDouble(sX2) ) AND (val(str(StrToDouble ( sx1 )-5)) <= StrToDouble ( sX2 )) then
227 Printlog "Width was ok. Expected: " & sx1 & "' was: '" & sX2 & "'"
229 warnLog "Width is different expected: '" & sx1 & "' is: '" & sX2 & "'"
233 if (LiberalMeasurement(sY, sY2)) <> TRUE then
234 if ( val(str(StrToDouble(sY)+5)) >= StrToDouble(sY2) ) AND (val(str(StrToDouble ( sY )-5)) <= StrToDouble ( sY2 )) then
235 Printlog "Height was ok. Expected: " & sY & "' was: '" & sY2 & "'"
237 warnLog "Height is different expected: '" & sY & "' is: '" & sY2 & "'"
248 '-------------------------------------------------------------------------------
253 dim iFileSize(12) as long
256 '/// Export the file 12 times: ///'
257 '///+ every compression level (3) and every range (3), check if button in toolbar uses last settings (6) (-> 12) ///'
258 hFileOpen (ConvertPath ( gTesttoolPath + "graphics\required\input\graphicexport_pdf."+ExtensionString ))
261 '---------------------------------------------------------------------------------------------------------------------------------------------------------
262 '###### all / Screen optimized ######
263 '/// File->Export as PDF document
264 printlog "File->Export as PDF document"
266 printlog " range = All"
267 '///+ compression = Screen optimized
268 printlog " compression = Screen optimized"
270 kontext "Standardbar"
271 checkexppdfwaitmax10sec
273 '--------------------------------------------------------- Output the first file ---------------------------------------------------------------
275 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 1, TRUE, FALSE, 1, 1)
276 '/// Export using Button in toolbar
277 printlog "Export using Button in toolbar"
278 '///+ use the settings from the export before
279 printlog " use the settings from the export before"
281 kontext "Standardbar"
282 checkexppdfwaitmax10sec
284 '------------------------------------------------------- Output the second file -------------------------------------------------------------
286 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 2, TRUE, FALSE, 1, 1) ' button in toolbar -> last settings have to be used
288 '###### range / Screen optimized ######
289 '/// File->Export as PDF document
290 printlog "File->Export as PDF document"
292 printlog " range = Range"
293 '///+ compression = Screen optimized
294 printlog " compression = Screen optimized"
296 kontext "Standardbar"
297 checkexppdfwaitmax10sec
299 '--------------------------------------------------------- Output the third file ---------------------------------------------------------------
301 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 3, TRUE, FALSE, 2, 1, "2")
303 '/// Export using Button in toolbar
304 printlog "Export using Button in toolbar"
305 '///+ use the settings from the export before
306 printlog " use the settings from the export before"
308 kontext "Standardbar"
309 checkexppdfwaitmax10sec
311 '--------------------------------------------------------- Output the fourth file -------------------------------------------------------------
313 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 4, TRUE, FALSE, 2, 1) ' button in toolbar -> last settings have to be used
315 '###### all / Print optimized ######
316 '/// File->Export as PDF document
317 printlog "File->Export as PDF document"
319 printlog " range = all"
320 '///+ compression = Print optimized
321 printlog " compression = Print optimized"
323 kontext "Standardbar"
324 checkexppdfwaitmax10sec
326 '------------------------------------------------------------ Output the fifth file --------------------------------------------------------------
328 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 5, TRUE, FALSE, 1, 2)
330 '/// Export using Button in toolbar
331 printlog "Export using Button in toolbar"
332 '///+ use the settings from the export before
333 printlog " use the settings from the export before"
335 kontext "Standardbar"
336 checkexppdfwaitmax10sec
338 '----------------------------------------------------------- Output the sixth file ---------------------------------------------------------------
340 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 6, TRUE, FALSE, 1, 2) ' button in toolbar -> last settings have to be used
342 '###### range / Print optimized ######
343 '/// File->Export as PDF document
344 printlog "File->Export as PDF document"
346 printlog " range = Range"
347 '///+ compression = Screen optimized
348 printlog " compression = Screen optimized"
350 kontext "Standardbar"
351 checkexppdfwaitmax10sec
353 '--------------------------------------------------------- Output the seventh file -------------------------------------------------------------
355 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 7, TRUE, FALSE, 2, 2, "2")
357 '/// Export using Button in toolbar
358 printlog "Export using Button in toolbar"
359 ' '///+ use the settings from the export before
360 printlog " use the settings from the export before"
362 kontext "Standardbar"
363 checkexppdfwaitmax10sec
365 '------------------------------------------------------------ Output the eight file ----------------------------------------------------------------
367 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 8, TRUE, FALSE, 2, 2) ' button in toolbar -> last settings have to be used
369 '###### all / Press optimized ######
370 '/// File->Export as PDF document ///'
371 printlog "File->Export as PDF document ///'"
373 printlog " range = all"
374 '///+ compression = Press optimized
375 printlog " compression = Press optimized"
377 kontext "Standardbar"
378 checkexppdfwaitmax10sec
380 '------------------------------------------------------------ Output the ninth file ----------------------------------------------------------------
382 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 9, TRUE, FALSE, 1, 3)
383 '/// Export using Button in toolbar
384 '///+ use the settings from the export before
386 kontext "Standardbar"
387 checkexppdfwaitmax10sec
389 '------------------------------------------------------------ Output the tenth file ----------------------------------------------------------------
391 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 10, TRUE, FALSE, 1, 3) ' button in toolbar -> last settings have to be used
393 '###### range / Press optimized ######
394 '/// File->Export as PDF document ///'
395 printlog "File->Export as PDF document ///'"
397 printlog " range = all"
398 '///+ compression = Press optimized
399 printlog " compression = Press optimized"
401 kontext "Standardbar"
402 checkexppdfwaitmax10sec
404 '----------------------------------------------------------- Output the eleventh file -------------------------------------------------------------
406 hExportAsPDFmulti (3, TRUE, OutputGrafikTBO + 11, TRUE, FALSE, 2, 3, "2")
407 '/// Export using Button in toolbar
408 '///+ use the settings from the export before
410 kontext "Standardbar"
411 checkexppdfwaitmax10sec
413 '------------------------------------------------------------- Output the twelfth file --------------------------------------------------------------
415 hExportAsPDFmulti (1, TRUE, OutputGrafikTBO + 12, TRUE, FALSE, 2, 3) ' button in toolbar -> last settings have to be used
417 kontext "Standardbar"
418 checkexppdfwaitmax10sec
420 '-----------------------------------------------------------------------------------------------------------------------------------------------------------------
423 sPath = OutputGrafikTBO
424 sPath = sPath + i + ".pdf"
425 iFileSize(i) = app.FileLen(sPath)
426 Printlog (" - " + i + ": " + " " + iFileSize(i) + " " + sPath
427 if (dir(sPath) <> "") then
429 '/// the first line has to be '%PDF-1.4' ///'
430 sTemp = fGetFileText(sPath, 8)
431 if (sTemp <> "%PDF-1.4") then
432 Warnlog "File doesn't start with '%PDF-1.4' it is: '" + sTemp + "'"
434 '/// the last line has to be '%%EOF' ///'
435 sTemp = left(fGetFileText(sPath, -6),5)
436 if (sTemp <> "%%EOF") then
437 Warnlog "File doesn't end with '%%EOF' it is: '" + sTemp + "'"
440 Warnlog "File was not exported to PDF :-( '" + sPath + "'"
444 ' Check if the file size is the same when exporting via toolbar and file/export
445 ' if the size different then the options are not used when exporting via the toolbar
446 if (iFileSize(1) <> iFileSize(2)) then
447 qaerrorlog "i100919: pdf export: different file size when exporting with file/export or button"
448 'Warnlog ("Diffrence in filesize for file 1 and 2")
451 if (iFileSize(5) <> iFileSize(6)) then
452 qaerrorlog "i100919: pdf export: different file size when exporting with file/export or button"
453 'Warnlog ("Difference in filesize for file 5 and 6")
456 if (iFileSize(9) <> iFileSize(10)) then
457 qaerrorlog "i100919: pdf export: different file size when exporting with file/export or button"
458 'Warnlog ("Difference in filesize for file 9 and 10")
463 if (iFileSize(1) > iFileSize(5)) then
464 qaerrorlog "i100919: pdf export: different file size when exporting with file/export or button"
465 'Warnlog ("Filesize for file 1 is greater then for file 5. The compression level doesn't work.")
467 if (iFileSize(5) > iFileSize(9)) then
468 Warnlog ("Filesize for file 5 is greater then for file 9. The compression level doesn't work.")
471 call hCloseDocument()
474 '-------------------------------------------------------------------------------
475 testcase tPDF_Creator
482 dim iFileSize(3) as long
483 dim iCreatorOffset as integer
485 dim sTextFilter as String
486 dim sTextFiltername as String
487 dim sExtension() as String
489 sTemp = ConvertPath ( gTesttoolPath + "graphics\required\input\export_graphic3." + ExtensionString )
492 sPath = OutputGrafikTBO
494 sPath = sPath + "L.pdf"
496 hExportAsPDFmulti (1, TRUE, sPath, TRUE, FALSE, 1, 1)
497 name sPath as sTemp+"L.txt"
499 iFileSize(3) = app.FileLen(sTemp+"L.txt")
502 '/// load file in writer as text ///'
504 hFileOpen(sTemp+"L.txt")
506 '/// if dialog 'AsciiFilterOptionen' comes up, say OK ///'
507 Kontext "AsciiFilterOptionen"
508 If AsciiFilterOptionen.Exists(3) then
509 AsciiFilterOptionen.OK
512 Kontext "Filterauswahl"
513 If Filterauswahl.Exists then
514 Filter.Select ( hGetUIFiltername("Text" ))
519 gApplication = "WRITER"
520 sleep 5 ' wait for document to be loaded
522 bTemp = hFindeImDokument ("<</Creator<",true)
523 if (bTemp = TRUE) then
526 warnlog " /Creator not found in pdf file :-("
528 hTypeKeys("<left><right><shift end>")
530 sTemp = getClipboardText()
531 sTemp = left(sTemp, inStr(sTemp, ">")-1)
533 for i = 0 to (len(sTemp)/4)-1
534 sTemp2 = sTemp2 + chr("&H"+mid(sTemp,(i*4)+1, 4))
536 printlog sTemp + " -- " + len(sTemp) + " ::: '" + sTemp2 + "'"
537 if (lCase(sapp) <> lCase(right(sTemp2, len(stemp2)-1))) then
538 warnlog "Application is different from Creator; is: '" + lCase(sTemp2) + "' should: '" + lCase(sapp) + "'"
540 iCreatorOffset = iCreatorOffset + len(sTemp)
542 bTemp = hFindeImDokument ("/Producer<")
543 if (bTemp = TRUE) then
546 warnlog " /Producer not found in pdf file :-("
548 hTypeKeys("<left><right><shift end><shift down>")
550 sTemp = getClipboardText()
551 sTemp = left(sTemp, inStr(sTemp, ">")-1)
553 for i = 0 to (len(sTemp)/4)-1
554 sTemp2 = sTemp2 + chr("&H"+mid(sTemp,(i*4)+1, 4))
556 printlog sTemp + " -- " + len(sTemp) + " ::: '" + sTemp2 + "'"
558 iCreatorOffset = iCreatorOffset + len(sTemp)
561 iCreatorOffset = iCreatorOffset + 48
562 if (len(sTemp) <> 48) then
563 warnlog "Producer is different from 'StarSuite 8'; is: '" + sTemp2 + "'"
566 iCreatorOffset = iCreatorOffset + 52
567 if (len(sTemp) <> 52) then
568 warnlog "Producer is different from 'StarOffice 8'; is: '" + sTemp2 + "'"
573 bTemp = hFindeImDokument ("/CreationDate(")
574 if (bTemp = TRUE) then
577 warnlog " /CreationDate not found in pdf file :-("
579 hTypeKeys("<left><right><shift end>")
581 sTemp = getClipboardText()
582 sTemp = left(sTemp, inStr(sTemp, ")")-1)
583 printlog sTemp + " -- " + len(sTemp)
584 iCreatorOffset = iCreatorOffset + (len(sTemp) - 23)
585 if (len(sTemp) <> 23) then
586 warnlog "Date is longer than expected; is: '" + sTemp2 + "'"
592 endcase 'tPDF_Creator
593 '-------------------------------------------------------------------------------
598 dim sFilter as string
602 dim sTextFilter as string
603 dim sExtension() as string
604 dim sTextFiltername as string
606 sFilter = "SVG - Scalable Vector Graphics (.svg)"
609 hFileOpen ( gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString )
611 '------------------------\
612 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
613 '------------------------\
614 if ( dir(OutputGrafikTBO+sExt) <> "") then
615 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
616 '------------------------\
617 if (iSprache <> 82) then
622 hFileOpenWithFilter (OutputGrafikTBO+sExt, sTextFiltername, FALSE)
623 printlog "if dialog 'AsciiFilterOptionen' comes up, say OK"
624 Kontext "AsciiFilterOptionen"
625 '-------------------------------\
626 If AsciiFilterOptionen.Exists(3) then
627 AsciiFilterOptionen.OK
629 warnlog "No ASCII filter Options Dialog?"
631 '-------------------------------/
633 gApplication = "WRITER"
634 sleep 5 ' wait for document to be loaded
635 bTemp = hFindeImDokument ("<!DOCTYPE svg PUBLIC " & chr(34)& "-//W3C//DTD SVG 1.1//EN" & chr(34)&" " & chr(34)&"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" & chr(34)&">",true)
636 '-------------------------------\
637 if (bTemp = TRUE) then
640 warnlog "DOCTYPE not found in svg file :-("
642 '-------------------------------/
645 qaerrorlog "disabled for 82: #111017#"
647 '--------------------------/
649 warnlog "File didn't get saved :-("
651 '------------------------/
653 '------------------------/
658 '-------------------------------------------------------------------------------
669 dim sDocument as string
671 '/// open the document
672 sDocument = ConvertPath ( gTesttoolPath + "graphics\required\input\graphicexport."+ExtensionString)
675 if hCallExport (OutputGrafikTBO , "BMP - Windows Bitmap (.bmp)" ) = TRUE then
676 Kontext "BMPOptionen"
677 if BMPOptionen.Exists (2) then
678 '/// check if all properties have the right count, and depend on each other ///'
679 '/// 'Color Resolution' listbox contains eight items ///'
680 x = Farbaufloesung.GetItemCount
681 if x <> 8 then warnlog "Color Resolution Count is wrong; should be:8, is:" + x
683 Farbaufloesung.Select i
685 Printlog " - " + i + ": '" +Farbaufloesung.GetSelText + "'"
686 '/// checkbox RLE coding has to be enabled only for '4 and 8 bit' color palettes ///'
687 if ((i > 3) AND (i < 8)) then
688 if RLEKodierung.IsEnabled <> TRUE then warnlog "'RLE coding' is not checkable :-("
690 if RLEKodierung.IsEnabled <> FALSE then warnlog "'RLE coding' is checkable :-("
693 '/// if Mode 'original' is selected, DPI///'
695 if DPI.IsEnabled then warnlog " :-("
696 if Breite.IsEnabled then warnlog " :-("
697 if Hoehe.IsEnabled then warnlog " :-("
700 '/// 'DPI' listbox contains eight items ///'
701 if x <> 4 then warnlog "'DPI' Count is wrong; should be:4, is:" + x
704 Printlog " - " + i + ": '" +DPI.GetSelText + "'"
706 if Breite.IsEnabled then warnlog " :-("
707 if Hoehe.IsEnabled then warnlog " :-("
709 if DPI.IsEnabled then warnlog " :-("
713 '/// leave dialog with cancel -> there has to be no file created! ///'
716 if ( dir(OutputGrafikTBO+".bmp") = "") then ' inspired by bug #99932 Graphic is exported though cancel is pressed
719 warnlog "Dialog was canceled, but file got saved, too :-( - i35177"
722 Warnlog "No BMP-Option-Dialog!"
727 if Active.Exists(2) then
728 Warnlog "BMP-Exportfilter has a problem"
732 Printlog "'/// now save it realy and load the file afterwards ///'"
733 if hCallExport (OutputGrafikTBO , "BMP - Windows Bitmap (.bmp)" ) = TRUE then
734 Kontext "BMPOptionen"
735 if BMPOptionen.Exists (2) then
736 Farbaufloesung.Select 7
743 if ( dir(OutputGrafikTBO+".bmp") <> "") then
744 Printlog "Ok :-) Saved as: '" + OutputGrafikTBO+".bmp" + "'"
746 warnlog "File didn't get saved :-("
752 Call hGrafikEinfuegen ( OutputGrafikTBO+".bmp" )
755 Printlog "'/// now save a SELECTION in ORIGINAL SIZE and load the file afterwards ///'"
757 hFileOpen (sDocument)
758 kontext "Filterauswahl"
759 if Filterauswahl.exists(10) then
760 Warnlog "Error when loading the file. The Filter-dialogue came up. Test aborted."
765 ' check if the document is writable
766 if fIsDocumentWritable = false then
767 ' make the document writable and check if it's succesfull
768 if fMakeDocumentWritable = false then
769 warnlog "The document can't be make writeable. Test stopped."
774 hTypeKeys ("<escape><tab>")
775 fGetSizeXY sx1, sy, TRUE
776 if hCallExport (OutputGrafikTBO + "1" , "BMP - Windows Bitmap (.bmp)", TRUE ) = TRUE then
777 Kontext "BMPOptionen"
778 if BMPOptionen.Exists (2) then
783 if ( dir(OutputGrafikTBO + "1"+".bmp") <> "") then
784 Printlog "Ok :-) Saved as: '" + OutputGrafikTBO + "1"+".bmp" + "'"
786 warnlog "File didn't get saved :-("
792 Call hGrafikEinfuegen ( OutputGrafikTBO + "1"+".bmp" )
794 fGetSizeXY sx1, sY, bTemp
795 if (bTemp = FALSE) then
796 warnlog "Selected original size NOT OK :-("
801 Printlog "'/// now CREATE a rectangle, select it, save it in SIZE and load the file afterwards ///'"
805 hRechteckErstellen ( 10, 10, 30, 40 )
806 if hCallExport (OutputGrafikTBO + "2" , "BMP - Windows Bitmap (.bmp)", TRUE ) = TRUE then
807 Kontext "BMPOptionen"
808 if BMPOptionen.Exists (2) then
812 Groesse.Check 'Press "Size" one more time in order to make the change go through"
818 if ( dir(OutputGrafikTBO + "2"+".bmp") <> "") then
819 Printlog "Ok :-) Saved as: '" + OutputGrafikTBO + "2"+".bmp" + "'"
821 warnlog "File didn't get saved :-("
825 hFileOpen (OutputGrafikTBO + "2"+".bmp")
826 kontext "Filterauswahl"
827 if Filterauswahl.exists then
828 Warnlog "Error when loading the file. The Filter-dialogue came up. Test aborted."
832 kontext "DocumentDraw"
833 DocumentDraw.TypeKeys ("<escape><tab>")
837 fGetSizeXY sx1, sY, bTemp
838 if (bTemp = FALSE) then
839 warnlog "Selected original size NOT OK :-("
843 if hCallExport (OutputGrafikTBO + "3" , "BMP - Windows Bitmap (.bmp)", TRUE ) = TRUE then
844 Kontext "BMPOptionen"
845 if BMPOptionen.Exists (2) then
848 if (LiberalMeasurement(sx1, sX2)) <> TRUE then
849 if (val(str(StrToDouble(sx1)+5)) >= StrToDouble(sX2) ) AND (val(str(StrToDouble ( sx1 )-5)) <= StrToDouble ( sX2 )) then
850 Printlog "Width was ok. Expected: " + sx1 + "' was: '" + sX2 + "'"
852 warnLog "Width is different expected: '" + sx1 + "' is: '" + sX2 + "'"
856 if (LiberalMeasurement(sY, sY2)) <> TRUE then
857 if ( val(str(StrToDouble(sY)+5)) >= StrToDouble(sY2) ) AND (val(str(StrToDouble ( sY )-5)) <= StrToDouble ( sY2 )) then
858 Printlog "Height was ok. Expected: " + sY + "' was: '" + sY2 + "'"
860 warnLog "Height is different expected: '" + sY + "' is: '" + sY2 + "'"
871 '-------------------------------------------------------------------------------
876 dim sFilter as string
884 dim sDocument as string
886 sFilter = "EMF - Enhanced Metafile (.emf)"
889 sDocument = gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString
892 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
893 Kontext "SVMOptionen"
894 if SVMOptionen.Exists (2) then
896 if Breite.IsEnabled then
899 if Hoehe.IsEnabled then
907 if ( dir(OutputGrafikTBO+sExt) = "") then ' inspired by bug #99932 Graphic is exported though cancel is pressed
910 warnlog "Dialog was canceled, but file got saved, too :-( - i35177"
913 Warnlog "No '" & sFilter & "' -Dialog!"
918 if Active.Exists(2) then
919 Warnlog " '" & sFilter & "' has a problem"
923 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
924 Kontext "SVMOptionen"
925 if SVMOptionen.Exists (2) then
932 if ( dir(OutputGrafikTBO+sExt) <> "") then
933 Printlog "Ok :-) saved as: '" & OutputGrafikTBO+sExt & "'"
935 warnlog "File didn't get saved :-("
941 Call hGrafikEinfuegen ( OutputGrafikTBO+sExt )
944 hFileOpen (sDocument)
945 kontext "Filterauswahl"
946 if Filterauswahl.Exists(10) then
947 Warnlog "Error when loading the file. The Filter-dialogue came up. Test aborted."
951 printlog "making doc editable if it is readonly"
952 sMakeReadOnlyDocumentEditable
954 hTypeKeys ("<escape><tab>")
955 fGetSizeXY sx1, sY, TRUE
956 if hCallExport (OutputGrafikTBO & "1" , sFilter, TRUE ) = TRUE then
957 Kontext "SVMOptionen"
958 if SVMOptionen.Exists (2) then
963 if ( dir(OutputGrafikTBO & "1" & sExt) <> "") then
964 Printlog "Ok :-) saved as: '" & OutputGrafikTBO & "1" & sExt & "'"
966 warnlog "File didn't get saved :-("
972 Call hGrafikEinfuegen ( OutputGrafikTBO & "1" & sExt )
974 fGetSizeXY sx1, sY, bTemp
975 if (bTemp = FALSE) then
976 warnlog "Selected original size NOT OK :-("
981 hRechteckErstellen ( 10, 10, 30, 40 )
982 if hCallExport (OutputGrafikTBO & "2" , sFilter, TRUE ) = TRUE then
983 Kontext "SVMOptionen"
984 if SVMOptionen.Exists (2) then
988 Groesse.Check 'Press "Size" one more time to make the change go through"
994 if ( dir(OutputGrafikTBO & "2" & sExt) <> "") then
995 Printlog "Ok :-) saved as: '" & OutputGrafikTBO & "2" & sExt & "'"
997 warnlog "File didn't get saved :-("
1001 hFileOpen (OutputGrafikTBO & "2" & sExt)
1002 kontext "DocumentDraw"
1003 DocumentDraw.TypeKeys ("<escape><tab>")
1006 fGetSizeXY sx1, sY, bTemp
1007 if (bTemp = FALSE) then
1008 warnlog "Selected original size NOT OK :-("
1011 if hCallExport (OutputGrafikTBO & "3" , sFilter, TRUE ) = TRUE then
1012 Kontext "SVMOptionen"
1013 if SVMOptionen.Exists (2) then
1015 sX2 = Breite.GetText
1016 if (LiberalMeasurement(sx1, sX2)) <> TRUE then
1017 if (val(str(StrToDouble(sx1)+5)) >= StrToDouble(sX2) ) AND (val(str(StrToDouble ( sx1 )-5)) <= StrToDouble ( sX2 )) then
1018 Printlog "Width was ok. Expected: " & sx1 & "' was: '" & sX2 & "'"
1020 warnLog "Width is different expected: '" & sx1 & "' is: '" & sX2 & "'"
1024 if (LiberalMeasurement(sY, sY2)) <> TRUE then
1025 if ( val(str(StrToDouble(sY)+5)) >= StrToDouble(sY2) ) AND (val(str(StrToDouble ( sY )-5)) <= StrToDouble ( sY2 )) then
1026 Printlog "Height was ok. Expected: " & sY & "' was: '" & sY2 & "'"
1028 warnLog "Height is different expected: '" & sY & "' is: '" & sY2 & "'"
1040 '-------------------------------------------------------------------------------
1045 dim iWaitIndex as integer
1046 dim sFilter, sExt as string
1047 dim bTemp as boolean
1054 dim sDocument as string
1056 sFilter = "MET - OS/2 Metafile (.met)"
1059 sDocument = gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString
1062 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
1063 Kontext "METOptionen"
1064 if METOptionen.Exists (2) then
1066 if Breite.IsEnabled then
1069 if Hoehe.IsEnabled then
1073 sTemp = Breite.getText
1075 if (sTemp = Breite.getText) then
1076 qaErrorLog "Width didn't change on pressing button 'More' #112225#"
1080 sTemp = Hoehe.getText
1082 if (sTemp = Hoehe.getText) then
1083 warnlog "Height didn't change on pressing button 'Less'"
1087 if ( dir(OutputGrafikTBO+sExt) = "") then ' inspired by bug #99932 Graphic is exported though cancel is pressed
1090 warnlog "Dialog was canceled, but file got saved, too :-( - i35177"
1093 Warnlog "No '" & sFilter & "' -Dialog!"
1098 if Active.Exists(2) then
1099 Warnlog " '" & sFilter & "' has a problem"
1103 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
1104 Kontext "METOptionen"
1105 if METOptionen.Exists (2) then
1107 sTemp = Breite.getText
1109 if (sTemp = Breite.getText) then
1110 warnlog "Width didn't change on pressing button 'Less'"
1112 sTemp = Hoehe.getText
1114 if (sTemp = Hoehe.getText) then
1115 qaErrorLog "Height didn't change on pressing button 'More' #112225#"
1121 do while METOptionen.Exists AND iWaitIndex < 30
1123 iWaitIndex = iWaitIndex + 1
1126 if ( dir(OutputGrafikTBO+sExt) <> "") then
1127 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
1129 warnlog "File didn't get saved :-("
1135 Call hGrafikEinfuegen ( OutputGrafikTBO+sExt )
1138 hFileOpen (sDocument)
1141 printlog "making doc editable if it is readonly"
1142 sMakeReadOnlyDocumentEditable
1144 hTypeKeys ("<escape><tab>")
1145 fGetSizeXY sx1, sY, TRUE
1146 if hCallExport (OutputGrafikTBO & "1" , sFilter, TRUE ) = TRUE then
1147 Kontext "METOptionen"
1148 if METOptionen.Exists (2) then
1152 do while METOptionen.Exists AND iWaitIndex < 30
1154 iWaitIndex = iWaitIndex + 1
1157 if ( dir(OutputGrafikTBO & "1" & sExt) <> "") then
1158 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "1" & sExt & "'"
1160 warnlog "File didn't get saved :-("
1166 Call hGrafikEinfuegen ( OutputGrafikTBO & "1" & sExt )
1168 fGetSizeXY sx1, sY, bTemp
1169 if (bTemp = FALSE) then
1170 warnlog "Selected original size NOT OK :-("
1175 hRechteckErstellen ( 10, 10, 30, 40 )
1176 if hCallExport (OutputGrafikTBO & "2" , sFilter, TRUE ) = TRUE then
1177 Kontext "METOptionen"
1178 if METOptionen.Exists (2) then
1182 Groesse.Check ' Click "Size" one more time to make the changes go through.
1183 sx1 = Breite.GetText
1187 do while METOptionen.Exists AND iWaitIndex < 30
1189 iWaitIndex = iWaitIndex + 1
1192 if ( dir(OutputGrafikTBO & "2" & sExt) <> "") then
1193 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "2" & sExt & "'"
1195 warnlog "File didn't get saved :-("
1199 hFileOpen (OutputGrafikTBO & "2" & sExt)
1200 kontext "DocumentDraw"
1201 DocumentDraw.TypeKeys ("<escape><tab>")
1204 fGetSizeXY sx1, sY, bTemp
1205 if (bTemp = FALSE) then
1206 warnlog "Selected original size NOT OK :-("
1209 if hCallExport (OutputGrafikTBO & "3" , sFilter, TRUE ) = TRUE then
1210 Kontext "METOptionen"
1211 if METOptionen.Exists (2) then
1213 sX2 = Breite.GetText
1214 if (LiberalMeasurement(sx1, sX2)) <> TRUE then
1215 if (val(str(StrToDouble(sx1)+5)) >= StrToDouble(sX2) ) AND (val(str(StrToDouble ( sx1 )-5)) <= StrToDouble ( sX2 )) then
1216 Printlog "Width was ok. Expected: " & sx1 & "' was: '" & sX2 & "'"
1218 warnLog "Width is different expected: '" & sx1 & "' is: '" & sX2 & "'"
1222 if (LiberalMeasurement(sY, sY2)) <> TRUE then
1223 if ( val(str(StrToDouble(sY)+5)) >= StrToDouble(sY2) ) AND (val(str(StrToDouble ( sY )-5)) <= StrToDouble ( sY2 )) then
1224 Printlog "Height was ok. Expected: " & sY & "' was: '" & sY2 & "'"
1226 warnLog "Height is different expected: '" & sY & "' is: '" & sY2 & "'"
1237 '-------------------------------------------------------------------------------
1240 dim sFilter as string
1245 sFilter = "Macromedia Flash (SWF) (.swf)"
1248 hFileOpen( gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString )
1250 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
1251 if ( dir(OutputGrafikTBO+sExt) <> "") then
1252 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
1255 warnlog "File didn't get saved :-("
1262 '------------------------------------------------------------------------------
1267 dim iWaitIndex as integer
1268 dim sFilter as string
1270 dim bTemp as boolean
1276 dim sDocument as string
1278 sFilter = "WMF - Windows Metafile (.wmf)"
1281 sDocument = gTesttoolPath & "graphics\required\input\graphicexport." & ExtensionString
1284 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
1285 Kontext "SVMOptionen"
1286 if SVMOptionen.Exists (2) then
1288 if Breite.IsEnabled then
1291 if Hoehe.IsEnabled then
1299 if ( dir(OutputGrafikTBO+sExt) = "") then ' inspired by bug #99932 Graphic is exported though cancel is pressed
1302 warnlog "Dialog was canceled, but file got saved, too :-( - i35177"
1305 Warnlog "No '" & sFilter & "' -Dialog!"
1310 if Active.Exists(2) then
1311 Warnlog " '" & sFilter & "' has a problem"
1315 if hCallExport (OutputGrafikTBO , sFilter ) = TRUE then
1316 Kontext "SVMOptionen"
1317 if SVMOptionen.Exists (2) then
1323 do while SVMOptionen.Exists AND iWaitIndex < 30
1325 iWaitIndex = iWaitIndex + 1
1328 if ( dir(OutputGrafikTBO+sExt) <> "") then
1329 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO+sExt & "'"
1331 warnlog "File didn't get saved :-("
1337 Call hGrafikEinfuegen ( OutputGrafikTBO+sExt )
1340 hFileOpen (sDocument)
1343 printlog "making doc editable if it is readonly"
1344 sMakeReadOnlyDocumentEditable
1346 hTypeKeys ("<escape><tab>")
1347 fGetSizeXY sx1, sY, TRUE
1348 if hCallExport (OutputGrafikTBO & "1" , sFilter, TRUE ) = TRUE then
1349 Kontext "SVMOptionen"
1350 if SVMOptionen.Exists (2) then
1354 do while SVMOptionen.Exists AND iWaitIndex < 30
1356 iWaitIndex = iWaitIndex + 1
1359 if ( dir(OutputGrafikTBO & "1" & sExt) <> "") then
1360 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "1" & sExt & "'"
1362 warnlog "File didn't get saved :-("
1368 Call hGrafikEinfuegen ( OutputGrafikTBO & "1" & sExt )
1370 fGetSizeXY sx1, sY, bTemp
1371 if (bTemp = FALSE) then
1372 warnlog "Selected original size NOT OK :-("
1377 hRechteckErstellen ( 10, 10, 30, 40 )
1378 if hCallExport (OutputGrafikTBO & "2" , sFilter, TRUE ) = TRUE then
1379 Kontext "SVMOptionen"
1380 if SVMOptionen.Exists (2) then
1384 Groesse.Check 'Check "Size" to make changes really go through.
1385 sx1 = Breite.GetText
1389 do while SVMOptionen.Exists AND iWaitIndex < 30
1391 iWaitIndex = iWaitIndex + 1
1394 if ( dir(OutputGrafikTBO & "2" & sExt) <> "") then
1395 Printlog "Ok :-) Saved as: '" & OutputGrafikTBO & "2" & sExt & "'"
1397 warnlog "File didn't get saved :-("
1401 hFileOpen (OutputGrafikTBO & "2" & sExt)
1402 kontext "DocumentDraw"
1403 DocumentDraw.TypeKeys ("<escape><tab>")
1406 fGetSizeXY sx1, sY, bTemp
1407 if (bTemp = FALSE) then
1408 warnlog "Selected original size NOT OK :-("
1411 if hCallExport (OutputGrafikTBO & "3" , sFilter, TRUE ) = TRUE then
1412 Kontext "SVMOptionen"
1413 if SVMOptionen.Exists (2) then
1415 sX2 = Breite.GetText
1416 if (LiberalMeasurement(sx1, sX2)) <> TRUE then
1417 if (val(str(StrToDouble(sx1)+5)) >= StrToDouble(sX2) ) AND (val(str(StrToDouble ( sx1 )-5)) <= StrToDouble ( sX2 )) then
1418 Printlog "Width was ok. Expected: " & sx1 & "' was: '" & sX2 & "'"
1420 warnLog "Width is different expected: '" & sx1 & "' is: '" & sX2 & "'"
1424 if (LiberalMeasurement(sY, sY2)) <> TRUE then
1425 if ( val(str(StrToDouble(sY)+5)) >= StrToDouble(sY2) ) AND (val(str(StrToDouble ( sY )-5)) <= StrToDouble ( sY2 )) then
1426 Printlog "Height was ok. Expected: " & sY & "' was: '" & sY2 & "'"
1428 warnLog "Height is different expected: '" & sY & "' is: '" & sY2 & "'"
1439 '-------------------------------------------------------------------------