summaryrefslogtreecommitdiff
path: root/testautomation/math/optional
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/math/optional')
-rwxr-xr-xtestautomation/math/optional/includes/m_101_.inc710
-rw-r--r--testautomation/math/optional/includes/m_105.inc690
-rwxr-xr-xtestautomation/math/optional/includes/m_106_.inc65
-rwxr-xr-xtestautomation/math/optional/input/101_1.sxmbin0 -> 3284 bytes
-rwxr-xr-xtestautomation/math/optional/input/101_2.sxwbin0 -> 20478 bytes
-rwxr-xr-xtestautomation/math/optional/input/filter/math.sxwbin0 -> 5399 bytes
-rwxr-xr-xtestautomation/math/optional/input/filter/precal_test.docbin0 -> 143360 bytes
-rwxr-xr-xtestautomation/math/optional/input/filter/quantum_field.docbin0 -> 219648 bytes
-rwxr-xr-xtestautomation/math/optional/input/filter/seventh_grade.docbin0 -> 244224 bytes
-rwxr-xr-xtestautomation/math/optional/m_lvl1.bas60
10 files changed, 1525 insertions, 0 deletions
diff --git a/testautomation/math/optional/includes/m_101_.inc b/testautomation/math/optional/includes/m_101_.inc
new file mode 100755
index 000000000000..989857403546
--- /dev/null
+++ b/testautomation/math/optional/includes/m_101_.inc
@@ -0,0 +1,710 @@
+'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 : thorsten.bosbach@oracle.com
+'*
+'* short description :
+'*
+'\******************************************************************
+
+ dim cActFilter as string ' used filter for save
+ Const cActFilterExt = ".sxm" ' used filter for save (extension)
+
+sub m_101_
+ cActFilter = gMathFilter
+ Printlog Chr(13) + "-- File Menu --"
+
+' tFileNew
+' Call Autopilot 'in Inc\desktop\autopilo.inc
+' Call tFileClose
+ Call tFileSave
+ Call tFileSaveAs
+ Call tFilePassword ' check which filtertypes enable saving with password
+ Call tFileOpen_1 ' just load all previous saved files in this test
+ Call tFileOpen_2 ' load testfiles for filters
+ gApplication = "WRITER"
+ Call tToolsCatalog ' code is in m_105_.inc, but i want to print he result, so i needed to moove teh call to here
+ gApplication = "MATH"
+ Call tFilePrint ' writer dokument with math ole's
+' Call tFileSaveAll
+' Call tFileNewLoad
+' Call tFileVersions
+' tDocumentAsEmail
+' Call tFileProperties
+' Call tFilePrintersetting
+' Call tFileEnd
+
+end sub
+
+testcase tFileSave
+ dim sFileName as string ' test document & new created doc
+ dim sFormula as string ' container for formula to create document with
+ dim Exlist(30) as string
+ dim sTemp as string
+ dim i,x,y as integer
+
+ '/// if not exists : gOfficePath + '\\user\\math\\level1\\', create it ///'
+ if app.dir (ConvertPath ( gOfficePath + "user/work/math") ) = "" then
+ app.mkdir ConvertPath ( gOfficePath + "user/work/math")
+ endif
+ if app.dir (ConvertPath ( gOfficePath + "user/work/math/level1")) = "" then
+ app.mkdir ConvertPath ( gOfficePath + "user/work/math/level1")
+ endif
+
+ sFileName = ConvertPath ( gOfficePath + "user/work/math/level1")
+ Printlog "'/// deleting all files in output directory: \\user\\work\\math\\level1\\ ///'"
+ if gSamePC = TRUE then ' delete export directory
+ GetFileList ( sFileName, "*.*", Exlist() )
+ if KillFileList ( Exlist() ) <> TRUE then
+ Warnlog "Couldn't delete all Files in Output-Export-Directory, the followings are still there:"
+ for i=1 to ListCount ( Exlist() )
+ printlog " <> " + Exlist(i)
+ next i
+ end if
+ end if
+
+' should be default format?!
+
+'/// take formulatext from loaded file -> language independant! ///'
+ sFormula = TBOloadFormulaFromFile()
+ if sFormula = "gehtnicht" then
+ qaErrorlog "can not make document writeable - exiting test"
+ goto endsub
+ endif
+ hNewDocument
+'/// write formula down ///'
+ SchreibenInMathdok (sFormula)
+ sleep 3
+ hFileSaveAsKill (sFileName + "filesave.sxm")
+' Get used filter name
+ FileSaveAs
+ sleep 2
+ Kontext "SpeichernDlg"
+ sTemp = Dateityp.GetSelText
+ SpeichernDlg.Cancel
+
+'/// file save with default filter as: "\\user\\work\\math\\level1\\filesave...." ///'
+
+ printlog " saved with filter: "+ sTemp
+ Call hCloseDocument
+endcase
+
+testcase tFileSaveAs
+ dim sFileName as string ' test document & new created doc
+ dim sFormula as string ' container for formula to create document with
+ dim sTemp as string
+ dim sFilter (50) as string
+ dim i,x,y as integer
+ dim bAlienWarning as boolean
+
+ sFilter (0) = 0 ' initalisize ;-)...
+
+'/// take formulatext from loaded file -> language independant! ///'
+ sFormula = TBOloadFormulaFromFile
+ if sFormula = "gehtnicht" then
+ qaErrorlog "can not make document writeable - exiting test"
+ goto endsub
+ endif
+
+ hNewDocument
+'/// write formula down ///'
+ SchreibenInMathdok sFormula
+ sleep 3
+
+'/// start loop 3 times for: ///'
+'///+ StarOffice 6.0 Formula ///'
+'///+ StarMath 5.0 ///'
+'///+ MathML 1.01 ///'
+'/// to be language independant, select first, second last and last filter from list -> but try to check the names :-) ///'
+
+' to use the helper fileSaveAs functions i get all available filters...
+ ListAppend(sFilter(), "StarOffice XML (Math)")
+ ListAppend(sFilter(), "math8")
+
+ bAlienWarning = isCheckedWarnAlienFormat
+ if (NOT bAlienWarning) then
+ qaErrorLog "Somebody disabled 'Alien Warnings' in the options, will enable it again now."
+ isCheckedWarnAlienFormat(true)
+ endif
+
+ for i = 1 to (ListCount(sFilter()))
+ sFileName = convertpath( gOfficePath + "user/work/math/level1/fsas_"+(i))
+ sleep 1
+ printlog "going to save: '"+sFileName+"'"
+ sleep 1
+ '----- try to WorkAround focus change ---------
+ kontext "DocumentMath"
+ DocumentMath.mouseDown 10,10
+ DocumentMath.mouseUp 10,10
+ '-----------------------------------------------
+ hFileSaveAsWithFilterKill (sFileName, sFilter(i), TRUE )
+ '/// file save with filter as: "output\\math\\fsas_[0,1,2]" ///'
+ ' Alien Warning has not to appear on the first one: Default format .odf
+ Kontext "AlienWarning"
+ if AlienWarning.exists(5) then
+ if (1=i) then
+ warnlog "- AlienWarning on default file format! Not OK!"
+ else
+ printlog "- AlienWarning"
+ endif
+ AlienWarning.ok
+ endif
+ printlog " saved with filter ("+i+"/2): "+ sFilter(i)
+ next i
+'/// TODO: small check, if correct filter was used! ///'
+ sleep 3
+ fileclose
+ sleep 3
+ kontext "active"
+ if active.exists then
+ printlog "active about informationloss... :-) that's OK: '"+active.GetText+"'"
+ active.yes
+ endif
+endcase
+
+testcase tFileOpen_1
+'/// a small loop, to load all files previous saved ///'
+ dim sFileName as string ' test document & new created doc
+ dim sFormula as string ' container for formula to create document with
+ dim sFileList (30) as string
+ dim sTemp as string
+ dim i,x,y as integer
+
+'///load documents from "output\\math\\" ///
+ sFileName = ConvertPath ( gOfficePath + "user/work/math/level1/" )
+ GetFileList ( sFileName, "*.*", sFileList() )
+
+ x = ListCount ( sFileList() )
+ for i = 1 to x
+ printlog "("+i+"/"+x+"): "+sFileList(i)
+ hFileOpen ( sFileList(i) )
+ Sleep 2
+ If hIsNamedDocLoaded (sFileList(i)) Then
+ printlog " used filter: " + hGetUsedFilter()
+ else
+ warnlog "document didn't get loaded"
+ endif
+ hCloseDocument
+ sleep 2
+ next i
+endcase
+
+testcase tFileOpen_2
+'/// a small loop, to load a testfile for every non SO filter files ///'
+'/// files are taken from: http://www.dessci.com/en/products/mathtype/win/samples/ ///'
+ dim sFileName as string ' test document & new created doc
+ dim sFormula as string ' container for formula to create document with
+ dim sFileList (30) as string
+ dim sTemp as string
+ dim i,x,y as integer
+
+'///load documents from "input\\math\\level1\\filter\\" ///
+ sFileName = ConvertPath ( gTesttoolPath + "math/optional/input/level1/filter/" )
+ GetFileList ( sFileName, "*.*", sFileList() )
+
+ x = ListCount ( sFileList() )
+ for i = 1 to x
+ printlog "("+i+"/"+x+"): "+sFileList(i)
+ hFileOpen ( sFileList(i) )
+ Sleep 20
+ If hIsNamedDocLoaded (sFileList(i)) Then
+ printlog " used filter: " + hGetUsedFilter()
+ else
+ warnlog "document didn't get loaded"
+ endif
+ hCloseDocument
+ next i
+endcase
+
+testcase tFilePassword
+ dim i,x as integer
+ dim sTemp as string
+ const cFilterCount = 4
+ dim sFilterName as string
+ dim sFilter as string
+ dim sFilterExt() as string
+
+ Printlog "'///- Check each Filter if password is possible ///"
+
+ ' make sure saving in latest math filter works, checking global filtername and if necessary change it
+ sFilter = hGetUIFiltername("math8")
+ sFilterExt() = hGetFilternameExtension("math8")
+ sFilterName = sFilter + " (." + sFilterExt(0) + ")"
+ printlog sFilterName
+ printlog gMathFilter
+ gMathFilter = sFilterName
+
+ hNewDocument
+ SchreibenInMathdok "a over b"
+
+ FileSaveAs
+ Kontext "SpeichernDlg"
+
+ '/// check amount of available filters (6) ///'
+ x = Dateityp.GetItemCount
+ if x <> cFilterCount then warnlog " The Filter count is wrong! Have to be ("+cFilterCount+"), but are: "+x
+' Check: (1): Open Office Formula (.oof)
+' Check: (2): MathML 1.01 (.mml)
+' Check: (5): StarMath 5.0 (.smf)
+' Check: (6): StarOffice 6.0/7 Formula (.sxm)
+
+'/// check if any other then gMathFilter is password able; and if gMathFilter is password able ///'
+ for i = 1 to x
+ Dateityp.Select i
+ sleep (5)
+ sTemp = Dateityp.GetSelText
+ printlog " Check: (" + i + "/" + x +"): " +sTemp
+ if Passwort.isEnabled then
+ if NOT((instr(sTemp,gMathFilter) = 1)OR(instr(sTemp," (.sxm)") > 1)) then
+ if (4=i) then
+ warnlog "#i112895# (" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled"
+ else
+ warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled"
+ endif
+ endif
+ else
+ if (instr(sTemp,gMathFilter) = 1)OR(instr(sTemp," (.sxm)") > 1) then
+ warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Disabled"
+ endif
+ endif
+ next i
+
+ SpeichernDlg.Cancel
+ hCloseDocument
+endcase
+
+function TBOloadFormulaFromFile () as string
+'/// load an existing document: "input\\math\\101_1.sxm" ///
+'///+ take formula out of command window ///
+'///+ save it into a variable ///
+'/// close dokument ///
+ Call hFileOpen ( ConvertPath(gTesttoolPath + "math/optional/input/101_1.sxm") )
+ kontext "dokumentwriter"
+ try
+ EditSelectAllMath
+ EditCopy
+ TBOloadFormulaFromFile = GetClipboardText
+ catch
+ TBOloadFormulaFromFile = "gehtnicht"
+ endcatch
+' printlog "-----TBOloadFormulaFromFile: will return: '"+TBOloadFormulaFromFile+"'"
+ hCloseDocument
+end function
+
+testcase tFilePrint
+'/// I create a writer document and insert the object formula from the standard testfile: ///'
+'///+ There will be a graphic, how it should look like and the object///'
+'///+ AND there was the formula already inserted as object!///'
+'///+ in different languages...///'
+'/// Document is called: "input\\math\\101_2.sxw ///
+'///+ Image is available at: "input\\math\\101_2.gif///'
+
+ dim sFormula as string ' container for formula to create document with
+ dim sFileName as string
+ dim bChecked as boolean
+ dim sTemp as string
+ dim sTemp1 as string
+ dim bLanguage as boolean
+ dim bString as boolean
+ dim iLanguage as integer
+ dim sFoundLanguage as string
+ dim bError as boolean
+ dim iTimeOut as integer
+
+ printlog "- File Print"
+
+ bError = FALSE
+ sFormula = TBOloadFormulaFromFile()
+ if sFormula = "gehtnicht" then
+ qaErrorlog "can not make document writeable - exiting test"
+ goto endsub
+ endif
+
+ Call hFileOpen ( ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw") )
+ TBOmakeWriteable()
+
+ '/// find the translated formula in the document and get the language it belongs to ///'
+ '///+ compare it to the officelanguage ///'
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<mod1 home>"
+ bLanguage = hFindeImDokument("{"+ iSprache +"}")
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<mod1 home>"
+ hFindeImDokument ("\{"+ iSprache +"\}.*\{"+ iSprache +"\}", TRUE, TRUE)
+ try
+ editcopy
+ catch
+ printlog "editcopy failed."
+ setClipboard("")
+ endcatch
+ sFoundLanguage = GetClipboardText
+ If NOT bLanguage then
+ qaErrorLog "This Language (" + iSprache + ") is not supported in this test right now! Add the following string to the document: " +ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw")
+ else
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<left>"
+ if bError then
+ DocumentWriter.TypeKeys "<right>"
+ endif
+ DocumentWriter.TypeKeys "<shift left><shift left>"
+ editcopy
+ stemp = GetClipboardText
+ if (left(sTemp,1) = "{") then
+ ' language number is monadic
+ sTemp = right(sTemp,1)
+ endif
+ iLanguage = val(sTemp)
+ if (iSprache <> iLanguage) then
+ warnlog "hmm, smth is wrong :-(; found translated text for language: "+val(GetClipboardText) + ", but looked for: "+iSprache
+ endif
+ endif
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<mod1 home>"
+ bString = hFindeImDokument (sFormula)
+ If NOT bString then
+ if bLanguage then
+ warnlog "The translation changed! If It is a ProductPatch, then this is a bug; else update the document by calling TBO.:" +ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw")
+ endif
+ printlog sFormula
+ endif
+ sleep 1
+ try
+ editcopy
+ catch
+ If (bString AND bLanguage) then
+ warnlog "Edit-Copy failed."
+ endif
+ endcatch
+ printlog "found.......................... '"+GetClipboardText+"'"
+ printlog "looked for..................... '"+sFormula+"'"
+ printlog "found language............. '"+sFoundLanguage+"'"
+ if (GetClipboardText <> sFormula) then
+ If (bString AND bLanguage) then
+ warnlog "difference to reference!"
+ endif
+ else
+ printlog "FOUND entry for the language!: '"+ iLanguage +"'"
+ endif
+
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<mod1 home><down><down>"
+ DocumentWriter.TypeKeys gPCname + " " + iSprache + " " + gLanguage + " " + gPlatgroup + " " + gPlatform + "<return>"
+ '/// Insert the loaded and automatical 'translated' formulatext in writer as text ///'
+ hFindeImDokument ("TBO_INSERTED")
+ kontext "DocumentWriter"
+ DocumentWriter.TypeKeys sFormula
+ DocumentWriter.TypeKeys "<mod1 end>"
+
+ sleep (2)
+ '/// call: Insert->Object->Formula ///'
+ InsertObjectFormulaWriter
+ '/// write formula down ///'
+ SchreibenInMathdok (sFormula)
+ sleep 3
+ '/// exit formula object ///'
+ kontext "DokumentWriter" 'Commands'CommandsMath'DocumentMath don't work :-[
+ DokumentWriter.MouseDown 99,99
+ DokumentWriter.MouseUp 99,99
+ DokumentWriter.MouseDown 99,99
+ DokumentWriter.MouseUp 99,99
+
+ sFileName = convertpath( gOfficePath + "user/work/math/level1/ftc_a.odt")
+ if (FileExists(sFileName)) then
+ '/// goto end of page; insert page break ///'
+ kontext "DokumentWriter"
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 return>"
+ sleep 1
+ '/// insert frame ///'
+ try
+ InsertFrame
+ catch
+ printlog "Catched because of failed mouse action, try to leafe math in oposite corner"
+ kontext "DokumentWriter"
+ DokumentWriter.MouseDown 1,1 ' TBO: i don't like to do it this way,
+ DokumentWriter.MouseUp 1,1 ' but using .TypeKeys doesn't work
+ DokumentWriter.MouseDown 1,1 ' that way i expected in math via ole :-[
+ DokumentWriter.MouseUp 1,1
+ kontext "DokumentWriter"
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 end>"
+ sleep 1
+ DokumentWriter.typeKeys "<mod1 return>"
+ sleep 1
+ '/// insert frame ///'
+ InsertFrame
+ endcatch
+ sleep 1
+ Kontext
+ active.setPage TabType
+ kontext "TabType"
+ RelativeWidth.check
+ RelativeHeight.check
+ Width.setText "100"
+ Height.setText "98"
+ RelativeWidth.unCheck
+ RelativeHeight.unCheck
+ AutoHoehe.Check
+ TabType.OK
+ kontext "DokumentWriter"
+ sleep 1
+ DokumentWriter.typeKeys "<f2>"
+ sleep 1
+
+ '/// load file from testcase 'tToolsCatalog' to get a hardcopy ///'
+ InsertFileWriter
+ Kontext "GeneralFileDialog"
+ Dateiname.setText sFileName
+ Oeffnen.click
+ sleep 60
+
+ '/// do some nice formatting ///'
+ FormatColumns
+ Kontext "FormatColumn"
+ Columns.setText "2"
+ FormatColumn.TypeKeys "<tab>"
+ iTimeOut = 1
+ while ((NOT AutoWidth.isEnabled) AND (iTimeOut < 30))
+ sleep 1
+ printlog "Waiting for control to be enabled: (" + iTimeOut + "/30)"
+ iTimeOut = iTimeOut +1
+ Kontext "FormatColumn"
+ FormatColumn.TypeKeys "<tab>"
+ wend
+ Kontext "FormatColumn"
+ bChecked = AutoWidth.isChecked
+ AutoWidth.UnCheck
+ sTemp = Width1.getText
+ Width1.typeKeys("<PageDown>")
+ Width1.more
+ sTemp1 = Width1.getText
+ Width1.setText(sTemp)
+ if (bChecked) then
+ AutoWidth.UnCheck
+ endif
+ FormatColumn.OK
+
+ FormatParagraph
+ Kontext
+ active.setPage TabTabulator
+ kontext "TabTabulator"
+ Position.setText sTemp
+ Neu.click
+ Position.setText sTemp1
+ Neu.click
+ try
+ TabTabulator.OK
+ catch
+ warnlog "Timeout on closing "
+ iTimeOut = 1
+ while ((iTimeOut > 0) AND (iTimeOut < 30))
+ try
+ Kontext "DocumentWriter"
+ DocumentWriter.typeKeys "<right>"
+ iTimeOut = iTimeOut * (-1)
+ catch
+ sleep (10)
+ inc(iTimeOut)
+ endcatch
+ wend
+ printlog "Duration: " + (iTimeOut * 10)
+ endcatch
+ else
+ qaErrorLog "File doesn't exists: '" + sFileName + "'"
+ endif
+
+ '/// print file ///'
+ try
+ Fileprint
+ kontext
+ if active.exists(2) then
+ active.ok
+ qaerrorlog "There is no printer available - please install one on your system!"
+ Kontext "Printing"
+ if ( Printing.exists( 2 ) ) then
+ Printing.cancel
+ else
+ warnlog( "Printing dialog did not open" )
+ endif
+ else
+ Kontext "Printing"
+ if ( Printing.exists( 2 ) ) then
+ Printing.ok
+ else
+ warnlog( "Printing dialog did not open" )
+ endif
+ endif
+
+ kontext
+ if active.exists(2) then
+ active.ok
+ qaerrorlog "There is no printer available - please install one on your system!"
+ sleep 2
+ endif
+ catch
+ warnlog "FilePrint is not accessible, because closing Formula failed :-( ?!"
+ endcatch
+ hFileSaveAsWithFilterKill (convertpath( gOfficePath + "user/work/fileprint" + iSprache + ".odt"), "writer8")
+ Call hCloseDocument
+endcase
+
+
+function TBOmakeWriteable()
+ ' check if writeable! (especially for HTML Doks!!)
+ sleep (3)
+ try
+ UseBindings
+ FormatStyleBold
+ sleep 2
+ FormatStyleBold
+ catch
+ '/// make document writeable :-)///'
+ kontext "Funktionsleiste"
+ printlog "ReadOnly, changed it to writeable."
+ Bearbeiten.click
+ kontext
+ if active.exists (5) then
+ Printlog " active, accessrights ?!: '"+active.GetText+"'"
+ active.yes
+ endif
+ endcatch
+ sleep (3)
+end function
+
+function isCheckedWarnAlienFormat (optional bChange as boolean)
+ dim uno
+ dim ap
+ dim apara(1) As new com.sun.star.beans.PropertyValue
+ dim xViewRoot
+ dim temp()
+ dim bLocal as boolean
+ dim sFileFunction as string
+ dim i as integer
+
+ if isMissing(bChange) then
+ ' should work, else give soffice the commandline
+ try
+ uno=getUnoApp
+ catch
+ qaErrorLog (sFileFunction+"UNO-Port wasn't set on startup of office; will set it now again.")
+ uno=hGetUnoService()
+ endcatch
+ if (isNull(ap)) then
+ warnlog(sFileFunction+"Couldn't create Uno access")
+ ' think about switching to do it manual?
+ exit function
+ endif
+ ap=uno.createInstance("com.sun.star.configuration.ConfigurationProvider")
+ if (isNull(ap)) then
+ warnlog(sFileFunction+"Couldn't create Configuration access")
+ exit function
+ endif
+ apara(0).Name="nodepath"
+ apara(1).Name="lazywrite"
+ apara(1).Value=False
+ '() Tools->Options->Load/Save->General
+ '/org.openoffice.Office.Common/Save/Document WarnAlienFormat
+ apara(0).Value="/org.openoffice.Office.Common/Save/Document"
+ xViewRoot=ap.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPara())
+ bLocal = xViewRoot.getByName("WarnAlienFormat")
+ xViewRoot.dispose()
+ else
+ ToolsOptions
+ call hToolsOptions ("LoadSave", "General")
+ bLocal = WarnWhenSavingAlienFormat.isChecked
+ if bChange then
+ WarnWhenSavingAlienFormat.check
+ else
+ WarnWhenSavingAlienFormat.unCheck
+ endif
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ sleep 4
+ endif
+ isCheckedWarnAlienFormat = bLocal
+end function
+
+function hSpeichernUnterMitFilterKillTBO (sFileName as String, sFilterName, optional bAutoFileExtension as boolean) as boolean
+ Dim sDerName as string
+ Dim sDerText as string
+ Dim ApplicatStrg as string
+ Dim bFileSaved as boolean
+ Dim bAlienNotAllowed as boolean
+
+ sDerName = ConvertPath (sFileName)
+ if ( not hDeleteFile( sDerName ) ) then
+ warnlog( "Aborting function because the file could not be deleted: " & sDerName )
+ hSpeichernUnterMitFilterKillTBO() = FALSE
+ exit function
+ endif
+
+ sleep (1)
+ FileSaveAs
+ Kontext "SpeichernDlg"
+ if SpeichernDlg.Exists(2) then
+ DateiTyp.Select sFilterName
+ sleep (3)
+ DateiName.SetText sDerName
+ sleep (3)
+ 'Saving the document
+ Speichern.Click
+ sleep (1)
+
+ Kontext
+ if Active.Exists(2) then
+ if Active.GetRT = 304 then
+ sDerText = Active.GetText
+ warnlog sDerText
+ try
+ Active.OK
+ printlog "OK"
+ catch
+ active.yes
+ printlog "YES"
+ endcatch
+ Kontext "SpeichernDlg"
+ if SpeichernDlg.Exists(1) then
+ SpeichernDlg.Cancel
+ end if
+ bFileSaved = FALSE
+ end if
+ end if
+
+ else
+ warnlog "'Save'-dialog is not visible. Document has not been saved!"
+ end if
+end function
+
+
diff --git a/testautomation/math/optional/includes/m_105.inc b/testautomation/math/optional/includes/m_105.inc
new file mode 100644
index 000000000000..e7b97e705bab
--- /dev/null
+++ b/testautomation/math/optional/includes/m_105.inc
@@ -0,0 +1,690 @@
+'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 : thorsten.bosbach@oracle.com
+'*
+'* short description :
+'*
+'********************************************************************
+'*
+' #1 tToolsOptions
+' #1 tToolsConfigure
+' #1 tToolsCatalog
+' #1 tToolsCatalogNew
+'*
+'\******************************************************************
+
+sub m_105
+ printlog Chr(13) + "-- m_105 --"
+ Call tToolsOptions
+ Call tToolsConfigure
+' tToolsCatalog get's called in m_101_.inc to get it also printed there!
+ Call tToolsCatalogNew
+end sub
+
+testcase tToolsOptions
+ dim irgendwas(7) as boolean
+ dim sProzent as string
+ dim sTemp as string
+ dim i as integer
+ dim iItemCount as integer
+
+ '/// open application ///'
+ Call hNewDocument
+ '/// Tools->Options ///'
+ printlog ("'/// - save states ///")
+ ToolsOptions
+ sleep 1
+ hToolsOptions ("MATH", "SETTINGS")
+
+ irgendwas(1) = DruckeTitelzeile.IsChecked
+ irgendwas(2) = DruckeFormeltext.IsChecked
+ irgendwas(3) = DruckeRahmen.IsChecked
+ irgendwas(4) = Originalgroesse.IsChecked
+ irgendwas(5) = DerSeiteAnpassen.IsChecked
+ irgendwas(6) = Skalierung.IsChecked
+ irgendwas(7) = Ignorieren.IsChecked
+ if Skalierung.IsChecked then sProzent = Prozent.GetText
+
+ printlog ("'/// - all states inverting ///")
+
+ if irgendwas(1) Then DruckeTitelzeile.UnCheck Else DruckeTitelzeile.Check
+ if irgendwas(2) Then DruckeFormeltext.UnCheck Else DruckeFormeltext.Check
+ if irgendwas(3) Then DruckeRahmen.UnCheck Else DruckeRahmen.Check
+ if irgendwas(7) Then Ignorieren.UnCheck Else Ignorieren.Check
+
+ Skalierung.Check
+ Prozent.ToMax
+ sTemp = Prozent.GetText
+
+ Kontext "OptionenDlg"
+ OptionenDlg.OK
+
+ printlog ("'/// - SO quit - start ///")
+
+TBOrestart
+
+ printlog ("'/// - checking states ///")
+ ToolsOptions
+ hToolsOptions ("MATH", "SETTINGS")
+
+ If ( irgendwas(1) = DruckeTitelzeile.IsChecked ) Then WarnLog "DruckeTitelzeile state changed"
+ If ( irgendwas(2) = DruckeFormeltext.IsChecked ) Then WarnLog "DruckeFormeltext state changed"
+ If ( irgendwas(3) = DruckeRahmen.IsChecked ) Then WarnLog "DruckeRahmen state changed"
+ If ( irgendwas(7) = Ignorieren.IsChecked ) Then WarnLog "Ignorieren state changed"
+
+ If True <> Skalierung.IsChecked Then WarnLog "Skalierung state changed"
+ If sTemp <> Prozent.GetText Then WarnLog "Prozent state changed"
+
+ printlog ("'/// - all UnCheck -> o ///")
+
+ DruckeTitelzeile.UnCheck
+ DruckeFormeltext.UnCheck
+ DruckeRahmen.UnCheck
+ Ignorieren.UnCheck
+
+ Kontext "OptionenDlg"
+ OptionenDlg.OK
+
+ printlog ("'/// - check if all UnChecked ///")
+ ToolsOptions
+ hToolsOptions ("MATH", "SETTINGS")
+
+ If DruckeTitelzeile.IsChecked Then WarnLog "DruckeTitelzeil x"
+ If DruckeFormeltext.IsChecked Then WarnLog "DruckeFormeltext x"
+ If DruckeRahmen.IsChecked Then WarnLog "DruckeRahmen x"
+ If Ignorieren.IsChecked Then WarnLog "Ignorieren x"
+
+ If sTemp <> Prozent.GetText Then WarnLog "Prozent state changed"
+
+ Printlog ("'/// - all Check -> x ///")
+
+ DruckeTitelzeile.Check
+ DruckeFormeltext.Check
+ DruckeRahmen.Check
+ Ignorieren.Check
+
+ DerSeiteAnpassen.Check
+
+ Kontext "OptionenDlg"
+ OptionenDlg.OK
+
+ printlog ("'/// - check if all Checked ///")
+ '----- WorkAround i48383 Tools->Options run on wrong window; Target OOo later ---------
+ kontext "DocumentMath"
+ DocumentMath.mouseDown 10,10
+ DocumentMath.mouseUp 10,10
+ '-----------------------------------------------
+ ToolsOptions
+ hToolsOptions ("MATH", "SETTINGS")
+
+ try
+ If True <> DruckeTitelzeile.IsChecked Then WarnLog "DruckeTitelzeil o"
+ catch
+ Kontext "ExtrasOptionenDlg"
+ warnlog "Getting source of error... TBO: "
+ iItemCount = Optionsliste.getItemCount
+ for i = 1 to iItemCount
+ printlog "("+i+"/"+iItemCount+"): '"+ Optionsliste.getItemText(i)+ "'"
+ next i
+ Kontext "TabDruckenMath"
+ endcatch
+ If True <> DruckeFormeltext.IsChecked Then WarnLog "DruckeFormeltext o"
+ If True <> DruckeRahmen.IsChecked Then WarnLog "DruckeRahmen o"
+ If True <> Ignorieren.IsChecked Then WarnLog "Ignorieren o"
+
+ If True <> DerSeiteAnpassen.IsChecked Then WarnLog "DerSeiteAnpassen o"
+
+ printlog ("'/// - restore states ///")
+
+ If ( irgendwas(1) = TRUE ) Then DruckeTitelzeile.Check Else DruckeTitelzeile.UnCheck
+ If ( irgendwas(2) = TRUE ) Then DruckeFormeltext.Check Else DruckeFormeltext.UnCheck
+ If ( irgendwas(3) = TRUE ) Then DruckeRahmen.Check Else DruckeRahmen.UnCheck
+ If ( irgendwas(4) = TRUE ) Then Originalgroesse.Check
+ If ( irgendwas(5) = TRUE ) Then DerSeiteAnpassen.Check
+ If ( irgendwas(6) = TRUE ) Then Skalierung.Check
+ If ( irgendwas(7) = TRUE ) Then Ignorieren.Check Else Ignorieren.UnCheck
+
+ if Skalierung.IsChecked then Prozent.SetText (sProzent)
+
+ '/// close dialog 'Options' with OK ///'
+ Kontext "OptionenDlg"
+ OptionenDlg.OK
+ '/// close application ///'
+ Call hCloseDocument
+endcase
+
+sub TBOrestart
+ hCloseDocument
+ sleep (5)
+ ExitRestartTheOffice
+ sleep (10)
+ hNewDocument
+ sleep (5)
+end sub
+
+testcase tToolsConfigure
+ '/// idea from #108930 find double entries of keyboard-keys ///'
+ dim sKeys(600,2) as string
+ dim i,a,b as integer
+ dim sTemp, sTemp2 as string
+ dim iBugCount(2) as integer
+ dim c as integer
+
+ '/// open application ///'
+ Call hNewDocument
+ sleep 2
+ '/// Tools->Configure ///'
+ ToolsCustomize
+ sleep 3
+ Kontext
+ '/// switch to tabpage 'Keyboard' ///'
+ Messagebox.SetPage TabTastatur ' 2 ------------------
+ Kontext "TabTastatur"
+ '/// Check Checkbox 'StarOffice' ///'
+ StarOffice.Check
+ Printlog ("-------------------- Keylist for StarOpenOfficeSuite.org --------------------")
+ i = Tastatur.GetItemCount
+ sKeys(0,1) = i
+ sKeys(0,2) = i
+ for a = 1 to i
+ try
+ sKeys(a,1) = Tastatur.GetItemText(a,1)
+ c = 2
+ catch
+ sKeys(a,1) = Tastatur.GetItemText(a,2)
+ c = 3
+ endcatch
+ try
+ sKeys(a,2) = Tastatur.GetItemText(a,c)
+ catch
+ sKeys(a,2) = ""
+ iBugCount(1) = iBugCount(1) + 1
+ endcatch
+ printlog " " + a + " - '" + sKeys(a,1) + "' -- '" + sKeys(a,2) + "'"
+ next a
+ sortList(sKeys())
+ sTemp2 = sKeys(1,1)
+ for a = 1 to i
+ sTemp = Stemp2
+ sTemp2 = sKeys(a+1,1)
+ if (sTemp = sTemp2) then
+ qaErrorLog " " + a + ". This Key is double: '" + sTemp + "' - These Functions are assigned: '" + sKeys(a,2) + "' + '" + sKeys(a+1,2) + "'"
+ iBugCount(2) = iBugCount(2) + 1
+ endif
+ next a
+
+ '/// Check Checkbox 'Math' ///'
+ Application.Check
+ Printlog ("-------------------- Keylist for Formula ------------------------")
+ i = Tastatur.GetItemCount
+ sKeys(0,1) = i
+ sKeys(0,2) = i
+ for a = 1 to i
+ sKeys(a,1) = Tastatur.GetItemText(a,c-1)
+ try
+ sKeys(a,2) = Tastatur.GetItemText(a,c)
+ catch
+ sKeys(a,2) = ""
+ iBugCount(1) = iBugCount(1) + 1
+ endcatch
+ printlog " " + a + " - '" + sKeys(a,1) + "' -- '" + sKeys(a,2) + "'"
+ next a
+ sortList(sKeys())
+ sTemp2 = sKeys(1,1)
+ for a = 1 to i
+ sTemp = Stemp2
+ sTemp2 = sKeys(a+1,1)
+ if (sTemp = sTemp2) then
+ qaErrorLog " " + a + ". This Key is double: '" + sTemp + "' - These Functions are assigned: '" + sKeys(a,2) + "' + '" + sKeys(a+1,2) + "'"
+ iBugCount(2) = iBugCount(2) + 1
+ endif
+ next a
+ if (iBugCount(1) > 0) then warnlog "column-entry is empty -> testtool issue"
+ if (iBugCount(2) > 0) then qaErrorLog "key-names are double"
+ '/// cancel dialog 'Customize' ///'
+ TabTastatur.cancel
+ '/// close application ///'
+ Call hCloseDocument
+endcase
+
+sub sortList(lsList() as String)
+ '/// special variation of global routine, because this array is 2-dimensional ///'
+ Dim Listenanzahl as Integer, i as Integer, j as Integer
+ Dim Zwischenspeicher as String
+ Dim Zwischenspeicher2 as String
+
+ ListenAnzahl = Val(lsList(0,1))
+ for i=ListenAnzahl-1 to 1 step -1
+ for j=1 to i
+ if uCase ( lsList(j,1) ) > uCase ( lsList(j+1,1) ) then ' downward sorting
+ Zwischenspeicher = lsList (j,1) ' invert value (i) with value (i+1)
+ Zwischenspeicher2 = lsList (j,2) ' invert value (i) with value (i+1)
+ lsList (j,1) = lsList(j+1,1)
+ lsList (j,2) = lsList(j+1,2)
+ lsList (j+1,1) = Zwischenspeicher
+ lsList (j+1,2) = Zwischenspeicher2
+ end if
+ next j
+ next i
+end sub
+
+testcase tToolsCatalog
+' tToolsCatalog get's called in m_101_.inc to get it also printed there!
+ '/// idea from #111622 Crash on inserting 21. math ole-object ... ///'
+ dim i, j, x(10), y, z as integer
+ dim sTemp as string
+ dim iSymbolSets as integer
+ dim bChecked as boolean
+ dim sFileName as string
+ dim sAllSymbols as string
+ dim lAllSymbols(200) as string
+ dim lAllSymbolsSort(200) as string
+ dim iTimeOut as integer
+ dim sFilterName as string
+ dim sFilter as string
+ dim sFilterExt() as string
+ dim sNotAllowed() as string
+
+ '/// open Writer application ///'
+ gApplication = "WRITER"
+ Call hNewDocument
+ '/// Insert->Object->Formula ///'
+ InsertObjectFormulaWriter
+ Kontext "MATH"
+ '/// Tools->Catalog ///'
+ try
+ ToolsSymbolsCatalog
+ catch
+ warnlog "some slots in chart/math are not working."
+ call hCloseDocument
+ goto endsub
+ endcatch
+ Kontext "SymboleMath"
+ symbols.typekeys "<right><right>"
+ symbols.typekeys "<right><right>"
+ '/// click button "Edit..." ///'
+ Bearbeiten.Click
+ Kontext "EditSymbols"
+ symbols.typekeys "<right><right>"
+ symbols.typekeys "<right><right>"
+ '/// There are 2 Symbol sets: 1. 'Greek' with 54 entries and 2. 'Special' with 12 entries ///'
+ '///+ These symbol set names are availble in 2 listboxes 1. 'Old Symbol Set' and 2. 'Symbol Set' ///'
+ iSymbolSets = OldSymbolSet.GetItemCount
+ if (iSymbolSets <> 3) then
+ WarnLog "- OldSymbolSet: '" + iSymbolSets + "' is not 3; expected is 3. ('Special' and 'Greek' and 'iGreek')"
+ for i = 1 to iSymbolSets
+ qaErrorLog "- " + i + ": '" + OldSymbolSet.GetItemText(i) + "'"
+ next i
+ else
+ printlog "- OldSymbolSet: " + iSymbolSets
+ endif
+ OldSymbolSet.Select 1
+ SymbolSet.Select 1
+ x(1) = OldSymbol.GetItemCount
+ printlog "- 1: OldSymbol: " + x(1)
+ if (iSymbolSets <> SymbolSet.GetItemCount) then
+ WarnLog "Count is different; OldSymbolSet: '" + iSymbolSets + "'; SymbolSet: '" + SymbolSet.GetItemCount + "'"
+ endif
+ printlog "- 1: Symbol: " + Symbol.GetItemCount
+ printlog "- SymbolSet: " + SymbolSet.GetItemCount
+ OldSymbolSet.Select 2
+ SymbolSet.Select 2
+ x(2) = OldSymbol.GetItemCount
+ printlog "- 2: OldSymbol: " + x(2)
+ printlog "- 2: Symbol: " + Symbol.GetItemCount
+ printlog "- SymbolSet: " + SymbolSet.GetItemCount
+ '/// cancel dialog 'Edit Symbols' ///'
+ EditSymbols.Cancel
+ Kontext "SymboleMath"
+ '/// close dialog 'Symbols' ///'
+ SymboleMath.close
+ Kontext "DocumentWriter"
+ '///+ click into writer document to leave math ///'
+ DocumentWriter.mouseDown 1,1
+ DocumentWriter.mouseUp 1,1
+ '/// type key [delete] in writer document to delete (emtpy) math object ///'
+ DocumentWriter.typeKeys "<Delete>"
+ sleep 1
+ sAllSymbols = ""
+ lAllSymbols(0) = "0"
+ '/// for all symbol sets do... ///'
+ for i = 1 to iSymbolSets
+ '///+ insert for the count of symbols for each symbol set the symbol into the document ///'
+ for j = 1 to x(i)
+ printlog "(" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
+ try
+ '///+ Insert->Object->Formula ///'
+ InsertObjectFormulaWriter ' culprint after 20 calls :-( in #111622
+ catch
+ qaErrorLog "Can not leave object selection"
+ ' somehow not triggerable on macos
+ call hCloseDocument
+ goto endsub
+ endcatch
+ Kontext "DocumentMath"
+ '///+ Tools->Catalog ///'
+ ToolsSymbolsCatalog
+ Kontext "SymboleMath"
+ '///+ select the symbolset ///'
+ Symbolset.Select i
+ Kontext "SymboleMath"
+ '///+ type key [home] on dialog 'Symbols'///'
+ Symbols.TypeKeys "<Home>", true
+ Symbols.TypeKeys "<right><left>", true ' because <home> doesn't select the first item
+ '///+ type key [right] i++ times, to jump to next symbol///'
+ for y = 2 to j
+ Symbols.TypeKeys "<right>", true
+ next y
+ '///+ click button 'Insert' ///'
+ Uebernehmen.Click
+ sleep 1
+ '///+ close dialog 'Symbols' ///'
+ try
+ SymboleMath.close
+ catch
+ if ((2=i)AND(11=j))then
+ warnlog "#i42011# Expected: Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
+ else
+ warnlog "Not Expected! Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
+ endif
+ iTimeOut = 1
+ while ((iTimeOut > 0) AND (iTimeOut < 30))
+ try
+ Kontext "CommandsMath"
+ Commands.typeKeys "<mod1 a>"
+ iTimeOut = iTimeOut * (-1)
+ catch
+ sleep (10)
+ inc(iTimeOut)
+ endcatch
+ wend
+ printlog "Duration: " + (iTimeOut * 10)
+ endcatch
+ '///+ select text in 'Commands' window ///'
+ Kontext "CommandsMath"
+ Commands.typeKeys "<mod1 a>"
+ '/// Edit->Copy ///'
+ sleep 1
+ try
+ EditCopy
+ catch
+ commands.typekeys "<mod1 c>"
+ qaerrorlog "Workaround failed slot EditCopy with <Strg>+c:"+getClipboardText()
+ endcatch
+ sTemp = getClipboardText()
+ Kontext "DocumentWriter"
+ '///+ click into writer document to leave math ///'
+ DocumentWriter.mouseDown 1,1
+ DocumentWriter.mouseUp 1,1
+ '///+ click into writer document to diable selection of math object ///'
+ DocumentWriter.mouseDown 1,1
+ DocumentWriter.mouseUp 1,1
+ sleep 1
+ '///+ insert the copied text into the document ///'
+ DocumentWriter.typeKeys "<Mod1 End> - " + sTemp + ": " + j + "<Tab>"
+ sAllSymbols = sAllSymbols + sTemp
+ listAppend(lAllSymbols(), rTrim(sTemp))
+ next j
+ next i
+
+ if (listCount(lAllSymbols()) <> 106) then
+ warnlog "There have to be 106 Symbols, but there are: " + listCount(lAllSymbols())
+ endif
+ ' TODO: check sAllSymbols for not allowed characters!
+ listCopy(lAllSymbols(),lAllSymbolsSort())
+ listSort(lAllSymbolsSort())
+ sTemp = lAllSymbolsSort(1)
+ for i = 2 to listCount(lAllSymbolsSort())
+ if (sTemp = lAllSymbolsSort(i)) then
+ warnlog "There are Symbol names double: '" + sTemp + "'"
+ for j = 1 to listCount(lAllSymbols())
+ If (sTemp = lAllSymbols(j)) then
+ printlog "" + j + ": after: " + lAllSymbols(j-1)
+ endif
+ next j
+ endif
+ sTemp = lAllSymbolsSort(i)
+ next i
+ ' Check for not allowed characters in strings
+ sNotAllowed = array(" ","_","..")
+ for i = 1 to listCount(lAllSymbols())
+ for j = 0 to uBound(sNotAllowed())
+ if inStr(lAllSymbols(i), sNotAllowed(j)) > 0 then
+ warnlog "("+i+") Character '" + sNotAllowed(j) + "' is not allowed in string: '" + lAllSymbols(i) + "'"
+ endif
+ next j
+ next i
+ sFileName = convertpath( gOfficePath + "user/work/math/level1/ftc_a.odt")
+
+ hFileSaveAsWithFilterKill (sFileName, "writer8")
+ '/// close application ///'
+ Call hCloseDocument
+endcase
+
+testcase tToolsCatalogNew
+ dim i, j as integer
+ dim sTemp as string
+ dim iStartingSymbolSetCount as integer
+
+ Call hNewDocument
+'1
+ Kontext "MATH"
+ '/// Tools->Catalog ///'
+ try
+ ToolsSymbolsCatalog
+ catch
+ warnlog "some slots in chart/math are not working."
+ call hCloseDocument
+ goto endsub
+ endcatch
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ '/// click button "Edit..." ///'
+ Bearbeiten.Click
+ Kontext "EditSymbols"
+ if EditSymbols.exists then
+ iStartingSymbolSetCount = SymbolSet.getItemCount
+ if iStartingSymbolSetCount <> 3 then
+ qaErrorLog "There are already other symbolsets, instead of 3: " + iStartingSymbolSetCount
+ for i = 1 to iStartingSymbolSetCount
+ printlog "("+i+"/"+iStartingSymbolSetCount+"): '" + SymbolSet.getItemText (i) + "'"
+ next i
+ else
+ printlog "Entry condition met; 2 symbolsets only available"
+ endif
+ '/// type 'TBOnewSymbolSet' into the combobox 'Symbol set' ///'
+ SymbolSet.setText "TBOnewSymbolSet"
+ '/// press buton 'Modify' to add the new Symbolset ///'
+ modify.click
+ EditSymbols.ok
+ else
+ warnlog "not there"
+ endif
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ sleep 1
+ '/// select the new symbol set ///'
+ try
+ Symbolset.select "TBOnewSymbolSet"
+ catch
+ j=Symbolset.getItemCount
+ warnLog "New symbolset not created: " + "TBOnewSymbolSet"
+ for i = 1 to j
+ printlog "("+i+"/"+j+"): '" + SymbolSet.getItemText (i) + "'"
+ next i
+ endcatch
+ '/// close dialog 'Symbols' ///'
+ SymboleMath.close
+ else
+ warnlog "no dialog"
+ endif
+ endif
+ '/// exit and restart OOo ///'
+ exitRestartTheOffice
+'2
+ Call hNewDocument
+ Kontext "MATH"
+ '/// Tools->Catalog ///'
+ try
+ ToolsSymbolsCatalog
+ catch
+ warnlog "some slots in chart/math are not working."
+ call hCloseDocument
+ goto endsub
+ endcatch
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ '/// click button "Edit..." ///'
+ Bearbeiten.Click
+ Kontext "EditSymbols"
+ if EditSymbols.exists then
+ i = SymbolSet.getItemCount
+ if (iStartingSymbolSetCount +1) <> i then
+ WarnLog "the new symbolset is not available after restart: " + i + "; should be: " + (iStartingSymbolSetCount +1)
+ endif
+ try
+ SymbolSet.select "TBOnewSymbolSet"
+ catch
+ qaerrorlog "#i64504# Symbol set name is not saved on exiting OOo"
+ SymbolSet.select ""
+ endcatch
+ SymbolSet.setText "TBOnewSymbolSet"
+ Symbol.setText "ALPHANEWTBO"
+ try
+ add.click
+ catch
+ qaerrorlog "no add"
+ endcatch
+ EditSymbols.ok
+ endif
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ sleep 1
+ '/// select the new symbol set ///'
+ Symbolset.select "TBOnewSymbolSet"
+ '/// close dialog 'Symbols' ///'
+ SymboleMath.close
+ else
+ warnlog "no dialog"
+ endif
+ endif
+ '/// exit and restart OOo ///'
+ exitRestartTheOffice
+'3
+ Call hNewDocument
+ Kontext "MATH"
+ '/// Tools->Catalog ///'
+ try
+ ToolsSymbolsCatalog
+ catch
+ warnlog "some slots in chart/math are not working."
+ call hCloseDocument
+ goto endsub
+ endcatch
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ symbolset.select "TBOnewSymbolSet"
+ '/// click button "Edit..." ///'
+ Bearbeiten.Click
+ Kontext "EditSymbols"
+ if EditSymbols.exists then
+ i = SymbolSet.getItemCount
+ 'if (iStartingSymbolSetCount +1) <> i then
+ 'WarnLog "the new symbolset is not available after restart: " + i + "; should be: " + (iStartingSymbolSetCount +1)
+ 'endif
+ try
+ SymbolSet.select "TBOnewSymbolSet"
+ catch
+ warnlog "Symbol set name is not saved on exiting OOo"
+ SymbolSet.select ""
+ endcatch
+ i = Symbol.getItemCount
+ if i < 2 then
+ warnlog "Symbol not available in new Symbolset: intsead of 1: " + i
+ endif
+ SymbolSet.setText "TBOnewSymbolSetdelete"
+ delete.click
+ EditSymbols.ok
+ endif
+ Kontext "SymboleMath"
+ if SymboleMath.exists then
+ 'cleanup
+ for i = 1 to symbolset.getItemCount
+ sTemp = symbolset.getItemText(i)
+ 'if sTemp = "" then
+ 'warnlog "Empty name"
+ 'endif
+ printlog ""+i+": '"+sTemp+"'"
+ next i
+ try
+ symbolset.select "TBOnewSymbolSet"
+ printlog "found: TBOnewSymbolSet"
+ catch
+ try
+ symbolset.select ""
+ printlog "found: "
+ catch
+ qaerrorlog "not expected"
+ endcatch
+ endcatch
+ '/// click button "Edit..." ///'
+ Bearbeiten.Click
+ Kontext "EditSymbols"
+ if EditSymbols.exists then
+ try
+ SymbolSet.select "TBOnewSymbolSet"
+ catch
+ try
+ symbolset.select ""
+ printlog "found: "
+ catch
+ qaerrorlog "not expected"
+ endcatch
+ endcatch
+ SymbolSet.setText "TBOnewSymbolSetdelete"
+ delete.click
+ EditSymbols.ok
+ endif
+ endif
+ Kontext "SymboleMath"
+ j = symbolset.getItemCount
+ if j <> 3 then
+ warnlog "There is a number != 3 of symbollists listed"
+ else
+ printlog "Everything is cleaned up."
+ endif
+ for i = 1 to j
+ printlog ""+i+": '"+symbolset.getitemtext(i)+"'"
+ next i
+ '/// close dialog 'Symbols' ///'
+ SymboleMath.close
+ endif
+ '/// close application ///'
+ Call hCloseDocument
+endcase
+
diff --git a/testautomation/math/optional/includes/m_106_.inc b/testautomation/math/optional/includes/m_106_.inc
new file mode 100755
index 000000000000..6136ebfdeb9f
--- /dev/null
+++ b/testautomation/math/optional/includes/m_106_.inc
@@ -0,0 +1,65 @@
+'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 : thorsten.bosbach@oracle.com
+'*
+'* short description :
+'*
+'\******************************************************************
+
+sub M_106_
+ printlog Chr(13) + "-- Tools-Menue --"
+ Call tExtrasFormelImportieren
+end sub
+
+testcase tExtrasFormelImportieren
+ dim i,x as integer
+
+'/// check if formula is loaded in same window ///'
+
+ Call hNewDocument
+
+ '/// check amount of available filters (6) (inc. one seperator) ///'
+ ToolsImportFormula
+ Kontext "OeffnenDlg"
+ x = Dateityp.GetItemCount
+ if x <> cFilterCountLoad then warnlog " The Filter count is wrong! Have to be ("+cFilterCountLoad+"), but are: "+x
+ printlog "------------- this is the filter list: ------------"
+ for i = 1 to x
+ try
+ Printlog " "+i+": " + Dateityp.GetItemText (i)
+ catch
+ printlog "fail ------------"
+ endcatch
+ next i
+ OeffnenDlg.Cancel
+ Sleep 2
+
+ Call hCloseDocument
+endcase
+
+
diff --git a/testautomation/math/optional/input/101_1.sxm b/testautomation/math/optional/input/101_1.sxm
new file mode 100755
index 000000000000..e2190231b905
--- /dev/null
+++ b/testautomation/math/optional/input/101_1.sxm
Binary files differ
diff --git a/testautomation/math/optional/input/101_2.sxw b/testautomation/math/optional/input/101_2.sxw
new file mode 100755
index 000000000000..6304c131c2f8
--- /dev/null
+++ b/testautomation/math/optional/input/101_2.sxw
Binary files differ
diff --git a/testautomation/math/optional/input/filter/math.sxw b/testautomation/math/optional/input/filter/math.sxw
new file mode 100755
index 000000000000..c9f514a4e20e
--- /dev/null
+++ b/testautomation/math/optional/input/filter/math.sxw
Binary files differ
diff --git a/testautomation/math/optional/input/filter/precal_test.doc b/testautomation/math/optional/input/filter/precal_test.doc
new file mode 100755
index 000000000000..c10c4014a4c7
--- /dev/null
+++ b/testautomation/math/optional/input/filter/precal_test.doc
Binary files differ
diff --git a/testautomation/math/optional/input/filter/quantum_field.doc b/testautomation/math/optional/input/filter/quantum_field.doc
new file mode 100755
index 000000000000..cccc8b038947
--- /dev/null
+++ b/testautomation/math/optional/input/filter/quantum_field.doc
Binary files differ
diff --git a/testautomation/math/optional/input/filter/seventh_grade.doc b/testautomation/math/optional/input/filter/seventh_grade.doc
new file mode 100755
index 000000000000..5ffe187b51fd
--- /dev/null
+++ b/testautomation/math/optional/input/filter/seventh_grade.doc
Binary files differ
diff --git a/testautomation/math/optional/m_lvl1.bas b/testautomation/math/optional/m_lvl1.bas
new file mode 100755
index 000000000000..95815c34f89e
--- /dev/null
+++ b/testautomation/math/optional/m_lvl1.bas
@@ -0,0 +1,60 @@
+'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 : thorsten.bosbach@oracle.com
+'*
+'* short description : Math Function Test
+'*
+'\******************************************************************
+
+global cFilterCountLoad as integer
+
+sub main
+ use "math\optional\includes\m_101_.inc"
+ use "math\optional\includes\m_105.inc"
+ use "math\optional\includes\m_106_.inc"
+
+ printlog Chr(13) + "******* Math - Function - Test ******* "
+
+ cFilterCountLoad = 7
+
+ Call hStatusIn ( "Math","m_lvl1.bas" )
+
+ Call m_101_ 'Filemenue
+ Call m_105 'Options
+ Call m_106_ 'Tools Menue
+
+ Call hStatusOut
+end sub
+
+sub LoadIncludeFiles
+ use "global\system\includes\master.inc"
+ use "global\system\includes\gvariabl.inc"
+ use "global\tools\includes\optional\t_ui_filters.inc"
+ Call GetUseFiles
+ gApplication = "MATH"
+end sub