summaryrefslogtreecommitdiff
path: root/testautomation/global/tools/includes/required/t_doc2.inc
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/global/tools/includes/required/t_doc2.inc')
-rwxr-xr-xtestautomation/global/tools/includes/required/t_doc2.inc370
1 files changed, 181 insertions, 189 deletions
diff --git a/testautomation/global/tools/includes/required/t_doc2.inc b/testautomation/global/tools/includes/required/t_doc2.inc
index ea3a25de354b..973082f6ea73 100755
--- a/testautomation/global/tools/includes/required/t_doc2.inc
+++ b/testautomation/global/tools/includes/required/t_doc2.inc
@@ -1,7 +1,7 @@
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'*
+'*
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
@@ -35,121 +35,113 @@
'*
'* short description : Global Routines for Document Handling; Part two
'*
-'************************************************************************
-' #1 hTabelleEinfuegen
-' #1 ZellenMarkieren
-' #1 hRechteckErstellen
-' #1 hTextrahmenErstellen
-' #1 SchreibenInMathdok
-' #1 sMakeReadOnlyDocumentEditable
-' #1 fSelectFirstOLE 'Selecting the first OLE object
'\***********************************************************************
sub hTabelleEinfuegen
-'/// <b>WRITER only </b>///'
-'/// hTabelleEinfuegen hInsertTable ///'
-'/// insert a dummy table in writer/writerweb/masterdocument ///'
- TableInsertTable
- sleep(2)
- Kontext "TabelleEinfuegenWriter"
- wait 500
- TabelleEinfuegenWriter.OK
- sleep(1)
+ '/// <b>WRITER only </b>///'
+ '/// hTabelleEinfuegen hInsertTable ///'
+ '/// insert a dummy table in writer/writerweb/masterdocument ///'
+ TableInsertTable
+ sleep(2)
+ Kontext "TabelleEinfuegenWriter"
+ wait 500
+ TabelleEinfuegenWriter.OK
+ sleep(1)
- Kontext "TableObjectbar"
- sleep(1)
- if TableObjectbar.NotExists then
- Kontext "TextObjectbar"
- TextObjectbar.SetNextToolBox
- end if
+ Kontext "TableObjectbar"
+ sleep(1)
+ if TableObjectbar.NotExists then
+ Kontext "TextObjectbar"
+ TextObjectbar.SetNextToolBox
+ end if
- Select Case gApplication
- Case "WRITER"
- Kontext "DocumentWriter"
- Case "MASTERDOC"
- Kontext "DocumentMasterDoc"
- Case "HTMLDOKUMENT"
- Kontext "DocumentWriterWeb"
- end select
- sleep(1)
+ Select Case gApplication
+ Case "WRITER"
+ Kontext "DocumentWriter"
+ Case "MASTERDOCUMENT"
+ Kontext "DocumentMasterDoc"
+ Case "HTML"
+ Kontext "DocumentWriterWeb"
+ end select
+ sleep(1)
end sub
'
'-------------------------------------------------------------------------------
'
sub ZellenMarkieren ( Down%, Right% )
-'/// <b>CALC only</b> ///'
-'/// ZellenMarkieren ( Down%, Right% ) : mark the cells ///'
- Dim Anzahl as Integer
+ '/// <b>CALC only</b> ///'
+ '/// ZellenMarkieren ( Down%, Right% ) : mark the cells ///'
+ Dim Anzahl as Integer
- Kontext "DocumentCalc"
- Anzahl = Right% - 1
- DocumentCalc.TypeKeys "<Shift Right>", Anzahl
- Anzahl = Down% - 1
- DocumentCalc.TypeKeys "<Shift Down>", Anzahl
+ Kontext "DocumentCalc"
+ Anzahl = Right% - 1
+ DocumentCalc.TypeKeys "<Shift Right>", Anzahl
+ Anzahl = Down% - 1
+ DocumentCalc.TypeKeys "<Shift Down>", Anzahl
end sub
'
'-------------------------------------------------------------------------------
'
sub hRechteckErstellen ( BeginX%, BeginY%, EndX%, EndY% )
-'/// <b>IMPRESS/DRAW only</b> ///'
-'/// hRechteckErstellen ( BeginX, BeginY, EndX, EndY ) : create a rectangle ///'
- WL_DRAW_Rechteck
- gMouseMove ( BeginX%, BeginY%, EndX%, EndY% )
+ '/// <b>IMPRESS/DRAW only</b> ///'
+ '/// hRechteckErstellen ( BeginX, BeginY, EndX, EndY ) : create a rectangle ///'
+ WL_DRAW_Rechteck
+ gMouseMove ( BeginX%, BeginY%, EndX%, EndY% )
end sub
'
'-------------------------------------------------------------------------------
'
sub hTextrahmenErstellen ( TextEingabe$, BeginX%, BeginY%, EndX%, EndY% )
-'/// <b>IMPRESS/DRAW only</b> ///'
-'/// hTextrahmenErstellen ( String, BeginX, BeginY, EndX, EndY ) : create a textbox with a textstring ///'
- WL_SD_TextEinfuegenDraw
- gMouseMove ( BeginX%, BeginY%, EndX%, EndY% )
- hTypeKeys TextEingabe$
+ '/// <b>IMPRESS/DRAW only</b> ///'
+ '/// hTextrahmenErstellen ( String, BeginX, BeginY, EndX, EndY ) : create a textbox with a textstring ///'
+ WL_SD_TextEinfuegenDraw
+ gMouseMove ( BeginX%, BeginY%, EndX%, EndY% )
+ hTypeKeys TextEingabe$
end sub
'
'-------------------------------------------------------------------------------
'
sub SchreibenInMathdok ( Eingabe as String )
-'/// <b>MATH only</b> ///'
-'/// SchreibenInMathDok ( String ) : write text in a mathdocument ( with clipboard ) ///'
- if Eingabe <> "Unsinn" then
- SetClipboard Eingabe
- else
- SetClipboard "NROOT <?> <?><over b==<?>"
- endif
- if (GetClipboard() <> Eingabe) then
- warnlog "--No Clipboard available :-(--"
- printlog "---ClipTest--- should: "+Eingabe +", is: "+GetClipboard
- endif
- EditPaste
- sleep(3)
+ '/// <b>MATH only</b> ///'
+ '/// SchreibenInMathDok ( String ) : write text in a mathdocument ( with clipboard ) ///'
+ if Eingabe <> "Unsinn" then
+ SetClipboard Eingabe
+ else
+ SetClipboard "NROOT <?> <?><over b==<?>"
+ endif
+ if (GetClipboard() <> Eingabe) then
+ warnlog "--No Clipboard available :-(--"
+ printlog "---ClipTest--- should: "+Eingabe +", is: "+GetClipboard
+ endif
+ EditPaste
+ sleep(3)
end sub
'
'-------------------------------------------------------------------------------
'
-sub sMakeReadOnlyDocumentEditable
- If IsItLoaded() then
+sub sMakeReadOnlyDocumentEditable
+ If IsItLoaded() then
Kontext "Standardbar"
if Bearbeiten.IsEnabled then
- 'Check if the button is enabled.
- if Bearbeiten.getState(2) = 0 then
+ 'Check if the button is enabled.
+ if Bearbeiten.getState(2) = 0 then
'Check if the document has been loaded read-only and if yes
'click on the 'Edit'-button
- Bearbeiten.Click()
+ Bearbeiten.Click()
sleep (2)
Kontext
if Active.Exists(5) then
'If there is a messagebox coming up, click on Yes/OK
printlog "Document was read-only. A copy will be used."
Active.Yes
- end if
+ end if
Kontext
if Active.Exists(2) then
' Sometimes an messagebox will be opened that the file does
- ' not exists.
+ ' not exists.
QAErrorLog Active.GetText
Active.OK
- end if
+ end if
end if
end if
else
@@ -160,128 +152,128 @@ end sub
'-------------------------------------------------------------------------------
'
function fSelectFirstOLE() as integer
-'Select first visible OLE object using Navigator
-'Returns error-code:
-'+ 0 := Sucess
-'- 1 := unknown application
+ 'Select first visible OLE object using Navigator
+ 'Returns error-code:
+ '+ 0 := Sucess
+ '- 1 := unknown application
dim bNavigatorWasVisible as boolean
- bNavigatorWasVisible = FALSE
+ bNavigatorWasVisible = FALSE
dim iIndex
fSelectFirstOLE = -1
-
- select case lcase(gApplication)
- case "calc" : Kontext "NavigatorCalc"
- 'First check if Navigator is visible and remember result
- if NavigatorCalc.exists (10) then
- bNavigatorWasVisible = TRUE
- else
- try
- 'Invoke Navigator if not visible
- ViewNavigator
- catch
- 'If inside chart or elsewhere the call
- 'will fail. Again trying the slot after
- 'switching to the document.
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- ViewNavigator
- endcatch
- end if
- Kontext "NavigatorCalc"
- if NavigatorCalc.exists (10) then
- 'Select first OLE in list
- Liste.TypeKeys "<HOME>"
- for iIndex = 1 to 8
- Liste.TypeKeys "-"
- wait 500
- Liste.TypeKeys "<DOWN>"
- wait 500
- next iIndex
- Liste.select(6)
- Liste.TypeKeys "+"
- Liste.TypeKeys "<DOWN><RETURN>"
- fSelectFirstOLE = 0
- else
- QAErrorLog "Navigator couldn't be opened!"
- end if
- case "draw" , "impress" : Kontext "NavigatorDraw"
- if NavigatorDraw.Exists(10) then
- bNavigatorWasVisible = TRUE
- else
- try
- 'Invoke Navigator if not visible
- ViewNavigator
- catch
- 'If inside chart or elsewhere the call
- 'will fail. Again trying the slot after
- 'switching to the document.
- Kontext "DocumentDraw"
- DocumentDraw.TypeKeys "<Escape>"
- ViewNavigator
- endcatch
- Kontext "NavigatorDraw"
- if NavigatorDraw.exists(10) then
- 'Select first OLE in list
- Liste.TypeKeys "<HOME>"
- Liste.select(1)
- Liste.TypeKeys "+<DOWN><RETURN>"
- fSelectFirstOLE = 0
- else
- QAErrorLog "Navigator did not occoured!"
- end if
- end if
-
- case "writer" , "htmldokument" , "masterdoc" :
- select case lcase(gApplication)
- case "masterdoc" : Kontext "NavigatorGlobalDoc"
- if NavigatorGlobalDoc.Exists(10) then
- bNavigatorWasVisible = TRUE
- else
- ViewNavigator
- end if
- wait 500
- Kontext "NavigatorGlobalDoc"
- if Liste.IsVisible then
- Kontext "GlobaldokumentToolbox"
- Umschalten.Click
- endif
- case else : Kontext "NavigatorWriter"
- 'First check if Navigator is visible and remember result
- if NavigatorWriter.Exists (10) then
- bNavigatorWasVisible = TRUE
- else
- try
- 'Invoke Navigator if not visible
- ViewNavigator
- catch
- 'If inside chart or elsewhere the call
- 'will fail. Again trying the slot after
- 'switching to the document.
- Kontext "DocumentWriter"
- call gMouseclick (99,99)
- call gMouseclick (50,50)
- ViewNavigator
- endcatch
- end if
- end select
- Kontext "NavigatorWriter"
- if NavigatorWriter.Exists(10) then
- 'Select first OLE in list
- Auswahlliste.TypeKeys "<HOME>"
- for iIndex = 1 to 13
- Auswahlliste.TypeKeys "-<DOWN>"
- next iIndex
- Auswahlliste.select(5)
- Auswahlliste.TypeKeys "+<DOWN><RETURN>"
- fSelectFirstOLE = 0
- else
- QAErrorLog "Navigator did not occoured!"
- end if
- case else : QAErrorLog "Application not supported"
- end select
-
+
+ select case gApplication
+ case "CALC" : Kontext "NavigatorCalc"
+ 'First check if Navigator is visible and remember result
+ if NavigatorCalc.exists (10) then
+ bNavigatorWasVisible = TRUE
+ else
+ try
+ 'Invoke Navigator if not visible
+ ViewNavigator
+ catch
+ 'If inside chart or elsewhere the call
+ 'will fail. Again trying the slot after
+ 'switching to the document.
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ ViewNavigator
+ endcatch
+ end if
+ Kontext "NavigatorCalc"
+ if NavigatorCalc.exists (10) then
+ 'Select first OLE in list
+ Liste.TypeKeys "<HOME>"
+ for iIndex = 1 to 8
+ Liste.TypeKeys "-"
+ wait 500
+ Liste.TypeKeys "<DOWN>"
+ wait 500
+ next iIndex
+ Liste.select(6)
+ Liste.TypeKeys "+"
+ Liste.TypeKeys "<DOWN><RETURN>"
+ fSelectFirstOLE = 0
+ else
+ QAErrorLog "Navigator couldn't be opened!"
+ end if
+ case "DRAW" , "IMPRESS" : Kontext "NavigatorDraw"
+ if NavigatorDraw.Exists(10) then
+ bNavigatorWasVisible = TRUE
+ else
+ try
+ 'Invoke Navigator if not visible
+ ViewNavigator
+ catch
+ 'If inside chart or elsewhere the call
+ 'will fail. Again trying the slot after
+ 'switching to the document.
+ Kontext "DocumentDraw"
+ DocumentDraw.TypeKeys "<Escape>"
+ ViewNavigator
+ endcatch
+ Kontext "NavigatorDraw"
+ if NavigatorDraw.exists(10) then
+ 'Select first OLE in list
+ Liste.TypeKeys "<HOME>"
+ Liste.select(1)
+ Liste.TypeKeys "+<DOWN><RETURN>"
+ fSelectFirstOLE = 0
+ else
+ QAErrorLog "Navigator did not occoured!"
+ end if
+ end if
+
+ case "WRITER" , "HTML" , "MASTERDOCUMENT" :
+ select case gApplication
+ case "MASTERDOCUMENT" : Kontext "NavigatorGlobalDoc"
+ if NavigatorGlobalDoc.Exists(10) then
+ bNavigatorWasVisible = TRUE
+ else
+ ViewNavigator
+ end if
+ wait 500
+ Kontext "NavigatorGlobalDoc"
+ if Liste.IsVisible then
+ Kontext "GlobaldokumentToolbox"
+ Umschalten.Click
+ endif
+ case else : Kontext "NavigatorWriter"
+ 'First check if Navigator is visible and remember result
+ if NavigatorWriter.Exists (10) then
+ bNavigatorWasVisible = TRUE
+ else
+ try
+ 'Invoke Navigator if not visible
+ ViewNavigator
+ catch
+ 'If inside chart or elsewhere the call
+ 'will fail. Again trying the slot after
+ 'switching to the document.
+ Kontext "DocumentWriter"
+ call gMouseclick (99,99)
+ call gMouseclick (50,50)
+ ViewNavigator
+ endcatch
+ end if
+ end select
+ Kontext "NavigatorWriter"
+ if NavigatorWriter.Exists(10) then
+ 'Select first OLE in list
+ Auswahlliste.TypeKeys "<HOME>"
+ for iIndex = 1 to 13
+ Auswahlliste.TypeKeys "-<DOWN>"
+ next iIndex
+ Auswahlliste.select(5)
+ Auswahlliste.TypeKeys "+<DOWN><RETURN>"
+ fSelectFirstOLE = 0
+ else
+ QAErrorLog "Navigator did not occoured!"
+ end if
+ case else : QAErrorLog "Application not supported"
+ end select
+
'Close navigator if it was invisible by entering the routine
if bNavigatorWasVisible = TRUE then
printlog "Leaving navigator open as initially found"
@@ -292,5 +284,5 @@ function fSelectFirstOLE() as integer
else
printlog "Closing navigator not needed. It was not possible to open it."
end if
- end if
+ end if
end function