summaryrefslogtreecommitdiff
path: root/testautomation/writer/optional/includes/insertgraphic
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/writer/optional/includes/insertgraphic')
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc958
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc985
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc1041
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc831
-rw-r--r--testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc755
5 files changed, 4570 insertions, 0 deletions
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc
new file mode 100644
index 000000000000..1def138817b4
--- /dev/null
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic1.inc
@@ -0,0 +1,958 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : helge.delfs@oracle.com
+'*
+'* short description : Test of the insert graphic function - 1
+'*
+'************************************************************************
+'*
+' #1 tInsertGraphic_1 'Test default directory of inserting graphic -1
+' #1 tInsertGraphic_2 'Test default directory of inserting graphic -2
+' #1 tInsertGraphic_3 'Call up dialog Insert / Graphic via Menu ?Insert - Graphics - From File...
+' #1 tInsertGraphic_4 'Call up dialog Insert / Graphic via button from Insert-Toolbox of the Toolbar
+' #1 tInsertGraphic_5 'Insert a graphic with open button
+' #1 tInsertGraphic_6 'Insert a graphic with double click (Return)
+' #1 Tinsertgraphic_7 'Default setting in insert/graphic dialog
+' #1 tInsertGraphic_8 'Test preselect Filter (Format <All>)
+' #1 tInsertGraphic_9 'Test preselect Filter excepte for (Format <All>)
+' #1 tInsertGraphic_10 'Insert linked graphics and break the links via Menu Edit - Link
+' #1 tInsertGraphic_11 'Insert graphics from clipboard -- Edit/Paste
+' #1 tInsertGraphic_12 'Insert graphics from clipboard -- Edit/Paste special
+' #1 fInsertGraphics 'This function will insert a graphic with Link checked
+'*
+'\***********************************************************************
+
+testcase tInsertGraphic_1
+
+ Dim iJump as Integer
+ Dim sPathName as String
+ Dim i as integer
+
+ PrintLog "- Test default dirtory of inserting graphic -1"
+ '/// Test default directory of inserting graphic -1
+ select case iSprache
+ case 01: iJump = 5
+ case 31: iJump = 1
+ case 33: iJump = 14
+ case 34: iJump = 12
+ case 36: iJump = 10
+ case 39: iJump = 5
+ case 46: iJump = 11
+ case 49: iJump = 11
+ case 55: iJump = 9
+ case 81: iJump = 16
+ case 82: iJump = 4
+ case 86: iJump = 7
+ case 88: iJump = 5
+ case else : QAErrorLog "The test does not support the language " + iSprache
+ Goto endsub
+ end select
+
+ Call hNewDocument
+
+ '/// Tools / Options / StarOffice / Paths
+ ToolsOptions
+ call hToolsOptions ("StarOffice", "Paths")
+
+ Typ.TypeKeys "<HOME><SPACE>"
+ Sleep 1
+ if iJump-1 > 0 then Typ.TypeKeys "<DOWN>", iJump-1
+ Sleep 1
+ Bearbeiten.Click
+
+ Kontext "OeffnenDlg"
+ '/// Set a new path to Graphic
+ Pfad.SetText (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic\"))
+ Sleep 1
+ Oeffnen.Click
+ Sleep 1
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep 1
+
+ '/// Insert / Graphic / From file
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+
+ '/// Input the jpg file's name which exists in the graphic dirtory , then press open button
+ Dateiname.Settext "Bughunter.jpg"
+ Sleep 1
+
+ Oeffnen.Click
+ Sleep 2
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.OK
+ QAErrorLog "#112220#The graphic directory in Tools/options doesn't work"
+ end if
+ end if
+
+ Kontext "GrafikEinfuegenDlg"
+ if GrafikEinfuegenDlg.Exists then GrafikEinfuegenDlg.Cancel
+
+ '/// Reset to default path
+ ToolsOptions
+ call hToolsOptions ("StarOffice", "Paths")
+ Typ.TypeKeys "<HOME>"
+ Sleep 1
+ if iJump-1 > 0 then Typ.TypeKeys "<DOWN>", iJump-1
+ Sleep 1
+ Standard.Click
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_2
+
+ PrintLog "- Test default dirtory of inserting graphic -2"
+ '/// Test default dirtory of inserting graphic -2
+
+ Call hNewDocument
+
+ '/// Input the 1st picture which exists in the dirtory1(full path) ,
+ '/// + then press open button
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext ConvertPath(gTesttoolpath + "writer\optional\input\insertgraphic\Bughunter.jpg")
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.OK
+ Sleep 1
+ Warnlog "1 - the file isn't in the dirtory " + ConvertPath(gTesttoolpath + "writer\optional\input\insertgraphic\")
+ end if
+
+ Kontext "GrafikEinfuegenDlg"
+ GrafikEinfuegenDlg.Cancel
+ end if
+
+ Call wTypeKeys "<ESCAPE>"
+
+ '/// Input the 2nd picture which exists in the dirtory2(only file name) ,
+ '/// + then press open button
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext "jolink.jpg"
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.OK
+ Sleep 1
+ else
+ Warnlog "2 - Should get the warning messagebox"
+ end if
+
+ Kontext "GrafikEinfuegenDlg"
+ GrafikEinfuegenDlg.Cancel
+ end if
+
+ Call wTypeKeys "<ESCAPE>"
+
+ '/// Input the 3rd picture which exists in the dirtory2(full path) ,
+ '/// + then press open button
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext ConvertPath(gTesttoolpath + "writer\optional\input\graphics\bild.jpg")
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.OK
+ Sleep 1
+ Warnlog "3 - the file isn't in the dirtory " + ConvertPath(gTesttoolpath + "writer\optional\input\grafik")
+ end if
+
+ Kontext "GrafikEinfuegenDlg"
+ GrafikEinfuegenDlg.Cancel
+ end if
+
+ Call wTypeKeys "<ESCAPE>"
+
+ '/// Input the 2nd picture which exists in the dirtory2(only file name) again,
+ '/// + then press open button
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext "jolink.jpg"
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.OK
+ Sleep 1
+ Warnlog "2 - the file isn't in the dirtory " + ConvertPath(gTesttoolpath + "writer\optional\input\grafik")
+ end if
+
+ Kontext "GrafikEinfuegenDlg"
+ GrafikEinfuegenDlg.Cancel
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_3
+
+ PrintLog "- Call up dialog Insert / Graphic via Menu ?Insert - Graphics - From File..."
+ '/// Call up dialog Insert / Graphic via Menu ?Insert - Graphics - From File
+
+ Call hNewDocument
+
+ try
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+
+ if GrafikEinfuegenDlg.Exists then
+ GrafikEinfuegenDlg.Cancel
+ else
+ Warnlog "The dialogue can't be opened from Menu Insert - Graphics - From File..."
+ end if
+ catch
+ Warnlog "Something wrong when calling up dialogue from Menu Insert - Graphics - From File..."
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_X
+ Dim sShortcut as string
+ PrintLog "- Call up dialog Insert / Picture via Alt+I+U+F ..."
+ '/// Call up dialog Insert / Graphic via Alt+I+G+F
+
+ Select case iSprache
+ case 01: sShortcut = "<MOD2 I U F>"
+ case else
+ QAErrorlog "Please add shortcut for Insert->Picture"
+ goto endsub
+ end select
+
+ Call hNewDocument
+
+ try
+ Call wTypeKeys sShortcut
+ Kontext "GrafikEinfuegenDlg"
+
+ if GrafikEinfuegenDlg.Exists then
+ GrafikEinfuegenDlg.Cancel
+ else
+ Warnlog "The dialogue can't be opened from Menu Insert - Picture - From File..."
+ end if
+ catch
+ Warnlog "Something wrong when calling up dialogue from Menu Insert - Picture - From File..."
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_4
+
+ PrintLog "- Call up dialog Insert / Graphic via button from Insert-Toolbox of the Toolbar "
+ '/// Call up dialog Insert / Graphic via button from Insert-Toolbox of the Toolbar
+
+ Call hNewDocument
+
+ Call hToolbarSelect("INSERT", true )
+ Sleep 2
+ Grafik.Click
+ Sleep 3
+
+ Kontext "GrafikEinfuegenDlg"
+
+ if GrafikEinfuegenDlg.Exists then
+ GrafikEinfuegenDlg.Cancel
+ else
+ Warnlog "The dialogue can't be opened from Insert-Toolbox of the Toolbar"
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_5
+
+ PrintLog "- Insert a graphic with open button"
+ '/// Insert a graphic with open button
+
+ Call hNewDocument
+
+ '/// Insert a Graphic , Insert/Graphics/From file
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic") )
+ Sleep 1
+ Oeffnen.Click
+
+ if NOT GrafikEinfuegenDlg.Exists then Warnlog "The insert graphic dialog should be still there!"
+
+ Dateiname.Settext ("boy.gif")
+
+ '/// check if open button can insert a graphic or not
+ Oeffnen.Click
+ Sleep 2
+
+ if GrafikEinfuegenDlg.Exists then Warnlog "The insert graphic dialog should NOT be there!"
+
+ try
+ fFormatGraphic("TabZusaetze")
+ Kontext "TabZusaetze"
+ TabZusaetze.Cancel
+ catch
+ Warnlog "The graphic is NOT inserted correctly !"
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_6
+
+ PrintLog "- Insert a graphic with double click (Return)"
+ '/// Insert a graphic with double click (Return)
+
+ Call hNewDocument
+
+ '/// Insert a Graphic , Insert/Graphics/From file
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic") )
+ Sleep 1
+ Oeffnen.Click
+
+ if NOT GrafikEinfuegenDlg.Exists then Warnlog "The insert graphic dialog should be still there!"
+
+ Dateiname.Settext ("boy.gif")
+
+ '/// check if double click (return) can insert a graphic or not
+ '/// [Note : the first is CVS directory]
+ DateiAuswahl.Select 2
+ Sleep 1
+
+ DateiAuswahl.TypeKeys "<Return>"
+ Sleep 2
+
+ if GrafikEinfuegenDlg.Exists then Warnlog "The insert graphic dialog should NOT be there!"
+
+ try
+ fFormatGraphic("TabZusaetze")
+ Kontext "TabZusaetze"
+ TabZusaetze.Cancel
+ catch
+ Warnlog "The graphic is NOT inserted correctly !"
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_7
+
+ Dim iFileType as Integer
+ Dim sStyle as String
+
+ iFileType = 1
+
+ select case iSprache
+ case 01 : sStyle = "Graphics"
+ case 31 : sStyle = "Afbeeldingen"
+ case 33 : sStyle = "Image"
+ case 34 : sStyle = "Imagen"
+ case 39 : sStyle = "Immagine"
+ case 46 : sStyle = "Grafik"
+ case 49 : sStyle = "Grafik"
+ case 55 : sStyle = "Figuras"
+ case 81 : sStyle = "図"
+ case 82 : sStyle = "그래픽"
+ case 86 : sStyle = "图形"
+ case 88 : sStyle = "圖形"
+ case else : QAErrorLog "Now, this testcase does not support for the language " +iSprache
+ exit sub
+ end select
+
+ PrintLog "- Default setting in insert/graphic dialog"
+ '/// Default setting in insert/graphic dialog
+
+ Call hNewDocument
+
+ '/// Insert a Graphic , Insert/Graphics/From file
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ if Stil.GetItemText(Stil.GetSelIndex) <> sStyle then Warnlog "The default setting for Style is wrong ! should be "+ sStyle + " but get " + Stil.GetItemText(Stil.GetSelIndex)
+ if Dateityp.GetSelIndex <> iFileType then Warnlog "The default setting for file type is wrong ! should be "+ Dateityp.GetItemText(iFileType) + " but get " + Dateityp.GetItemText(Dateityp.GetSelIndex)
+ GrafikEinfuegenDlg.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_8
+
+ Dim iFileType as Integer
+ Dim iFileNumber as Integer
+
+ iFileType = 1 'filter (Format <All>)
+ iFileNumber = 4
+
+ PrintLog "- Test preselect Filter (Format <All>)"
+ '/// Test preselect Filter (Format <All>)
+
+ Call hNewDocument
+
+ '/// Insert a Graphic , Insert/Graphics/From file
+ InsertGraphicsFromFile
+
+ '/// Select filter (Format <All>)
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic") )
+ Sleep 1
+ Oeffnen.Click
+
+ Dateityp.Select iFileType
+ Sleep 1
+
+ '/// Check if Filter (Format <All>) works well
+ if DateiAuswahl.GetItemCount <> iFileNumber then Warnlog "Filter (Format <All>) does NOT work well"
+ GrafikEinfuegenDlg.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_9
+
+ Dim iFileType as Integer
+ Dim iFileNumber as Integer
+
+ iFileType = 2 'another filter except for (Format <All>) -- bmp
+ iFileNumber = 1
+
+ PrintLog "- Test preselect Filter excepte for (Format <All>)"
+ '/// Test preselect Filter excepte for (Format <All>)
+
+ Call hNewDocument
+
+ '/// Insert a Graphic , Insert/Graphics/From file
+ InsertGraphicsFromFile
+
+ '/// Select filter 'BMP'
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic") )
+ Sleep 1
+ Oeffnen.Click
+
+ Dateityp.Select iFileType
+ Sleep 1
+
+ '/// Check if Filter BMP works well
+ if DateiAuswahl.GetItemCount <> iFileNumber then Warnlog "Filter BMP does NOT work well"
+ GrafikEinfuegenDlg.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_10
+
+ Dim sTestFile as String
+ dim sOutFile as string
+
+ sTestFile = ConvertPath(gOfficepath + "user\work\tInsertGraphic_5.sxw")
+ sOutFile = gOfficepath + "user\work\tInsertGraphic_5.odt"
+
+ PrintLog "- Insert linked graphics and break the links via Menu Edit - Link"
+ '/// Insert linked graphics and break the links via Menu Edit - Link
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>" , 2
+
+ '/// Insert a jpg Graphic
+ Call fInsertGraphics("Bughunter.jpg")
+
+ '/// + and set name as TEST1
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ ObjektName.SetText "TEST1"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<ESCAPE>"
+ Call wTypeKeys "<Return>" , 2
+ sleep(2)
+
+ '/// Insert a gif Graphic (animated)
+ Call fInsertGraphics("boy.gif")
+
+ '/// + and set name as TEST2
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ ObjektName.SetText "TEST2"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<ESCAPE>"
+ Call wTypeKeys "<Return>" , 2
+ sleep(2)
+
+ '/// Insert a bmp Graphic
+ Call fInsertGraphics("game.bmp")
+
+ '/// + and set name as TEST3
+ Call fFormatGraphic("TabZusaetze")
+ sleep(2)
+ Kontext "TabZusaetze"
+ ObjektName.SetText "TEST3"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<ESCAPE>"
+ Call wTypeKeys "<Return>" , 2
+ sleep(2)
+
+ '/// Edit / Links
+ EditLinksWriter
+ Kontext "VerknuepfungenBearbeiten"
+
+ '/// Select all graphics
+ Liste.TypeKeys "<Shift End>"
+ sleep(1)
+
+ '/// Remove link
+ Loesen.Click
+ sleep(1)
+ Kontext "Active"
+ if Active.Exists(1) then
+ Active.YES
+ else
+ warnlog "Messagebox should appear!"
+ end if
+ sleep(2)
+
+ '/// Close the edit/link dialogue
+ Kontext "VerknuepfungenBearbeiten"
+ VerknuepfungenBearbeiten.Close
+ sleep(1)
+
+ '/// Check if the inserted graphics are still there
+ Kontext "DocumentWriter"
+ Call wTypeKeys ( "<Shift F4>" )
+ sleep(1)
+ fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST1" then warnlog "The first graphic isn't right!"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Tab>"
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST2" then Warnlog "The second graphic isn't right!"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Tab>"
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST3" then Warnlog "The third graphic isn't right!"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<ESCAPE><Home>"
+ PrintLog "- Save and Reload the file"
+
+ '/// Save the file and close the file
+ Call hFileSaveAsWithFilterKill( sOutFile, "writer8")
+ sleep(2)
+ Call hCloseDocument
+ sleep(2)
+
+ '/// Reload the file
+ hFileOpen( sOutFile )
+ sleep(2)
+
+
+ '/// Check if the inserted graphics are still there
+ Kontext "DocumentWriter"
+ Call wTypeKeys ( "<Shift F4>" )
+ sleep(1)
+ if fFormatGraphic("TabZusaetze") = false then
+ Warnlog "#linked JPEG pictures will disappear when doc is modified."
+
+ kontext "TabZusatze"
+ if ( TabZusaetze.exists() ) then TabZusaetze.close()
+ kontext "DocumentWriter"
+ Call hCloseDocument
+ goto endsub
+ end if
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST1" then Warnlog "The first graphic isn't right!"
+ TabZusaetze.OK
+ sleep(1)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Tab>"
+ sleep(1)
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST2" then Warnlog "The second graphic isn't right!"
+ TabZusaetze.OK
+ sleep(2)
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Tab>"
+ sleep(1)
+ Call fFormatGraphic("TabZusaetze")
+ sleep(1)
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> "TEST3" then Warnlog "The third graphic isn't right!"
+ TabZusaetze.OK
+ sleep(1)
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_11
+
+ Dim sGraphicName as String
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sLeft as String
+ Dim sUp as String
+ Dim iFromLeft as Integer
+ Dim iFromUp as Integer
+ Dim sURL as String
+
+ sGraphicName = "TEST1"
+ sWidth = "5"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "4"+ gSeperator + "00" + gMeasurementUnit
+ sLeft = "2"+ gSeperator + "00" + gMeasurementUnit
+ sUp = "3"+ gSeperator + "00" + gMeasurementUnit
+
+ iFromLeft = 4
+ iFromUp = 4
+
+ sURL = "http://www.sun.com/"
+
+ PrintLog "- Insert graphics from clipboard -- Edit/Paste"
+ '/// Insert graphics from clipboard -- Edit/Paste
+
+ Call hNewDocument
+
+ '/// Insert a jpg Graphic and do some configuration
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ Kontext "TabZusaetze"
+ ObjektName.SetText sGraphicName
+ TabZusaetze.OK
+ sleep(2)
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ Horizontal.Select iFromLeft
+ wait 500
+ Vertical.Select iFromUp
+ wait 500
+ HorizontalBy.SetText sLeft
+ wait 500
+ VerticalBy.SetText sUp
+ wait 500
+ TabType.OK
+ sleep(1)
+ Call fFormatGraphic("TabHyperlinkRahmen")
+ Kontext "TabHyperlinkRahmen"
+ Sleep 1
+ URL.SetText sURL
+ wait 500
+ TabHyperlinkRahmen.OK
+
+ '/// copy graphic to clipboard
+ EditCopy
+ Sleep 1
+
+ Call hCloseDocument
+
+ Call hNewDocument
+
+ '/// paste the graphic from clipboard
+ EditPaste
+ Sleep 1
+
+ '/// Check if the pasted graphic is correct
+ Call fFormatGraphic("TabZusaetze")
+ Sleep 1
+ Kontext "TabZusaetze"
+ if ObjektName.GetText <> sGraphicName then Warnlog "The graphic's name is not correct ! "
+ TabZusaetze.Cancel
+ sleep(1)
+ Call fFormatGraphic("TabType")
+ Sleep 1
+ Kontext "TabType"
+ if Width.GetText <> sWidth then Warnlog "The graphic's width is not correct ! "
+ wait 500
+ if Height.GetText <> sHeight then Warnlog "The graphic's height is not correct ! "
+ wait 500
+ if Horizontal.GetSelIndex <> iFromLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ wait 500
+ if Vertical.GetSelIndex <> iFromUp then Warnlog "The graphic's vertical option is not correct ! "
+ wait 500
+ if HorizontalBy.GetText <> sLeft then Warnlog "The graphic's Horizontal is not correct ! "
+ wait 500
+ if VerticalBy.GetText <> sUp then Warnlog "The graphic's vertical is not correct ! "
+ wait 500
+ TabType.Cancel
+
+ Call fFormatGraphic("TabHyperlinkRahmen")
+ Sleep 1
+ Kontext "TabHyperlinkRahmen"
+ if URL.GetText <> sURL then Warnlog "The graphic's URL is not correct ! "
+ wait 500
+ TabHyperlinkRahmen.Cancel
+ sleep(1)
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_12
+
+ Dim sGraphicName as String
+ Dim sOriginalGraphicName as String
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sLeft as String
+ Dim sUp as String
+ Dim sOriginalWidth as String
+ Dim sOriginalHeight as String
+ Dim sOriginalLeft as String
+ Dim sOriginalUp as String
+ Dim iFromLeft as Integer
+ Dim iFromUp as Integer
+ Dim iOriginalFromLeft as Integer
+ Dim iOriginalFromUp as Integer
+ Dim sURL as String
+ Dim i as integer
+
+ sGraphicName = "TEST1"
+ sWidth = "5"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "4"+ gSeperator + "00" + gMeasurementUnit
+ sLeft = "2"+ gSeperator + "00" + gMeasurementUnit
+ sUp = "3"+ gSeperator + "00" + gMeasurementUnit
+
+ iFromLeft = 4
+ iFromUp = 4
+
+ sURL = "http://www.sun.com/"
+
+ PrintLog "- Insert graphics from clipboard -- Edit/Paste special"
+ '/// Insert graphics from clipboard -- Edit/Paste special
+
+ Call hNewDocument
+
+ '/// Insert a jpg Graphic and do some configuration
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ sOriginalGraphicName = ObjektName.GetText
+ wait 500
+ ObjektName.SetText sGraphicName
+ wait 500
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+
+ sOriginalWidth = Width.GetText
+ sOriginalHeight = Height.GetText
+ iOriginalFromLeft = Horizontal.GetSelIndex
+ iOriginalFromUp = Vertical.GetSelIndex
+ sOriginalLeft = HorizontalBy.GetText
+ sOriginalUp = VerticalBy.GetText
+
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ Horizontal.Select iFromLeft
+ wait 500
+ Vertical.Select iFromUp
+ wait 500
+ HorizontalBy.SetText sLeft
+ wait 500
+ VerticalBy.SetText sUp
+ wait 500
+ TabType.OK
+
+ fFormatGraphic("TabHyperlinkRahmen")
+ Sleep 1
+ URL.SetText sURL
+ wait 500
+ TabHyperlinkRahmen.OK
+
+ '/// copy graphic to clipboard
+ EditCopy
+ Sleep 1
+
+ '/// delete the graphic
+ Call wTypeKeys "<Delete>"
+ Sleep 1
+
+ '/// 1. Edit/Paste special the graphic from
+ '/// + Graphic [StarOffice Writer]
+ EditPasteSpecialWriter
+ Sleep 1
+ Kontext "InhaltEinfuegen"
+ if Auswahl.GetItemCount < 4 then
+ QAErrorlog "#i47320#Only " & Auswahl.GetItemCount & " graphic formats available"
+ InhaltEinfuegen.Cancel
+ else
+ Auswahl.Select 1
+ PrintLog "- " & Auswahl.GetSelText
+ InhaltEinfuegen.OK
+ Sleep 1
+
+ '/// Check if the pasted graphic properties are correct
+ FormatGraphics
+ Kontext
+ Active.Setpage TabZusaetze
+ Kontext "TabZusaetze"
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName then Warnlog "The graphic's name is not correct ! "
+
+ Kontext
+ Active.Setpage TabType
+ Kontext "TabType"
+ Sleep 1
+ if Width.GetText <> sWidth then Warnlog "The graphic's width is not correct ! "
+ wait 500
+ if Height.GetText <> sHeight then Warnlog "The graphic's height is not correct ! "
+ wait 500
+ if Horizontal.GetSelIndex <> iFromLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ wait 500
+ if Vertical.GetSelIndex <> iFromUp then Warnlog "The graphic's vertical option is not correct ! "
+ wait 500
+ if HorizontalBy.GetText <> sLeft then Warnlog "The graphic's Horizontal is not correct ! "
+ wait 500
+ if VerticalBy.GetText <> sUp then Warnlog "The graphic's vertical is not correct ! "
+ wait 500
+
+ Kontext
+ Active.Setpage TabHyperlinkRahmen
+ Kontext "TabHyperlinkRahmen"
+ Sleep 1
+ if URL.GetText <> sURL then Warnlog "The graphic's URL is not correct ! "
+ wait 500
+ TabHyperlinkRahmen.Ok
+
+ 'delete the graphic
+ Call wTypeKeys "<Delete>"
+ Sleep 1
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+function fInsertGraphics (sFileName as String)
+ 'This function will insert a graphic with Link checked
+
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic\" + sFileName) )
+ Sleep 1
+ Link.Check
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+end function
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc
new file mode 100644
index 000000000000..c6c38ddfe934
--- /dev/null
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic2.inc
@@ -0,0 +1,985 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : helge.delfs@oracle.com
+'*
+'* short description : Test of the insert graphic function - 2
+'*
+'************************************************************************
+'*
+' #1 tInsertGraphic_13 'Test Set different attributes via dialog Arrange (send to back)
+' #1 tInsertGraphic_14 'Test Set different attributes via dialog Arrange (send backward)
+' #1 tInsertGraphic_15 'Test Set different attributes via dialog Arrange (bring to front)
+' #1 tInsertGraphic_16 'Test Set different attributes via dialog Arrange (bring forward)
+' #1 tInsertGraphic_17 'Test Set different attributes via Contextmenu Arrange (send to back)
+' #1 tInsertGraphic_18 'Test Set different attributes via Contextmenu Arrange (send backward)
+' #1 tInsertGraphic_19 'Test Set different attributes via Contextmenu Arrange (bring to front)
+' #1 tInsertGraphic_20 'Test Set different attributes via Contextmenu Arrange (bring forward)
+'*
+'\***********************************************************************
+
+testcase tInsertGraphic_13
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via dialog Arrange (send to back)"
+ '/// Test Set different attributes via dialog Arrange (send to back)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send to back
+ FormatArrangeSendToBack
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_14
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via dialog Arrange (send backward)"
+ '/// Test Set different attributes via dialog Arrange (send backward)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send backward
+ FormatArrangeSetBackward
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_15
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via dialog Arrange (bring to front)"
+ '/// Test Set different attributes via dialog Arrange (bring to front)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send to back
+ FormatArrangeSendToBack
+ Sleep 2
+
+ '/// Format / Arrange / bring to front
+ FormatArrangeBringToFront
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_16
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via dialog Arrange (bring forward)"
+ '/// Test Set different attributes via dialog Arrange (bring forward)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send to back
+ FormatArrangeSendToBack
+ Sleep 1
+
+ '/// Format / Arrange / bring forward
+ FormatArrangeBringForward
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_17
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via Contextmenu Arrange (send to back)"
+ '/// Test Set different attributes via Contextmenu Arrange (send to back)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// ContextMenu Arrange / Send to back
+ Call wOpenContextMenu
+ hMenuSelectNr(1)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_18
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via Contextmenu Arrange (send backward)"
+ '/// Test Set different attributes via Contextmenu Arrange (send backward)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ Kontext
+ Active.Setpage TabType
+ Kontext "TabType"
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// ContextMenu Arrange / Send backward
+ Call wOpenContextMenu
+ hMenuSelectNr(1)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_19
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via Contextmenu Arrange (bring to front)"
+ '/// Test Set different attributes via Contextmenu Arrange (bring to front)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+
+ Kontext
+ Active.Setpage TabType
+ Kontext "TabType"
+
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send to back
+ FormatArrangeSendToBack
+ Sleep 2
+
+ '/// ContextMenu Arrange / bring to front
+ Call wOpenContextMenu
+ hMenuSelectNr(1)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_20
+
+ Dim sGraphicName1 as String
+ Dim sGraphicName2 as String
+ Dim sGraphicName3 as String
+ Dim sWidth as String
+ Dim sHeight as String
+
+ sGraphicName1 = "TEST1"
+ sGraphicName2 = "TEST2"
+ sGraphicName3 = "TEST3"
+
+ sWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test Set different attributes via Contextmenu Arrange (bring forward)"
+ '/// Test Set different attributes via Contextmenu Arrange (bring forward)
+
+ Call hNewDocument
+
+ Call wTypeKeys "<Return>"
+
+ '/// Insert three Graphics at the same place , and named in series
+
+ 'the 1st graphic
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName1
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 2nd graphic
+ fInsertGraphics("flowers.gif")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName2
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ Call wTypeKeys "<ESCape>"
+
+ 'the 3rd graphic
+ fInsertGraphics("game.bmp")
+
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ ObjektName.SetText sGraphicName3
+ TabZusaetze.OK
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ Sleep 1
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ TabType.OK
+
+ '/// Format / Arrange / Send to back
+ FormatArrangeSendToBack
+ Sleep 1
+
+ '/// ContextMenu Arrange / bring forward
+ Call wOpenContextMenu
+ hMenuSelectNr(1)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ Call wTypeKeys "<ESCape>"
+ Sleep 1
+
+ '/// Check if the attributes Arrange (send to back) works well
+ Call wNavigatorAuswahl(4,1)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName1 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName1 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,2)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName2 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName2 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call wNavigatorAuswahl(4,3)
+ Sleep 1
+ fFormatGraphic("TabZusaetze")
+ Sleep 1
+ if ObjektName.GetText <> sGraphicName3 then Warnlog "The graphic's name is not correct ,should be "+sGraphicName3 + " but get " +ObjektName.GetText
+ TabZusaetze.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
new file mode 100644
index 000000000000..2a161b2200d1
--- /dev/null
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic3.inc
@@ -0,0 +1,1041 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : helge.delfs@oracle.com
+'*
+'* short description : Test of the insert graphic function - 3
+'*
+'************************************************************************
+'*
+' #1 tInsertGraphic_21 'Test Alignment via dialog: anchor to paragraph -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_22 'Test Alignment via dialog: anchor to page -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_23 'Test Alignment via dialog: anchor to character -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_24 'Test Alignment via dialog: anchor as character -> top, center, bottom of baseline
+' #1 tInsertGraphic_25 'Test Alignment via Contextmenu: anchor to paragraph -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_26 'Test Alignment via Contextmenu: anchor to page -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_27 'Test Alignment via Contextmenu: anchor to character -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_28 'Test Alignment via Contextmenu: anchor as character -> top, center, bottom of baseline
+' #1 tInsertGraphic_29 'Test Wrap via dialog : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph
+' #1 tInsertGraphic_30 'Test Wrap via ContextMenuTest : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph
+'*
+'\***********************************************************************
+
+testcase tInsertGraphic_21
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via dialog: anchor to paragraph -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via dialog: anchor to paragraph -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / anchor / to paragraph
+ FormatAnchorToParagraph
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// Format / Alignment / Left
+ FormatAlignmentLeft
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Alignment / Centered
+ FormatAlignmentCentered
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Alignment / Right
+ FormatAlignmentRight
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Alignment / Top
+ FormatAlignmentTop
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Alignment / Center
+ FormatAlignmentCenter
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "#110281# The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Alignment / Bottom
+ FormatAlignmentBottom
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_22
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via dialog: anchor to page -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via dialog: anchor to page -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / anchor / To Page
+ FormatAnchorToPage
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// Format / Alignment / Left
+ FormatAlignmentLeft
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'To Page' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Alignment / Centered
+ FormatAlignmentCentered
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Alignment / Right
+ FormatAlignmentRight
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Alignment / Top
+ FormatAlignmentTop
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Alignment / Center
+ FormatAlignmentCenter
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Alignment / Bottom
+ FormatAlignmentBottom
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_23
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via dialog: anchor to character -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via dialog: anchor to character -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / anchor / To character
+ FormatAnchorTocharacter
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// Format / Alignment / Left
+ FormatAlignmentLeft
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Alignment / Centered
+ FormatAlignmentCentered
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Alignment / Right
+ FormatAlignmentRight
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Alignment / Top
+ FormatAlignmentTop
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Alignment / Center
+ FormatAlignmentCenter
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then qaErrorLog "#111962# The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Alignment / Bottom
+ FormatAlignmentBottom
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_24
+
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via dialog: anchor as character -> top, center, bottom of baseline"
+ '/// Test Alignment via dialog: anchor as character -> top, center, bottom of baseline
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / anchor / As character
+ FormatAnchorAsCharacter
+ Sleep 1
+
+ PrintLog " Base line at top:"
+ '/// Format / Alignment / Base line at top
+ FormatAlignmentTop
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at center:"
+ '/// Format / Alignment / Base line at center
+ FormatAlignmentCenter
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at bottom:"
+ '/// Format / Alignment / Base line at bottom
+ FormatAlignmentBottom
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_25
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via Contextmenu: anchor to paragraph -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via Contextmenu: anchor to paragraph -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// ContextMenu anchor / to paragraph
+ Call wOpenContextMenu
+ hMenuSelectNr(3)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// ContextMenu Alignment / Left
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// ContextMenu Alignment / Centered
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// ContextMenu Alignment / Right
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// ContextMenu Alignment / Top
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// ContextMenu Alignment / Center
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(5)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "#110281# The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// ContextMenu Alignment / Bottom
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(6)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_26
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via Contextmenu: anchor to page -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via dialog: Contextmenu to page -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// ContextMenu anchor / To Page
+ Call wOpenContextMenu
+ hMenuSelectNr(3)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// ContextMenu Alignment / Left
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'To Page' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// ContextMenu Alignment / Centered
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// ContextMenu Alignment / Right
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// ContextMenu Alignment / Top
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// ContextMenu Alignment / Center
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(5)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// ContextMenu Alignment / Bottom
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(6)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_27
+
+ Dim iLeft as Integer , iRight as Integer , iCenterHorizontal as Integer
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via Contextmenu: anchor to character -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via Contextmenu: anchor to character -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// ContextMenu anchor / To character
+ Call wOpenContextMenu
+ hMenuSelectNr(3)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ PrintLog " Left:"
+ '/// ContextMenu Alignment / Left
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// ContextMenu Alignment / Centered
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// ContextMenu Alignment / Right
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// ContextMenu Alignment / Top
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// ContextMenu Alignment / Center
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(5)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iCenterVertical then QAErrorlog "#111962#The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// ContextMenu Alignment / Bottom
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(6)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_28
+
+ Dim iTop as Integer , iBottom as Integer , iCenterVertical as Integer
+
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via Contextmenu: anchor as character -> top, center, bottom of baseline"
+ '/// Test Alignment via Contextmenu: anchor as character -> top, center, bottom of baseline
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// ContextMenu anchor / As character
+ Call wOpenContextMenu
+ hMenuSelectNr(3)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ PrintLog " Base line at top:"
+ '/// ContextMenu Alignment / Base line at top
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at center:"
+ '/// ContextMenu Alignment / Base line at center
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at bottom:"
+ '/// ContextMenu Alignment / Base line at bottom
+ Call wOpenContextMenu
+ hMenuSelectNr(2)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ '/// - Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_29
+
+ PrintLog "- Test Wrap via dialog : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph"
+ '/// <b> Test Wrap via dialog , including </b>
+ '/// + </b> none, Page Wrap, Optimal Page Wrap, Contour Wrap, </b>
+ '/// + </b> Wrap through, in Background, first paragraph </b>
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " 1. No Wrap:"
+ '/// Format / Wrap / No Wrap
+ FormatWrapNoWrap
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kein.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 2. Page Wrap:"
+ '/// Format / Wrap / Page Wrap
+ FormatWrapPageWrap
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 3. Optimal Page Wrap:"
+ '/// Format / Wrap / Optimal Page Wrap
+ FormatWrapOptimalPageWrap
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Dynamisch.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 4. Wrap through:"
+ '/// Format / Wrap / Wrap through
+ FormatWrapThrough
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 5. In Background:"
+ '/// Format / Wrap / in Background
+ FormatWrapInBackground
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ImHintergrund.IsChecked <> TRUE then Warnlog "Background configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 6. first paragraph:"
+ '/// Format / Wrap / first paragraph
+ FormatWrapFirstparagraph
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ErsterAbsatz.IsChecked <> TRUE then Warnlog "first paragraph configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 7. Contour:"
+ '/// Format / Wrap / Contour
+ FormatWrapPageWrap
+ Sleep 1
+ FormatWrapContour
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kontur.IsChecked <> TRUE then Warnlog "Contour configuration is wrong !"
+ TabUmlauf.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_30
+
+ PrintLog "- Test Wrap via Contextmenu : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph"
+ '/// <b> Test Wrap via Contextmenu , including </b>
+ '/// + <b> none, Page Wrap, Optimal Page Wrap, Contour Wrap, </b>
+ '/// + <b> Wrap through, in Background, first paragraph </b>
+
+ Call hNewDocument
+
+ '/// + Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " 1. No Wrap:"
+ '/// Contextmenu Wrap / No Wrap
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(1)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kein.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 2. Page Wrap:"
+ '/// Contextmenu Wrap / Page Wrap
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 3. Optimal Page Wrap:"
+ '/// Contextmenu Wrap / Optimal Page Wrap
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(3)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Dynamisch.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 4. Wrap through:"
+ '/// Contextmenu Wrap / Wrap through
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(4)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 5. In Background:"
+ '/// Contextmenu Wrap / in Background
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(5)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ImHintergrund.IsChecked <> TRUE then Warnlog "Background configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 6. first paragraph:"
+ '/// Contextmenu Wrap / first paragraph
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(7)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ErsterAbsatz.IsChecked <> TRUE then Warnlog "first paragraph configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 7. Contour:"
+ '/// Contextmenu Wrap / Contour
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(2)
+ Sleep 1
+
+ Call wOpenContextMenu
+ hMenuSelectNr(4)
+ Sleep 2
+ hMenuSelectNr(6)
+ Sleep 1
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kontur.IsChecked <> TRUE then Warnlog "Contour configuration is wrong !"
+ TabUmlauf.Cancel
+
+ Call hCloseDocument
+
+endcase
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc
new file mode 100644
index 000000000000..561768ee8320
--- /dev/null
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic4.inc
@@ -0,0 +1,831 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : helge.delfs@oracle.com
+'*
+'* short description : Test of the insert graphic function - 4
+'*
+'************************************************************************
+'*
+' #1 tInsertGraphic_31 'Test Alignment via format/graphic: Anchor to paragraph -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_32 'Test Alignment via format/graphic: Anchor to page -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_33 'Test Alignment via format/graphic: Anchor to character -> Left, centered, right, top, center, bottom
+' #1 tInsertGraphic_34 'Test Alignment via format/graphic: Anchor as character -> top, center, bottom of baseline
+' #1 tInsertGraphic_35 'Test Wrap via format/graphic : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph
+' #1 tInsertGraphic_36 'Test original size
+' #1 tInsertGraphic_37 'Test keep ratio
+' #1 tInsertGraphic_38 'Check the graphic name in Navigator
+' #1 tInsertGraphic_39 'Test checkbox 'Position' in protect area
+' #1 tInsertGraphic_40 'Test checkbox 'Print' in Property area"
+' #1 tInsertGraphic_41 'Test checkbox 'Keep image size'
+' #1 tInsertGraphic_42 'Test checkbox 'Keep scale'
+'*
+'\***********************************************************************
+
+testcase tInsertGraphic_31
+
+ Dim iLeft as Integer
+ Dim iRight as Integer
+ Dim iCenterHorizontal as Integer
+ Dim iTop as Integer
+ Dim iBottom as Integer
+ Dim iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via format/graphic: Anchor to paragraph -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via format/graphic: Anchor to paragraph -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " Left:"
+ '/// Format / Graphic tabpage Type ,
+ '/// + Anchor to paragraph , and set Horizontal to left
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ AnchorAtparagraph.Check
+ Horizontal.Select iLeft
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ Sleep 1
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to paragraph , and set Horizontal to Centered
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ AnchorAtparagraph.Check
+ Horizontal.Select iCenterHorizontal
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ Kontext "TabType"
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to paragraph , and set Horizontal to Right
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ AnchorAtparagraph.Check
+ Horizontal.Select iRight
+ TabType.OK
+ sleep(1)
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ Kontext "TabType"
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to paragraph , and set Vertical to top
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ AnchorAtparagraph.Check
+ Vertical.Select iTop
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ Kontext "TabType"
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to paragraph , and set Vertical to Center
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ AnchorAtparagraph.Check
+ Vertical.Select iCenterVertical
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! #bug110281"
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to paragraph , and set Vertical to Bottom
+ fFormatGraphic("TabType")
+ AnchorAtparagraph.Check
+ Vertical.Select iBottom
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtparagraph.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'to paragraph' !"
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_32
+
+ Dim iLeft as Integer
+ Dim iRight as Integer
+ Dim iCenterHorizontal as Integer
+ Dim iTop as Integer
+ Dim iBottom as Integer
+ Dim iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via format/graphic: Anchor to page -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via format/graphic: Anchor to page -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " Left:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Horizontal to left
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Horizontal.Select iLeft
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Horizontal to Centered
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Horizontal.Select iCenterHorizontal
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Horizontal to Right
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Horizontal.Select iRight
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Vertical to top
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Vertical.Select iTop
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Vertical to Center
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Vertical.Select iCenterVertical
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor to page , and set Vertical to Bottom
+ fFormatGraphic("TabType")
+ AnchorAtPage.Check
+ Vertical.Select iBottom
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtPage.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Page' !"
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_33
+
+ Dim iLeft as Integer
+ Dim iRight as Integer
+ Dim iCenterHorizontal as Integer
+ Dim iTop as Integer
+ Dim iBottom as Integer
+ Dim iCenterVertical as Integer
+
+ iLeft = 1 : iRight = 2 : iCenterHorizontal = 3
+ iTop = 1 : iBottom = 2 : iCenterVertical = 4
+
+ PrintLog "- Test Alignment via format/graphic: Anchor to character -> Left, centered, right, top, center, bottom"
+ '/// Test Alignment via format/graphic: Anchor to character -> Left, centered, right, top, center, bottom
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " Left:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Horizontal to left
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Horizontal.Select iLeft
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Horizontal.GetSelIndex <> iLeft then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Centered:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Horizontal to Centered
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Horizontal.Select iCenterHorizontal
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Horizontal.GetSelIndex <> iCenterHorizontal then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Right:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Horizontal to Right
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Horizontal.Select iRight
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Horizontal.GetSelIndex <> iRight then Warnlog "The graphic's Horizontal option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Top:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Vertical to top
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Vertical.Select iTop
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Center:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Vertical to Center
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Vertical.Select iCenterVertical
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Vertical.GetSelIndex <> iCenterVertical then
+ if iSprache = 82 then
+ QAErrorlog "#i59378#Missing vertical position in in Format-Picture-dialog"
+ else
+ if Vertical.GetItemCount <> 6 then
+ QAErrorlog "#i59378#Missing vertical position in in Format-Picture-dialog"
+ else
+ Warnlog "The graphic's Vertical option is not correct ! "
+ end if
+ end if
+ end if
+ TabType.Cancel
+
+ PrintLog " Bottom:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor At Character , and set Vertical to Bottom
+ fFormatGraphic("TabType")
+ AnchorAtCharacter.Check
+ Vertical.Select iBottom
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAtCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'At Character' !"
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_34
+
+ Dim iTop as Integer
+ Dim iBottom as Integer
+ Dim iCenterVertical as Integer
+
+ iTop = 1 : iBottom = 2 : iCenterVertical = 3
+
+ PrintLog "- Test Alignment via format/graphic: Anchor as character -> top, center, bottom of baseline"
+ '/// Test Alignment via format/graphic: Anchor as character -> top, center, bottom of baseline
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " Base line at top:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor as character , and set Base line at top
+ fFormatGraphic("TabType")
+ Sleep 1
+ AnchorAsCharacter.Check
+ Vertical.Select iTop
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAsCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'As character' !"
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iTop then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at center:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor as character , and set Base line at center
+ fFormatGraphic("TabType")
+ Sleep 1
+ AnchorAsCharacter.Check
+ Vertical.Select iCenterVertical
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAsCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'As character' !"
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iCenterVertical then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ PrintLog " Base line at bottom:"
+ '/// Format / Graphic tabpage Type
+ '/// + Anchor as character , and set Base line at bottom
+ fFormatGraphic("TabType")
+ Sleep 1
+ AnchorAsCharacter.Check
+ Vertical.Select iBottom
+ TabType.OK
+
+ '/// Check the graphic position
+ fFormatGraphic("TabType")
+ Sleep 1
+ if AnchorAsCharacter.IsChecked <> TRUE then Warnlog "Anchor should be checked to 'As character' !"
+ if Horizontal.IsEnabled = TRUE then Warnlog "The Horizontal listbox should not be enabled ! "
+ if Vertical.GetSelIndex <> iBottom then Warnlog "The graphic's Vertical option is not correct ! "
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_35
+
+ PrintLog "- Test Wrap via dialog : none, Page Wrap, Optimal Page Wrap, Contour Wrap ,Wrap through, in Background , first paragraph"
+ '/// <b> Test Wrap via dialog , including </b>
+ '/// +<b> none, Page Wrap, Optimal Page Wrap, Contour Wrap, </b>
+ '/// +<b> Wrap through, in Background, first paragraph </b>
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " 1. No Wrap:"
+ '/// Format / Graphic / tabpage Wrap - No page
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Kein.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kein.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 2. Page Wrap:"
+ '/// Format / Graphic / tabpage Wrap - Page Wrap
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Parallel.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 3. Optimal Page Wrap:"
+ '/// Format / Graphic / tabpage Wrap - Optimal Page Wrap
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Dynamisch.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Dynamisch.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 4. Wrap through:"
+ '/// Format / Graphic / tabpage Wrap - Wrap through
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Durchlauf.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 5. In Background:"
+ '/// Format / Graphic / tabpage Wrap - In Background
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Durchlauf.Check
+ ImHintergrund.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Durchlauf.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ImHintergrund.IsChecked <> TRUE then Warnlog "Background configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 6. first paragraph:"
+ '/// Format / Graphic / tabpage Wrap - first paragraph
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Parallel.Check
+ ErsterAbsatz.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Parallel.IsChecked <> TRUE then Warnlog "Graphic wrapping situation is wrong !"
+ if ErsterAbsatz.IsChecked <> TRUE then Warnlog "first paragraph configuration is wrong !"
+ TabUmlauf.Cancel
+
+ PrintLog " 7. Contour:"
+ '/// Format / Graphic / tabpage Wrap - first paragraph
+ FormatWrapPageWrap
+ Sleep 1
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Kontur.Check
+ TabUmlauf.OK
+
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ if Kontur.IsChecked <> TRUE then Warnlog "Contour configuration is wrong !"
+ TabUmlauf.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_36
+
+ Dim sOriginalWidth as String
+ Dim sOriginalHeight as String
+ Dim sNewWidth as String
+ Dim sNewHeight as String
+
+ sNewWidth = "7"+ gSeperator + "00" + gMeasurementUnit
+ sNewHeight = "5"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test original size "
+ '/// Test original size
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / Graphic tabpage Type , change the graphic's size
+ fFormatGraphic("TabType")
+ sOriginalWidth = Width.GetText
+ sOriginalHeight = Height.GetText
+ KeepRatio.UnCheck
+ wait 500
+ Width.SetText sNewWidth
+ wait 500
+ Height.SetText sNewHeight
+ wait 500
+ TabType.OK
+
+ '/// Check if original size works well
+ fFormatGraphic("TabType")
+ if Width.GetText <> sNewWidth then Warnlog "The graphic's width is wrong !"
+ wait 500
+ if Height.GetText <> sNewHeight then Warnlog "The graphic's height is wrong !"
+ wait 500
+ OriginalSize.Click
+ Sleep 1
+ if Width.GetText <> sOriginalWidth then Warnlog "The graphic's width isn't recovered to before!"
+ wait 500
+ if Height.GetText <> sOriginalHeight then Warnlog "The graphic's height isn't recovered to before !"
+ wait 500
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_37
+
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sNewWidth as String
+ Dim sNewHeight as String
+
+ sWidth = "4"+ gSeperator + "00" + gMeasurementUnit
+ sHeight = "3"+ gSeperator + "00" + gMeasurementUnit
+
+ sNewWidth = "8"+ gSeperator + "00" + gMeasurementUnit
+ sNewHeight = "6"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test keep ratio"
+ '/// Test keep ratio
+
+ Call hNewDocument
+
+ '/// Insert a graphics and check 'keep ratio'
+ fInsertGraphics("Bughunter.jpg")
+
+ fFormatGraphic("TabType")
+ KeepRatio.UnCheck
+ wait 500
+ Width.SetText sWidth
+ wait 500
+ Height.SetText sHeight
+ wait 500
+ KeepRatio.Check
+ wait 500
+ TabType.OK
+ Sleep 1
+
+ '/// Format / Graphic tabpage Type , change the graphic's width
+ '/// + Check if keep ratio works well
+ fFormatGraphic("TabType")
+ Kontext "TabType"
+ Width.SetText sNewWidth
+ Sleep 1
+ if Height.GetText <> sNewHeight then Warnlog "The graphic's height is wrong !"
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_38
+
+ Dim sGraphicName as String
+ Dim sNavActualItemName as string
+
+ sGraphicName = "TEST1"
+
+ PrintLog "- Check the graphic name in Navigator"
+ '/// Check the graphic name in Navigator
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ Call fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / Graphic / Options , set a new name
+ Call fFormatGraphic("TabZusaetze")
+ sleep(3)
+ Kontext "TabZusaetze"
+ ObjektName.SetText sGraphicName
+ sleep(3)
+ TabZusaetze.OK
+ sleep(1)
+
+ '/// Active navigator to check the graphic name
+ Call fStartupNavigator( "Graphics" , 2 )
+ sleep(2)
+ Kontext "NavigatorWriter"
+ sNavActualItemName = Auswahlliste.GetitemText(2)
+ if sNavActualItemName <> sGraphicName then
+ warnlog "The graphic name should be " + sGraphicName & " but get " & sNavActualItemName & "!"
+ end if
+ Call fCloseNavigator
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_39
+
+ Dim sHorizontalBy as String
+ Dim sVerticalBy as String
+
+ PrintLog "- Test checkbox 'Position' in protect area"
+ '/// Test checkbox 'Position' in protect area
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / Graphic / Options , check 'Position'
+ fFormatGraphic("TabZusaetze")
+ wait 500
+ if PositionSchuetzen.IsChecked = TRUE then warnlog "The default situation of checkbox - position should be unchecked"
+ wait 500
+ PositionSchuetzen.Check
+ wait 500
+ TabZusaetze.OK
+
+ 'Check the original position
+ fFormatGraphic("TabType")
+ wait 500
+ sHorizontalBy = HorizontalBy.GetText
+ sVerticalBy = VerticalBy.GetText
+ TabType.Cancel
+
+ '/// move the picture with keyboard
+ Call wTypeKeys "<Down><Down><Right><Right>"
+
+ '/// + Check if the position is changed
+ fFormatGraphic("TabType")
+ if HorizontalBy.GetText <> sHorizontalBy then warnlog "The position Horizontal should be " +sHorizontalBy + " but get " + HorizontalBy.GetText
+ if VerticalBy.GetText <> sVerticalBy then warnlog "The position Vertical should be " +sVerticalBy + " but get " + VerticalBy.GetText
+ TabType.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_40
+
+ Dim sHorizontalBy as String
+ Dim sVerticalBy as String
+
+ PrintLog "- Test checkbox 'Print' in Property area"
+ '/// Test checkbox 'Print' in Property area
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ '/// Format / Graphic / Options , check Position
+ fFormatGraphic("TabZusaetze")
+ wait 500
+ if Drucken.IsChecked <> TRUE then warnlog "The default situation of checkbox - print should be checked"
+ wait 500
+ PositionSchuetzen.UnCheck
+ wait 500
+ TabZusaetze.OK
+
+ '/// Print to Printer
+ PrintLog "- Please go to printer to check if you get a blank paper!"
+ FilePrint
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.Ok
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ Sleep 1
+ Printing.Cancel
+ end if
+ else
+ Kontext "Printing"
+ Sleep 1
+ Printing.OK
+ Sleep 5
+ end if
+
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.Ok
+ end if
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
diff --git a/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc
new file mode 100644
index 000000000000..23ec4e96ff06
--- /dev/null
+++ b/testautomation/writer/optional/includes/insertgraphic/w_insertgraphic5.inc
@@ -0,0 +1,755 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : helge.delfs@oracle.com
+'*
+'* short description : Test of the insert graphic function - 4
+'*
+'************************************************************************
+'*
+' #1 tInsertGraphic_41 'Test checkbox 'Keep image size'
+' #1 tInsertGraphic_42 'Test checkbox 'Keep scale'
+' #1 tInsertGraphic_43 'Test spacing in tabpage 'wrap'
+' #1 tInsertGraphic_44 'Set the possible Options for the different Wrap types
+' #1 tInsertGraphic_45 'Test Scale in Corp tabpage
+' #1 tInsertGraphic_46 'Test Image size in Corp tabpage
+' #1 tInsertGraphic_47 'Test Restore via "Original Size" button
+' #1 tInsertGraphic_48 'Test link area via a embeded file
+' #1 tInsertGraphic_49 'Test link area via a linked file
+'*
+'\***********************************************************************
+
+testcase tInsertGraphic_41
+
+ Dim sLeft as String
+ Dim sRight as String
+ Dim sUp as String
+ Dim sBottom as String
+ Dim sScaleWidth as String
+ Dim sScaleHeight as String
+ Dim sImageWidth as String
+ Dim sImageHeight as String
+ Dim dDummy1 as double
+ Dim dDummy2 as double
+
+ sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
+ sRight = "1"+ gSeperator + "00" + gMeasurementUnit
+ sUp = "1"+ gSeperator + "00" + gMeasurementUnit
+ sBottom = "1"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test checkbox 'Keep image size'"
+ '/// Test checkbox 'Keep image size'
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+
+ '/// Format / Graphic / Crop , check 'Keep image size' ,
+ '/// - increase the value , check if "keep image size" is efficient
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ GroesseBeibehalten.Check
+ wait 500
+
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- increase Left "
+ Links.SetText sLeft
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleWidth = MassstabBreite.GetText
+
+ PrintLog "- increase Right"
+ Rechts.SetText sRight
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleWidth = MassstabBreite.GetText
+
+ PrintLog "- increase Top "
+ Oben.SetText sUp
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleHeight = MassstabHoehe.GetText
+
+ PrintLog "- increase Bottom "
+ Unten.SetText sBottom
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ TabZuschneiden.Cancel
+
+ '/// - decrease value , check if "keep image size" is efficient
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ GroesseBeibehalten.Check
+ wait 500
+
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- decrease Left "
+ Links.SetText "-" + sLeft
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) >= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleWidth = MassstabBreite.GetText
+
+ PrintLog "- decrease Right"
+ Rechts.SetText "-" + sRight
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) >= StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleWidth = MassstabBreite.GetText
+
+ PrintLog "- decrease Top "
+ Oben.SetText "-" + sUp
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) >= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sScaleHeight = MassstabHoehe.GetText
+
+ PrintLog "- decrease Bottom "
+ Unten.SetText "-" + sBottom
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) >= StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ TabZuschneiden.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_42
+
+ Dim sLeft as String
+ Dim sRight as String
+ Dim sUp as String
+ Dim sBottom as String
+ Dim sScaleWidth as String
+ Dim sScaleHeight as String
+ Dim sImageWidth as String
+ Dim sImageHeight as String
+ Dim dDummy1 as double
+ Dim dDummy2 as double
+
+ sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
+ sRight = "1"+ gSeperator + "00" + gMeasurementUnit
+ sUp = "1"+ gSeperator + "00" + gMeasurementUnit
+ sBottom = "1"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test checkbox 'Keep scale'"
+ '/// Test checkbox 'Keep scale'
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+
+ '/// Format / Graphic / Crop , check Keep scale
+ '/// - increase the value
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ MassstabBeibehalten.Check
+ wait 500
+
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- increase Left "
+ Links.SetText sLeft
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) >= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageWidth = GroesseBreite.GetText
+
+ PrintLog "- increase Right"
+ Rechts.SetText sRight
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) >= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageWidth = GroesseBreite.GetText
+
+ PrintLog "- increase Top "
+ Oben.SetText sUp
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) >= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- increase Bottom "
+ Unten.SetText sBottom
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) >= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ TabZuschneiden.Cancel
+
+ '/// - decrease value
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ MassstabBeibehalten.Check
+ wait 500
+
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- decrease Left "
+ Links.SetText "-" + sLeft
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageWidth = GroesseBreite.GetText
+
+ PrintLog "- decrease Right"
+ Rechts.SetText "-" + sRight
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <= StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <> StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageWidth = GroesseBreite.GetText
+
+ PrintLog "- decrease Top "
+ Oben.SetText "-" + sUp
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ sImageHeight = GroesseHoehe.GetText
+
+ PrintLog "- decrease Bottom "
+ Unten.SetText "-" + sBottom
+ Sleep 2
+
+ if StrToDouble(MassstabBreite.GetText) <> StrToDouble(sScaleWidth) then warnlog "Scale Width isn't right !"
+ if StrToDouble(MassstabHoehe.GetText) <> StrToDouble(sScaleHeight) then warnlog "Scale Height isn't right !"
+ if StrToDouble(GroesseBreite.GetText) <> StrToDouble(sImageWidth) then warnlog "Image Width isn't right !"
+ if StrToDouble(GroesseHoehe.GetText) <= StrToDouble(sImageHeight) then warnlog "Image Height isn't right !"
+
+ TabZuschneiden.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_43
+
+ Dim sLeft as String
+ Dim sRight as String
+ Dim sUp as String
+ Dim sBottom as String
+
+ sLeft = "1"+ gSeperator + "00" + gMeasurementUnit
+ sRight = "2"+ gSeperator + "00" + gMeasurementUnit
+ sUp = "3"+ gSeperator + "00" + gMeasurementUnit
+ sBottom = "4"+ gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Test spacing in tabpage 'wrap'"
+ '/// Test spacing in tabpage 'wrap'
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+
+ '/// Format / Graphic / Wrap , set value in spacing area
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Kein.Check
+ wait 500
+ AbstaendeLinks.SetText sLeft
+ wait 500
+ AbstaendeRechts.SetText sRight
+ wait 500
+ AbstaendeOben.SetText sUp
+ wait 500
+ AbstaendeUnten.SetText sBottom
+ wait 500
+ TabUmlauf.OK
+
+ '/// Check if the set value is correct
+ fFormatGraphic("TabUmlauf")
+ if AbstaendeLinks.GetText <> sLeft then warnlog "Spacing - Lefe isn't correct!"
+ if AbstaendeRechts.GetText <> sRight then warnlog "Spacing - Right isn't correct!"
+ if AbstaendeOben.GetText <> sUp then warnlog "Spacing - Top isn't correct!"
+ if AbstaendeUnten.GetText <> sBottom then warnlog "Spacing - Bottom isn't correct!"
+ TabUmlauf.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_44
+
+ PrintLog "- Set the possible Options for the different Wrap types"
+ '/// Set the possible Options for the different Wrap types
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("Bughunter.jpg")
+
+ PrintLog " 1. No Wrap:"
+ '/// Format / Graphic / tabpage Wrap - No page , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Kein.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled = TRUE then Warnlog "Checkbox - First paragraph should be unenabled!"
+ if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
+ if Kontur.IsEnabled = TRUE then Warnlog "Checkbox - Contour should be unenabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+ TabUmlauf.Cancel
+
+ PrintLog " 2. Before:"
+ '/// Format / Graphic / tabpage Wrap - Before , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Links.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
+ if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
+ if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+
+ Kontur.Check
+ wait 500
+ if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
+ TabUmlauf.Cancel
+
+ PrintLog " 3. After:"
+ '/// Format / Graphic / tabpage Wrap - After , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Rechts.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
+ if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
+ if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+
+ Kontur.Check
+ wait 500
+ if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
+ TabUmlauf.Cancel
+
+ PrintLog " 4. Parallel:"
+ '/// Format / Graphic / tabpage Wrap - Parallel , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Parallel.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
+ if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
+ if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+
+ Kontur.Check
+ wait 500
+ if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
+ TabUmlauf.Cancel
+
+ PrintLog " 5. Through:"
+ '/// Format / Graphic / tabpage Wrap - Through , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Durchlauf.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
+ if ImHintergrund.IsEnabled <> TRUE then Warnlog "Checkbox - In background should be enabled!"
+ if Kontur.IsEnabled = TRUE then Warnlog "Checkbox - Contour should be unenabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+ TabUmlauf.Cancel
+
+ PrintLog " 6. Optimal:"
+ '/// Format / Graphic / tabpage Wrap - Optimal , check possible options
+ fFormatGraphic("TabUmlauf")
+ Sleep 1
+ Dynamisch.Check
+ Sleep 1
+ if ErsterAbsatz.IsEnabled <> TRUE then Warnlog "Checkbox - First paragraph should be enabled!"
+ if ImHintergrund.IsEnabled = TRUE then Warnlog "Checkbox - In background should be unenabled!"
+ if Kontur.IsEnabled <> TRUE then Warnlog "Checkbox - Contour should be enabled!"
+ if NurAussen.IsEnabled = TRUE then Warnlog "Checkbox - Outside only should be unenabled!"
+
+ Kontur.Check
+ wait 500
+ if NurAussen.IsEnabled <> TRUE then Warnlog "Checkbox - Outside only should be enabled after checking contour!"
+ TabUmlauf.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_45
+
+ Dim sScaleWidth as String
+ Dim sScaleHeight as String
+ Dim sImageWidth as String
+ Dim sImageHeight as String
+
+ sScaleWidth = "100%"
+ sScaleHeight = "100%"
+
+ PrintLog "- Test Scale in Corp tabpage"
+ '/// Test Scale in Corp tabpage
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+ Sleep 1
+
+ '/// Format/Graphic tabpage corp , double Scale (width and height)
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ MassstabBreite.SetText sScaleWidth
+ MassstabHoehe.SetText sScaleHeight
+ TabZuschneiden.OK
+
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ sScaleWidth = "200%"
+ sScaleHeight = "200%"
+
+ MassstabBreite.SetText sScaleWidth
+ wait 500
+ MassstabHoehe.SetText sScaleHeight
+ wait 500
+
+ sImageWidth = Str(StrToDouble(sImageWidth) *2) + gMeasurementUnit
+ sImageHeight = Str(StrToDouble(sImageHeight)*2) + gMeasurementUnit
+
+ '/// Check if the image size (width and height) are changed corresponding
+ if fCalculateTolerance(GroesseBreite.GetText , sImageWidth) > 0.03 then
+ Warnlog "Image Width is wrong, should be " + sImageWidth + " but get " + GroesseBreite.GetText
+ end if
+
+ if fCalculateTolerance(GroesseHoehe.GetText , sImageHeight) > 0.03 then
+ Warnlog "Image Height is wrong, should be " + sImageHeight + " but get " + GroesseHoehe.GetText
+ end if
+ TabZuschneiden.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_46
+
+ Dim sScaleWidth as String
+ Dim sScaleHeight as String
+ Dim sImageWidth as String
+ Dim sImageHeight as String
+
+ sImageWidth = "4"+ gSeperator + "00" + gMeasurementUnit
+ sImageHeight = "2"+ gSeperator + "80" + gMeasurementUnit
+
+ PrintLog "- Test Image size in Corp tabpage"
+ '/// Test Image size in Corp tabpage
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+ Sleep 1
+
+ '/// Format/Graphic tabpage corp , double Imagin size (width and height)
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ GroesseBreite.SetText sImageWidth
+ GroesseHoehe.SetText sImageHeight
+ TabZuschneiden.OK
+
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+
+ sImageWidth = "8"+ gSeperator + "00" + gMeasurementUnit
+ sImageHeight = "5"+ gSeperator + "60" + gMeasurementUnit
+
+ GroesseBreite.SetText sImageWidth
+ wait 500
+ GroesseHoehe.SetText sImageHeight
+ wait 500
+
+ '/// Check if the Scale(width and height) are changed corresponding
+ if Abs(StrToDouble(sScaleWidth) *2 - StrToDouble(MassstabBreite.GetText) ) > 2 then
+ Warnlog "Scale Width is wrong, should be " + Str(StrToDouble(sScaleWidth) *2) + "%" + " but get " + MassstabBreite.GetText
+ end if
+
+ if Abs(StrToDouble(sScaleHeight) *2 - StrToDouble(MassstabHoehe.GetText) ) > 2 then
+ Warnlog "Scale Height is wrong, should be " + Str(StrToDouble(sScaleHeight)*2) + "%" + " but get " + MassstabHoehe.GetText
+ end if
+ TabZuschneiden.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_47
+
+ Dim sScaleWidth as String
+ Dim sScaleHeight as String
+ Dim sImageWidth as String
+ Dim sImageHeight as String
+ Dim sNewImageWidth as String
+ Dim sNewImageHeight as String
+
+ sNewImageWidth = "8"+ gSeperator + "00" + gMeasurementUnit
+ sNewImageHeight = "5"+ gSeperator + "60" + gMeasurementUnit
+
+ PrintLog "- Test Restore via 'Original Size' button"
+ '/// Test Restore via "Original Size" button
+
+ Call hNewDocument
+
+ '/// Insert a graphics
+ fInsertGraphics("game.bmp")
+ Sleep 1
+
+ '/// Format/Graphic tabpage corp , double Image size (width and height)
+ fFormatGraphic("TabZuschneiden")
+ wait 500
+ sScaleWidth = MassstabBreite.GetText
+ sScaleHeight = MassstabHoehe.GetText
+ sImageWidth = GroesseBreite.GetText
+ sImageHeight = GroesseHoehe.GetText
+
+ GroesseBreite.SetText sNewImageWidth
+ wait 500
+ GroesseHoehe.SetText sNewImageHeight
+ wait 500
+
+ '/// + Click 'Original size' button
+ Originalgroesse.Click
+ Sleep 1
+
+ '/// Check if the Scale and Image size are recovered to the original size
+ if MassstabBreite.GetText <> sScaleWidth then warnlog "Scale Width isn't right !"
+ if MassstabHoehe.GetText <> sScaleHeight then warnlog "Scale Height isn't right !"
+ if GroesseBreite.GetText <> sImageWidth then warnlog "Image Width isn't right !"
+ if GroesseHoehe.GetText <> sImageHeight then warnlog "Image Height isn't right !"
+ TabZuschneiden.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_48
+
+ Dim sFileName as String
+
+ sFileName = "game.bmp"
+
+ PrintLog "- Test link area via a embedded file"
+ '/// Test link area via a embedded file
+
+ Call hNewDocument
+
+ '/// Insert a graphics (embeded)
+ InsertGraphicsFromFile
+ Kontext "GrafikEinfuegenDlg"
+ Dateiname.Settext (ConvertPath (gTesttoolpath + "writer\optional\input\insertgraphic\" + sFileName) )
+ Sleep 1
+ Link.UnCheck
+ Sleep 1
+ Oeffnen.Click
+ Sleep 2
+
+ '/// Format/Graphic tabpage Graphics , check if we can get [None] in file name in Link area
+ fFormatGraphic("TabGrafik")
+ wait 500
+ if left(Dateiname.GetText , 1) <> "[" then warnlog "Should be none in file name, but get " + Dateiname.GetText
+ if Durchsuchen.IsEnabled = TRUE then Warnlog "Button should be unEnabled!"
+ TabGrafik.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+testcase tInsertGraphic_49
+
+ Dim sFileName as String
+ Dim sHopeResult as String
+
+ sFileName = "game.bmp"
+ sHopeResult = fConvertBacklashToSlash(gTesttoolpath + "writer\optional\input\insertgraphic\" + sFileName)
+
+ if gPlatGroup <> "unx" then
+ sHopeResult = "file:///" + sHopeResult
+ else
+ sHopeResult = "file://" + sHopeResult
+ end if
+
+ PrintLog "- Test link area via a linked file"
+ '/// Test link area via a linked file
+
+ Call hNewDocument
+
+ '/// Insert a graphics (linked)
+ fInsertGraphics(sFileName)
+
+ '/// Format/Graphic tabpage Graphics , check if we can get
+ '/// + the correct name in 'file name' in Link area
+ fFormatGraphic("TabGrafik")
+ wait 500
+ if Dateiname.GetText <> sHopeResult then warnlog "linked file name is wrong, should be " + sHopeResult + " but get " + Dateiname.GetText
+ try
+ Durchsuchen.Click
+ Kontext
+ Kontext "GrafikEinfuegenDlg"
+ if Dateiname.GetSelText <> sFileName then warnlog "file name is wrong, should be " + sFileName + " but get " + Dateiname.GetText
+ if Link.IsChecked <> TRUE then warnlog "The linked checkbox should be checked!"
+ GrafikEinfuegenDlg.Cancel
+ catch
+ warnlog "Button should be enabled!"
+ endcatch
+
+ Kontext "TabGrafik"
+ TabGrafik.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------------------------
+
+function fCalculateTolerance( sNumber1 , sNumber2 )
+
+'/// change 2 parameters to number , then Compare them and return the result.
+
+ Dim dNumber1 as Single
+ dim dNumber2 as Single
+ Dim iCommaLocation1 as integer
+ Dim iCommaLocation2 as Integer
+
+ 'the code below 4 lines is set "2,00cm" to "2.00"cm if needed
+ iCommaLocation1 = InStr(sNumber1 , ",")
+ if iCommaLocation1 > 0 then
+ sNumber1 = Left(sNumber1 , iCommaLocation1-1) + "." + Right(sNumber1,Len(sNumber1) - iCommaLocation1)
+ end if
+
+ iCommaLocation2 = InStr(sNumber2 , ",")
+ if iCommaLocation2 > 0 then
+ sNumber2 = Left(sNumber2 , iCommaLocation2-1) + "." + Right(sNumber2,Len(sNumber2) - iCommaLocation2)
+ end if
+
+ dNumber1 = Val( Left(sNumber1, Len(sNumber1)-Len(gMeasurementUnit) ))
+ dNumber2 = Val( Left(sNumber2, Len(sNumber2)-Len(gMeasurementUnit) ))
+ fCalculateTolerance = Abs( dNumber1 - dNumber2 )
+
+end function
+