Commits

Anonymous committed 08bdc56

smoketest26: #i112616# generate smoketestdoc.sxw

  • Participants
  • Parent commits c58d998

Comments (0)

Files changed (19)

File smoketestoo_native/data/Events.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Events" script:language="StarBasic">REM  *****  BASIC  *****
+
+Sub InitEvents
+	call ClickCutTest
+End Sub
+
+Sub ClickSaveTest
+	if not OptionsDlg.cbSaveTest.Value then
+		OptionsDlg.cbOpenTest.Value = false
+		OptionsDlg.cbOpenTest.Enabled = false
+	else	
+		OptionsDlg.cbOpenTest.Enabled = true
+	end If
+End Sub
+
+Sub ClickCutTest
+	if not OptionsDlg.cbCutTest.Value then
+		OptionsDlg.cbPasteTest.Value = false
+		OptionsDlg.cbPasteTest.Enabled = false
+	else	
+		OptionsDlg.cbPasteTest.Enabled = true
+	end If
+End Sub
+
+Sub PressCancel
+	gDlgState = cDlgCancel
+end Sub
+
+Sub PressOk
+	gDlgState = cDlgOk
+end Sub
+
+Sub PressTest
+	gOptionsDialog.EndExecute()
+	gDlgState = cDlgStartTest
+end Sub
+</script:module>

File smoketestoo_native/data/Global.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Global" script:language="StarBasic">REM  *****  BASIC  *****
+
+const cMaxErrorStates = 13
+
+const cCoGreen = 4057917, cCoRed = 16711680, cCoGrey = 12632256
+const cParagraphBreak = 0
+
+global const cExtensionFileName = &quot;TestExtension.oxt&quot;
+
+global const cDocNew = 0, cDocCut = 1, cDocPaste = 2, cDocSaveOpen8 = 3, cDocSaveOpenXML = 4, cDocSaveOpen50 = 5, cDocClose = 6, cDocWrite = 7
+global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5
+global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2
+global const cLogfileFailed = 255
+
+global const cStWriter = 0, cStCalc = 1, cStPraesentation = 2, cStZeichnen = 3
+global const cStMessage = 12, cStHTML = 6, cStChart = 4, cStJava = 7
+global const cStMath = 5, cStDataBase = 9
+global const cStExtension = 11
+global const cStNone = -1
+
+global const cFlt8 = 0, cFlt50 = 32, cFltNewDoc = 64, cFltXML = 128
+
+global const frmWriter = 1, frmCalc = 2, frmMessage = 3, frmImpress = 4
+global const frmMath = 5, frmImage = 6, frmChart = 7, frmHyperText = 8, frmDraw = 9
+global const frmDataBase = 10, frmJava = 13
+global const frmExtension = 14
+
+global const cLogUnknown = 0, cLogFalse = 1, cLogTrue = 2
+
+&apos;UserFieldKennungen
+Global const cYes = &quot;y&quot;, cNo = &quot;n&quot;
+Global const cStateNo = 0, cStateYes = 1
+
+&apos;Feldtypen
+Global const cFtExtUser = 21, cFtPageNum = 5, cFtStatistic = 8, cFtDateTime = 27, cFtDatabase = 31
+
+&apos;UnoStrings
+Global const cUnoSeparator = &quot;.&quot;
+Global const cUnoPrefix = &quot;com.sun.star.&quot;
+Global const cUnoUserField = cUnoPrefix + &quot;text.FieldMaster.User&quot;
+Global const cUnoExtUserField = cUnoPrefix + &quot;text.TextField.ExtendedUser&quot;
+Global const cUnoMasterDataBase = cUnoPrefix + &quot;text.FieldMaster.Database&quot;
+Global const cUnoDataBase = cUnoPrefix + &quot;text.TextField.Database&quot;
+Global const cUnoDateTime = cUnoPrefix + &quot;text.TextField.DateTime&quot;
+Global const cUnoTextGraphi2 = cUnoPrefix + &quot;text.Graphic&quot;
+Global const cUnoJavaLoader = cUnoPrefix + &quot;loader.Java&quot;
+Global const cUnoDatabaseContext = cUnoPrefix + &quot;sdb.DatabaseContext&quot;
+Global const cUnoRowSet = cUnoPrefix + &quot;sdb.RowSet&quot;
+Global const cUnoSmoketestTestExtension = cUnoPrefix + &quot;comp.smoketest.TestExtension&quot;
+Global const cUnoSmoketestCommandEnvironment = cUnoPrefix + &quot;deployment.test.SmoketestCommandEnvironment&quot;
+Global const cUnothePackageManagerFactory = cUnoPrefix + &quot;deployment.thePackageManagerFactory&quot;
+
+&apos;UserFieldNames
+Global const cUserFieldTestWriter = &quot;Writer&quot;, cUserFieldTestCalc = &quot;Calc&quot;, cUserFieldTestImpress = &quot;Impress&quot;
+Global const cUserFieldTestDraw = &quot;Draw&quot;, cUserFieldTestMath = &quot;Math&quot;, cUserFieldTestChart = &quot;Chart&quot;
+Global const cUserFieldTestHTML = &quot;HTML&quot;, cUserFieldTestJava = &quot;Java&quot;, cUserFieldTestDatabase = &quot;Database&quot;
+Global const cUserFieldTestExtension = &quot;Extension&quot;
+Global const cUserFieldTestOpenSaveXML = &quot;SaveOpenXML&quot;, cUserFieldTestOpenSave50 = &quot;SaveOpen50&quot;, cUserFieldTestCut = &quot;Cut&quot;
+Global const cUserFieldTestPaste = &quot;Paste&quot;, cUserFieldTestTerminateAfterTest = &quot;Terminate&quot;, cUserFieldTestOpenSave8 = &quot;SaveOpen8&quot;
+
+Global const cOptionsDialogName = &quot;OptionsDlg&quot;, cTest10Modul = &quot;Standard&quot;
+
+Global const cDlgCancel = 1, cDlgOk = 0, cDlgStartTest = 2
+
+global gErrorState (cMaxErrorStates, 5) as integer
+
+global gOutputDoc as Object
+global gOutputDocNotUno as Object
+global gOptionsDialog as Object
+
+Global bMakeWriterTest as boolean, bMakeCalcTest as  boolean, bMakeImpressTest as boolean
+Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean
+Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean
+Global bMakeExtensionTest as boolean
+Global bMakeSaveOpenXMLTest as boolean, bMakeSaveOpen50Test as boolean, bMakeCutTest as boolean
+Global bMakePasteTest as boolean, bMakeTerminateAfterTest as boolean, bShowTable as boolean
+Global bMakeSaveOpen8Test as boolean
+
+global sExtensionURL as string
+
+Dim gDlgState as Integer
+
+Sub SetGlobalDoc
+	gOutPutDoc = ThisComponent
+end Sub
+
+Sub ClearStatus
+	for j% = 0 to cMaxErrorStates
+		for i% = 0 to 5
+		   	gErrorState (j%, i%) = cLogUnknown
+		next i%
+	next j%
+end Sub
+
+Sub ClearAllText
+	call SetGlobalDoc
+	call ClearDoc (gOutPutDoc)
+	call ClearStatus
+end Sub
+
+Sub Main
+	call SetGlobalDoc
+	if bShowTable then
+		call ClearDoc (gOutPutDoc)
+	end If
+		
+	call ClearStatus
+	
+	Call Test_10er.Main
+		
+	if bShowTable then
+		call CreateStatusTable2
+		call CreateStatusTable
+		call CreateDocState
+		call CreateSecondState
+		gOutputDoc.CurrentController.ViewCursor.JumpToFirstPage
+	end if
+End Sub
+
+Sub CreateStatusTable
+	dim tableHeaders(7) as string
+	tableHeaders(cStWriter) = &quot;Writer&quot;
+	tableHeaders(cStCalc) = &quot;Calc&quot;
+	tableHeaders(cStPraesentation) = &quot;Präsen- tation&quot;
+	tableHeaders(cStZeichnen) = &quot;Zeichn.&quot;
+	tableHeaders(cStChart) = &quot;Diagr.&quot;
+	tableHeaders(cStMath) = &quot;Math&quot;
+	tableHeaders(cStHTML) = &quot;HTML&quot;
+	tableHeaders(cStJava) = &quot;Java&quot;
+	
+	dim tableColums(5) as string
+	tableColums(cDocNew) = &quot;new&quot;
+	tableColums(cDocCut) = &quot;cut&quot;
+	tableColums(cDocPaste) = &quot;paste&quot;
+	tableColums(cDocSaveOpen8) = &quot;V8.0&quot;
+	tableColums(cDocSaveOpenXML) = &quot;XML&quot;
+	tableColums(cDocSaveOpen50) = &quot;V5.0&quot;
+&apos;	tableColums(cDocClose) = &quot;close&quot;
+	
+	aDoc = gOutPutDoc
+	
+	xText = aDoc.Text
+	xCursor = xText.createTextCursor()
+	
+&apos;	xCursor.gotoStart(FALSE)
+&apos;	xCursor.GoRight (2, False)
+&apos;	SetParagraphBreak (xCursor)
+&apos;	SetParagraphBreak (xCursor)
+	xCursor.gotoStart(FALSE)
+	xCursor.GoRight (4, False)
+	SetParagraphBreak (xCursor)
+	xCursor.GoRight (1, False)
+	SetParagraphBreak (xCursor)
+	xCursor.GoRight (1, False)
+	
+	table = aDoc.createInstance(&quot;com.sun.star.text.TextTable&quot;)
+	table.initialize(7,9)
+	table.Name = &quot;StTab1&quot;
+	xText.insertTextContent(xCursor, table, FALSE)
+	
+	tableCursor = table.createCursorByCellName(table.CellNames(0))
+	tableCursor.gotoStart(FALSE)
+	tableCursor.goRight(1,FALSE)
+	
+	for i% = 0 to 7
+	  cName = tableCursor.getRangeName()
+	  xCell = table.getCellByName(cName)
+	  xCell.String=tableHeaders(i%)
+	  
+	  xCell.BackTransparent = False
+	  xCell.BackColor = cCoGrey
+	  	   
+	  tableCursor.goRight(1,FALSE)
+	next i%
+	
+	xCursor.gotoStart(FALSE)
+&apos;	SetParagraphBreak (xCursor)
+&apos;	SetParagraphBreak (xCursor)
+		
+	tableCursor.gotoStart(FALSE)	
+	cName = tableCursor.getRangeName()
+  	xCell = table.getCellByName(cName)
+  	xCell.BackTransparent = False
+  	xCell.BackColor = cCoGrey
+  	
+	for i% = 0 to 5
+		tableCursor.goDown(1,FALSE)
+	 	cName = tableCursor.getRangeName()
+	  	xCell = table.getCellByName(cName)
+	  	xCell.String=tableColums(i%)
+	  	
+	  	xCell.BackTransparent = False
+	  	xCell.BackColor = cCoGrey
+	next i%
+end Sub
+
+Sub CreateStatusTable2
+	dim tableHeaders(5) as string
+	tableHeaders(cStDataBase-9) = &quot;Database&quot;
+	tableHeaders(1) = &quot;&quot;
+	tableHeaders(cStExtension-9) = &quot;Extension&quot;
+	tableHeaders(3) = &quot;&quot;
+	tableHeaders(4) = &quot;&quot;
+	
+	dim tableColums(5) as string
+	tableColums(cDBService ) = &quot;services&quot;
+	tableColums(cDBOpen ) = &quot;open&quot;
+	tableColums(cDBInsert ) = &quot;insert&quot;
+	tableColums(cDBDelete  ) = &quot;delete&quot;
+	tableColums(cDBSeek ) = &quot;seek&quot;
+	tableColums(cDBClose ) = &quot;close&quot;
+	
+	dim tableColums2(3) as string
+	tableColums2(cEXTService ) = &quot;services&quot;
+	tableColums2(cEXTInstall ) = &quot;install&quot;
+	tableColums2(cEXTUninstall ) = &quot;uninstall&quot;
+	
+	aDoc = gOutPutDoc
+	
+	xText = aDoc.Text
+	xCursor = xText.createTextCursor()
+	
+	xCursor.gotoStart(FALSE)
+	xCursor.GoRight (4, False)
+	SetParagraphBreak (xCursor)
+	SetParagraphBreak (xCursor)
+	xCursor.gotoEnd(FALSE)
+	
+	table = aDoc.createInstance(&quot;com.sun.star.text.TextTable&quot;)
+	table.initialize(7,6)
+	table.Name = &quot;StTab2&quot;
+	&apos;table.RelativeWidth =500
+	
+	xText.insertTextContent(xCursor, table, FALSE)
+	
+	tableCursor = table.createCursorByCellName(table.CellNames(0))
+	tableCursor.gotoStart(FALSE)
+	tableCursor.goRight(1,FALSE)
+	
+	for i% = 0 to 5
+	  cName = tableCursor.getRangeName()
+	  xCell = table.getCellByName(cName)
+	  xCell.String=tableHeaders(i%)
+	  
+	  xCell.BackTransparent = False
+	  xCell.BackColor = cCoGrey
+	  	   
+	  tableCursor.goRight(1,FALSE)
+	next i%
+	
+	tableCursor.gotoStart(FALSE)
+	
+	cName = tableCursor.getRangeName()
+  	xCell = table.getCellByName(cName)
+  	xCell.BackTransparent = False
+  	xCell.BackColor = cCoGrey
+
+	for i% = 0 to 5
+		tableCursor.goDown(1,FALSE)
+	 	cName = tableCursor.getRangeName()
+	  	xCell = table.getCellByName(cName)
+	  	xCell.String=tableColums(i%)
+	  	
+	  	xCell.BackTransparent = False
+	  	xCell.BackColor = cCoGrey
+	next i%
+	
+	tableCursor.gotoStart(FALSE)
+    tableCursor.goRight(2,FALSE)
+	
+	for i% = 0 to 3
+		tableCursor.goDown(1,FALSE)
+	 	cName = tableCursor.getRangeName()
+	  	xCell = table.getCellByName(cName)
+	  	xCell.String=tableColums2(i%)
+	  	
+	  	xCell.BackTransparent = False
+	  	xCell.BackColor = cCoGrey
+	next i%
+end Sub
+
+
+Sub CreateDocState
+	aDoc = gOutPutDoc
+	table = aDoc.TextTables.GetByIndex (1)
+	&apos;table = aDoc.TextTables.GetByName (&quot;StTab1&quot;)
+	
+	for j% = 0 to 7
+		for i% = 0 to 5
+			sRangeName = GetRangeName(j%, i%+1)
+			
+			tableCursor = table.createCursorByCellName(sRangeName)
+			
+	 		cName = tableCursor.getRangeName()
+		  	xCell = table.getCellByName(cName)
+	  			  	
+		  	xCell.BackTransparent = False
+		  	
+		   	if gErrorState (j%, i%) = cLogTrue then
+		  			xCell.BackColor = cCoGreen
+		  	else if gErrorState (j%, i%) = cLogFalse then
+		  			xCell.BackColor = cCoRed
+		  	else
+		  		xCell.BackColor = cCoGrey	
+		  	end If	
+	  		end If
+	  		
+		next i%
+	next j%
+end Sub
+
+Sub CreateSecondState
+	aDoc = gOutPutDoc
+	table = aDoc.TextTables.GetByIndex (0)
+	&apos;table = aDoc.TextTables.GetByName (&quot;StTab2&quot;)
+	
+	for j% = 0 to cMaxErrorStates-9
+		for i% = 0 to 5
+			sRangeName = GetRangeName(j%, i%+1)
+			
+			tableCursor = table.createCursorByCellName(sRangeName)
+			
+	 		cName = tableCursor.getRangeName()
+		  	xCell = table.getCellByName(cName)
+	  			  	
+		  	xCell.BackTransparent = False
+		  	
+		   	if gErrorState (j%+9, i%) = cLogTrue then
+		  			xCell.BackColor = cCoGreen
+		  	else if gErrorState (j%+9, i%) = cLogFalse then
+		  			xCell.BackColor = cCoRed
+		  	else
+		  		xCell.BackColor = cCoGrey	
+		  	end If	
+	  		end If
+	  		
+		next i%
+	next j%
+end Sub
+
+Function GetRangeName (nColumn as integer, nRow as integer) as string
+	GetRangeName = chr (nColumn+66) + Trim(Str(nRow+1))
+end Function
+
+Sub SetStatus (nDocType as Integer, nAction as Integer, bState as Boolean)
+	Dim nStatusType as Integer
+	Dim nState as integer
+	nStatusType = GetStatusType (nDocType)
+	If nStatusType = cStNone then Exit Sub
+	
+	if bState then 
+		nState = cLogTrue
+	else
+		nState = cLogFalse
+	end If
+	
+	gErrorState (nStatusType, nAction) = nState
+end Sub
+
+Function GetStatusType (nDocType as Integer) as Integer
+	Select Case ( nDocType )
+		case frmWriter 
+			GetStatusType = cStWriter &apos; Textdokument 
+		case frmCalc
+			GetStatusType = cStCalc &apos;Tabellendokument 
+		case frmMessage
+			GetStatusType = cStMessage &apos;Nachricht 
+		case frmImpress
+			GetStatusType = cStPraesentation &apos;Präsentation 
+		case frmDraw
+			GetStatusType = cStZeichnen &apos;Zeichnen
+		case frmMath
+			GetStatusType = cStMath &apos;Formel 
+		case frmImage
+			GetStatusType = cStBild &apos;Bild 
+		case frmHyperText
+			GetStatusType = cStHTML &apos;Hypertext-Dokument 
+		case frmChart
+			GetStatusType = cStChart &apos;Diagramm 
+		case frmJava
+			GetStatusType = cStJava &apos;Java
+		case frmDataBase
+			GetStatusType = cStDataBase	&apos;DataBase
+		case frmExtension
+			GetStatusType = cStExtension &apos;Extension
+		case else
+			GetStatusType = cStNone
+	end Select		
+end Function
+
+Sub SetParagraphBreak (aCursor as Object)
+	aCursor.Text.InsertControlCharacter (aCursor, cParagraphBreak, True)
+end Sub
+
+Sub ClearDoc (aDoc as Object)
+	Dim aText as Object
+	Dim i%
+	for i%=1 to aDoc.TextTables.count
+		aDoc.TextTables.GetByIndex(0).dispose
+	next
+
+	aText = aDoc.Text.CreateTextCursor
+	aText.GotoStart (False)
+	aText.GoRight (3, False)
+	SetParagraphBreak (aText)
+	aText.GotoEnd (True)
+	aText.String=&quot;&quot;
+end Sub
+
+Sub ClearDocFull (aDoc as Object)
+	Dim aText as Object
+	Dim i%
+	for i%=1 to aDoc.TextTables.count
+		aDoc.TextTables.GetByIndex(0).dispose
+	next
+
+	aText = aDoc.Text.CreateTextCursor
+	aText.GotoStart (False)
+	aText.GotoEnd (True)
+	aText.String=&quot;&quot;
+end Sub
+
+Sub SetGlobalOptionsDialog ()
+
+    Dim oLibContainer As Object, oLib As Object
+    Dim oInputStreamProvider As Object
+    Dim oDialog As Object
+
+    Const sLibName = cTest10Modul
+    Const sDialogName = cOptionsDialogName
+    
+    REM get library and input stream provider
+    oLibContainer = DialogLibraries
+    
+    REM load the library
+    oLibContainer.loadLibrary( sLibName )
+    
+    oLib = oLibContainer.getByName( sLibName )
+    oInputStreamProvider = oLib.getByName( sDialogName )
+
+    REM create dialog control
+    gOptionsDialog = CreateUnoDialog( oInputStreamProvider )
+
+end Sub
+
+Sub ShowOptionsDlg
+
+    call SetGlobalDoc
+    call SetGlobalOptionsDialog
+    call GetOptions
+
+    REM show the dialog
+    gOptionsDialog.execute()
+    
+   	&apos; jetzt läuft der Dialog, bis ein Button gedrückt wird
+   	
+   	Select Case (gDlgState)
+   		case cDlgOk
+   			call SetOptions ()
+   		case cDlgStartTest
+   			call SetOptions ()
+   			call StartTestByOptions ()
+	end Select
+   	
+    gOptionsDialog.dispose()
+
+end Sub
+
+Sub SetOptions
+	call SetGlobalDoc
+	SetUserFieldState (cUserFieldTestWriter, -(gOptionsDialog.getControl(&quot;cbWriterTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestCalc, -(gOptionsDialog.getControl(&quot;cbCalcTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestImpress, -(gOptionsDialog.getControl(&quot;cbImpressTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestDraw, -(gOptionsDialog.getControl(&quot;cbDrawTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestHTML, -(gOptionsDialog.getControl(&quot;cbHTMLTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestMath, -(gOptionsDialog.getControl(&quot;cbMathTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestChart, -(gOptionsDialog.getControl(&quot;cbChartTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl(&quot;cbJavaTest&quot;).getState), gOutPutDoc)	
+	SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl(&quot;cbDatabaseTest&quot;).getState), gOutPutDoc)	
+	SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl(&quot;cbExtensionTest&quot;).getState), gOutPutDoc)	
+	SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestOpenSave50, -(gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestCut, -(gOptionsDialog.getControl(&quot;cbCutTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestPaste, -(gOptionsDialog.getControl(&quot;cbPasteTest&quot;).getState), gOutPutDoc)
+	SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).getState), gOutPutDoc)
+end Sub
+
+Sub GetOptions
+	call SetGlobalDoc
+	gOptionsDialog.getControl(&quot;cbWriterTest&quot;).setState( -( GetUserFieldState (cUserFieldTestWriter, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbCalcTest&quot;).setState ( -( GetUserFieldState (cUserFieldTestCalc, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbImpressTest&quot;).setState( -( GetUserFieldState (cUserFieldTestImpress, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbDrawTest&quot;).setState( -( GetUserFieldState (cUserFieldTestDraw, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbHTMLTest&quot;).setState( -( GetUserFieldState (cUserFieldTestHTML, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbMathTest&quot;).setState( -( GetUserFieldState (cUserFieldTestMath, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbChartTest&quot;).setState( -( GetUserFieldState (cUserFieldTestChart, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbJavaTest&quot;).setState( -( GetUserFieldState (cUserFieldTestJava, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbDatabaseTest&quot;).setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbExtensionTest&quot;).setState( -( GetUserFieldState (cUserFieldTestExtension, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbSaveOpenXMLTest&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbSaveOpen50Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbSaveOpen8Test&quot;).setState( -( GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbCutTest&quot;).setState( -( GetUserFieldState (cUserFieldTestCut, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbPasteTest&quot;).setState( -( GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)))
+	gOptionsDialog.getControl(&quot;cbTerminateAfterTest&quot;).setState( -( GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)))
+End Sub
+
+Sub ReadOptions
+	call SetGlobalDoc
+	bMakeWriterTest = GetUserFieldState (cUserFieldTestWriter, gOutPutDoc)
+	bMakeCalcTest = GetUserFieldState (cUserFieldTestCalc, gOutPutDoc)
+	bMakeImpressTest = GetUserFieldState (cUserFieldTestImpress, gOutPutDoc)
+	bMakeDrawTest = GetUserFieldState (cUserFieldTestDraw, gOutPutDoc)
+	bMakeHTMLTest = GetUserFieldState (cUserFieldTestHTML, gOutPutDoc)
+	bMakeMathTest = GetUserFieldState (cUserFieldTestMath, gOutPutDoc)
+	bMakeChartTest = GetUserFieldState (cUserFieldTestChart, gOutPutDoc)
+	bMakeJavaTest = GetUserFieldState (cUserFieldTestJava, gOutPutDoc)
+	bMakeDBTest = GetUserFieldState (cUserFieldTestDatabase, gOutPutDoc)
+	bMakeExtensionTest = GetUserFieldState (cUserFieldTestExtension, gOutPutDoc)
+	bMakeSaveOpenXMLTest = GetUserFieldState (cUserFieldTestOpenSaveXML, gOutPutDoc)
+	bMakeSaveOpen50Test = GetUserFieldState (cUserFieldTestOpenSave50, gOutPutDoc)
+	bMakeSaveOpen8Test = GetUserFieldState (cUserFieldTestOpenSave8, gOutPutDoc)
+	bMakeCutTest = GetUserFieldState (cUserFieldTestCut, gOutPutDoc)
+	bMakePasteTest = GetUserFieldState (cUserFieldTestPaste, gOutPutDoc)
+	bMakeTerminateAfterTest = GetUserFieldState (cUserFieldTestTerminateAfterTest, gOutPutDoc)
+end Sub
+
+Sub SetDefaultOptions
+	bMakeWriterTest = true
+	bMakeCalcTest = true
+	bMakeImpressTest = true
+	bMakeDrawTest = true
+	bMakeHTMLTest = true
+	bMakeMathTest = true
+	bMakeChartTest = true
+	if Environ(&quot;SOLAR_JAVA&quot;) = &quot;&quot; then
+		bMakeJavaTest = false
+		bMakeDBTest = false
+		bMakeExtensionTest = false
+	else
+		bMakeJavaTest = true
+		bMakeDBTest = true
+		bMakeExtensionTest = true
+	End If
+	bMakeSaveOpenXMLTest = true
+	REM Disable StarOffice 5.0 tests in case binfilter has not been included
+	if Environ(&quot;WITH_BINFILTER&quot;) = &quot;NO&quot; then
+		bMakeSaveOpen50Test = false
+	else
+		bMakeSaveOpen50Test = true
+	End If
+	bMakeSaveOpen8Test = true
+	bMakeCutTest = true
+	bMakePasteTest = true
+	bMakeTerminateAfterTest = false
+end Sub
+
+Sub StartTestByOptions
+	bShowTable = true
+	call ReadOptions
+	call Main
+	if bMakeTerminateAfterTest then
+		ClearDocFull (gOutPutDoc)
+		gOutPutDoc.dispose
+		&apos;StarDesktop.Terminate
+		
+		&apos;EnableReschedule( false )
+		&apos;DispatchSlot( 5300 )
+		stop
+	End If
+end Sub
+
+Function StartTestWithDefaultOptions
+	bShowTable = false
+	call SetDefaultOptions
+	call Main
+	dim component(cMaxErrorStates) as string
+	component(cStWriter) = &quot;Writer&quot;
+	component(cStCalc) = &quot;Calc&quot;
+	component(cStPraesentation) = &quot;Impress&quot;
+	component(cStZeichnen) = &quot;Draw&quot;
+	component(cStChart) = &quot;Chart&quot;
+	component(cStMath) = &quot;Math&quot;
+	component(cStHTML) = &quot;HTML&quot;
+	component(cStJava) = &quot;Java&quot;
+	component(cStDataBase) = &quot;Base&quot;
+	component(cStExtension) = &quot;Extensions&quot;
+	dim action(5) as string
+	action(cDocNew) = &quot;new&quot;
+	action(cDocCut) = &quot;cut&quot;
+	action(cDocPaste) = &quot;paste&quot;
+	action(cDocSaveOpen8) = &quot;V8.0&quot;
+	action(cDocSaveOpenXML) = &quot;XML&quot;
+	action(cDocSaveOpen50) = &quot;V5.0&quot;
+	dim baseAction(5) as string
+	baseAction(cDBService) = &quot;services&quot;
+	baseAction(cDBOpen) = &quot;open&quot;
+	baseAction(cDBInsert) = &quot;insert&quot;
+	baseAction(cDBDelete) = &quot;delete&quot;
+	baseAction(cDBSeek) = &quot;seek&quot;
+	baseAction(cDBClose) = &quot;close&quot;
+	dim extAction(2) as string
+	extAction(cEXTService) = &quot;services&quot;
+	extAction(cEXTInstall) = &quot;install&quot;
+	extAction(cEXTUninstall) = &quot;uninstall&quot;
+	dim result as string
+	for i = 0 to cMaxErrorStates
+		for j = 0 to 5
+			if gErrorState(i, j) = cLogFalse then
+				result = result &amp; &quot; &quot; &amp; component(i) &amp; &quot;:&quot;
+				if i = cStDataBase then
+					result = result &amp; baseAction(j)
+				else if i = cStExtension then
+					result = result &amp; extAction(j)
+				else
+					result = result &amp; action(j)
+				end if
+				end if
+			end if
+		next j
+	next i
+	StartTestWithDefaultOptions = result
+end Function
+
+Sub DispatchSlot(SlotID as Integer)
+	Dim oArg() as new com.sun.star.beans.PropertyValue
+	Dim oUrl as new com.sun.star.util.URL
+	Dim oTrans as Object
+	Dim oDisp as Object
+
+	oTrans = createUNOService(&quot;com.sun.star.util.URLTransformer&quot;)
+	oUrl.Complete = &quot;slot:&quot; &amp; CStr(SlotID)
+	oTrans.parsestrict(oUrl)
+
+	oDisp = StarDesktop.queryDispatch(oUrl, &quot;_self&quot;, 0)	
+	oDisp.dispatch(oUrl, oArg())
+End Sub
+
+Sub LoadLibrary( LibName As String )
+	
+	dim args(1)
+	dim arg as new com.sun.star.beans.PropertyValue
+	arg.Name = &quot;LibraryName&quot;
+	arg.Value = LibName
+	args(0) = arg
+	
+	dim url as new com.sun.star.util.URL
+	dim trans as object
+	trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
+	url.Complete = &quot;slot:6517&quot;
+	trans.parsestrict( url )
+
+	dim disp as object
+	disp = StarDesktop.currentFrame.queryDispatch( url, &quot;&quot;, 0 )
+	disp.dispatch( url, args() )
+	
+End Sub
+
+Sub ExecuteSlot( SlotNr As String, oDoc as Object )
+	dim args()
+	dim url as new com.sun.star.util.URL
+	dim trans as object
+	dim disp as object
+	
+	trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
+	url.Complete = &quot;slot:&quot; + SlotNr
+	trans.parsestrict( url )
+	
+	disp = oDoc.CurrentController.Frame.queryDispatch( url, &quot;&quot;, 0 )
+	disp.dispatch( url, args() )
+	
+End Sub
+
+Sub CutText (oDoc as Object)
+	ExecuteSlot (&quot;5710&quot;, oDoc)
+End Sub
+
+Sub PasteText (oDoc as Object)
+	ExecuteSlot (&quot;5712&quot;, oDoc)
+End Sub
+
+Sub DelAllUserFields (aDoc as Object)
+	Dim aFieldType as Object
+	Dim aElements as Variant
+	Dim i%
+	Dim aFieldMasters, aFieldMaster as Object
+	Dim sElement$ 
+	aFieldMasters = aDoc.TextFieldMasters
+	aElements = aFieldMasters.ElementNames
+	for i = 0 to UBound(aElements)
+		sElement$ = aElements(i)
+		if 0 &lt;&gt; instr(sElement$, cUnoUserField ) then
+			aFieldMaster = aFieldMasters.GetByName(sElement$)
+			aFieldMaster.Dispose
+		endif
+	next	
+end Sub
+
+Function GetUserFieldState (sName as String, aDoc as Object) as boolean
+	Dim sFieldText as String
+	Dim bState as boolean
+	sFieldText = ReadUserField (sName, aDoc)
+
+	if LCase(sFieldText) = cYes then
+		bState = true
+	else
+		bState = false
+	end IF
+
+	GetUserFieldState = bState
+end Function
+
+Sub SetUserFieldState (sName as String, nState as boolean, aDoc as Object)
+	Dim sFieldText as String
+
+	sFieldText = cNo &apos;default
+
+	Select case nState
+		case true
+			sFieldText = cYes
+		case false
+			sFieldText = cNo
+	end Select
+
+	WriteUserField (sFieldText, sName, aDoc)
+end Sub
+
+Function ReadUserField(sFieldName as String, aDoc as Object) as String
+	Dim aMasters as Object
+	aMasters = aDoc.TextFieldMasters
+	if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then
+		ReadUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName).Content
+	else
+		ReadUserField = &quot;&quot;
+	end If	
+End Function
+
+Sub WriteUserField(sValue as String, sFieldName as String, aDoc as Object, optional aCursor as Object)
+	Dim aMasters, aUserField, aTxtCursor as Object
+	aMasters = aDoc.TextFieldMasters
+	if aMasters.HasByName (cUnoUserField+cUnoSeparator+sFieldName) then
+		aUserField = aMasters.GetByName (cUnoUserField+cUnoSeparator+sFieldName)
+	else	
+		aUserField = aDoc.CreateInstance (cUnoUserField)
+		aUserField.Name = sFieldName
+	end if	
+	aUserField.Content = sValue
+End Sub
+
+Sub WriteExtUserField(nIndex as Integer, aCursor as Object, aDoc as Object)
+	Dim aUserField as Object
+	aUserField = aDoc.CreateInstance (cUnoExtUserField)
+	aUserField.UserDataType = nIndex
+	aCursor.Text.InsertTextContent (aCursor, aUserField, True)
+	aUserField.Fix = True
+End Sub
+</script:module>

File smoketestoo_native/data/OptionsDlg.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="OptionsDlg" dlg:left="173" dlg:top="100" dlg:width="223" dlg:height="214" dlg:closeable="true" dlg:moveable="true" dlg:title="Options for smoketest">
+ <dlg:bulletinboard>
+  <dlg:titledbox dlg:id="fmTests" dlg:tab-index="0" dlg:left="114" dlg:top="7" dlg:width="101" dlg:height="157">
+   <dlg:title dlg:value="Tests"/>
+  </dlg:titledbox>
+  <dlg:titledbox dlg:id="fmInstalls" dlg:tab-index="1" dlg:left="7" dlg:top="7" dlg:width="100" dlg:height="157">
+   <dlg:title dlg:value="Functions"/>
+  </dlg:titledbox>
+  <dlg:checkbox dlg:id="cbWriterTest" dlg:tab-index="2" dlg:left="126" dlg:top="21" dlg:width="80" dlg:height="8" dlg:value="Writer" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbCalcTest" dlg:tab-index="3" dlg:left="126" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Calc" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbImpressTest" dlg:tab-index="4" dlg:left="126" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Impress" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbDrawTest" dlg:tab-index="5" dlg:left="126" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Draw" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbHTMLTest" dlg:tab-index="6" dlg:left="126" dlg:top="77" dlg:width="80" dlg:height="8" dlg:value="HTML" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbMathTest" dlg:tab-index="7" dlg:left="126" dlg:top="91" dlg:width="80" dlg:height="8" dlg:value="Math" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbChartTest" dlg:tab-index="8" dlg:left="126" dlg:top="105" dlg:width="80" dlg:height="8" dlg:value="Chart" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbSaveOpenXMLTest" dlg:tab-index="9" dlg:left="19" dlg:top="49" dlg:width="80" dlg:height="8" dlg:value="Save / Open XML" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbSaveOpen50Test" dlg:tab-index="10" dlg:left="19" dlg:top="63" dlg:width="80" dlg:height="8" dlg:value="Save / Open V5.0" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbCutTest" dlg:tab-index="11" dlg:left="19" dlg:top="77" dlg:width="80" dlg:height="8" dlg:value="Cut" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbPasteTest" dlg:tab-index="12" dlg:left="19" dlg:top="91" dlg:width="80" dlg:height="8" dlg:value="Paste" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbTerminateAfterTest" dlg:tab-index="13" dlg:disabled="true" dlg:left="19" dlg:top="174" dlg:width="190" dlg:height="8" dlg:value="Terminate Office after test" dlg:checked="false"/>
+  <dlg:titledbox dlg:id="fmBroker" dlg:tab-index="14" dlg:left="7" dlg:top="169" dlg:width="208" dlg:height="17"/>
+  <dlg:button dlg:id="btOk" dlg:tab-index="15" dlg:left="7" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Ok" dlg:button-type="ok">
+   <script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressOk" script:language="StarBasic"/>
+  </dlg:button>
+  <dlg:button dlg:id="btCancel" dlg:tab-index="16" dlg:left="80" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Cancel" dlg:button-type="ok">
+   <script:event script:event-name="on-performaction" script:location="document" script:macro-name="Standard.Events.PressCancel" script:language="StarBasic"/>
+  </dlg:button>
+  <dlg:button dlg:id="btStart" dlg:tab-index="17" dlg:left="152" dlg:top="193" dlg:width="65" dlg:height="15" dlg:value="Smoketest">
+   <script:event script:event-name="on-performaction" script:location="vnd.sun.star.script" script:macro-name="Standard.Events.PressTest?language=Basic&amp;location=document" script:language="Script"/>
+  </dlg:button>
+  <dlg:checkbox dlg:id="cbJavaTest" dlg:tab-index="18" dlg:left="126" dlg:top="119" dlg:width="80" dlg:height="8" dlg:value="Java" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbSaveOpen8Test" dlg:tab-index="19" dlg:left="19" dlg:top="35" dlg:width="80" dlg:height="8" dlg:value="Save / Open V8.0" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbDatabaseTest" dlg:tab-index="20" dlg:left="126" dlg:top="133" dlg:width="80" dlg:height="8" dlg:value="Database" dlg:checked="false"/>
+  <dlg:checkbox dlg:id="cbExtensionTest" dlg:tab-index="21" dlg:left="126" dlg:top="147" dlg:width="80" dlg:height="8" dlg:value="Extension" dlg:checked="false"/>
+ </dlg:bulletinboard>
+</dlg:window>

File smoketestoo_native/data/Test_10er.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test_10er" script:language="StarBasic">REM  10er Test
+
+const sSWLogFileName = &quot;swlog.dat&quot;, sSCLogFileName = &quot;sclog.dat&quot;
+const sSDLogFileName = &quot;sdlog.dat&quot;, sSMathLogFileName = &quot;smalog.dat&quot;
+const sSImDLogFileName = &quot;simlog.dat&quot;, sSChartLogFileName = &quot;schlog.dat&quot;
+const sSHptLogFileName = &quot;shptlog.dat&quot;, sSMessageLogFileName = &quot;smeslog.dat&quot;
+const sSDrawLogFileName = &quot;sdrwlog.dat&quot;, sJavaLogFileName = &quot;javalog.dat&quot;
+const sSDBLogFileName = &quot;dblog.dat&quot;, sExtLogFileName = &quot;extlog.dat&quot;
+const sLogFileName = &quot;log.dat&quot;
+const cTempFileName = &quot;ttt&quot;
+
+const cMessageSaveOpen8Doc = &quot;Save/Open open Documents (8.0)&quot;
+const cMessageSaveOpenXMLDoc = &quot;Save/Open Document XML (6/7)&quot;
+const cMessageSaveOpen50Doc = &quot;Save/Open Document 5.0&quot;
+const cMessageNewDoc = &quot;New Document&quot;
+const cMessageCloseDoc = &quot;Close Document&quot;
+const cMessageCutObj = &quot;Cut Object&quot;
+const cMessagePasteObj = &quot;Paste Object&quot;
+
+Global sWorkPath$
+Global sWorkPathURL$
+Global FileChannel%
+Global MainFileChannel%
+
+Sub Main
+	call TestAllDocs()
+end Sub
+
+Sub DeleteAllSavedFiles()
+	Dim sFileName as String
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmHyperText)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter or cFltXML)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc or cFltXML)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress or cFltXML)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw or cFltXML)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If	
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter or cFlt50)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc or cFlt50)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress or cFlt50)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+	sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw or cFlt50)
+	If FileExists (sFileName) then
+		Kill (sFileName)
+	End If
+End Sub
+
+Sub DeleteAllLogFiles()
+	If FileExists (sWorkPath+sLogFileName) then
+		Kill (sWorkPath+sLogFileName)
+	End If
+	If FileExists (sWorkPath+sSWLogFileName) then
+		Kill (sWorkPath+sSWLogFileName)
+	End If
+	If FileExists (sWorkPath+sSCLogFileName) then
+		Kill (sWorkPath+sSCLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSDLogFileName) then
+		Kill (sWorkPath+sSDLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSMathLogFileName) then
+		Kill (sWorkPath+sSMathLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSImDLogFileName) then
+		Kill (sWorkPath+sSImDLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSChartLogFileName) then
+		Kill (sWorkPath+sSChartLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSHptLogFileName) then
+		Kill (sWorkPath+sSHptLogFileName)
+	End If	
+	If FileExists (sWorkPath+sSMessageLogFileName) then
+		Kill (sWorkPath+sSMessageLogFileName)
+	End If
+	If FileExists (sWorkPath+sSDrawLogFileName) then
+		Kill (sWorkPath+sSDrawLogFileName)
+	End If
+	If FileExists (sWorkPath+sJavaLogFileName) then
+		Kill (sWorkPath+sJavaLogFileName)
+	End If
+	If FileExists (sWorkPath+sSDBLogFileName) then
+		Kill (sWorkPath+sSDBLogFileName)
+	End If
+	If FileExists (sWorkPath+sExtLogFileName) then
+		Kill (sWorkPath+sExtLogFileName)
+	End If
+end Sub
+
+Function OpenLogDat (sFileName as String) as Integer
+	Dim LocaleFileChannel%
+	If FileExists (sWorkPath+sFileName) then
+		Kill (sWorkPath+sFileName)
+	End If	
+	LocaleFileChannel% = Freefile 
+	Open sWorkPath+sFileName For Output As LocaleFileChannel%
+	OpenLogDat = LocaleFileChannel%
+end Function
+
+Function GetWorkPath as string
+	sTemp = &quot;$(userpath)/temp/&quot;
+	GetWorkPath = CreateUnoService(&quot;com.sun.star.config.SpecialConfigManager&quot;).SubstituteVariables(sTemp)
+End Function
+
+Function GetWorkURL as string
+	sTemp = &quot;$(userurl)/temp/&quot;
+	GetWorkURL = CreateUnoService(&quot;com.sun.star.config.SpecialConfigManager&quot;).SubstituteVariables(sTemp)
+End Function
+
+Function GetSystem (sTmpWorkPath as string) as string
+	GetSystem = &quot;&quot;
+	if InStr (sTmpWorkPath, &quot;:&quot;) then
+		GetSystem = &quot;windows&quot;
+	else
+		GetSystem = &quot;unix&quot;
+	End If
+end Function
+
+Function ConvertPathToWin (sTmpWorkPath as string) as string
+	for i%=1 to Len(sTmpWorkPath)
+		sTemp = Mid (sTmpWorkPath, i%, 1)
+		if sTemp = &quot;/&quot; then
+			sTmpWorkPath = Left (sTmpWorkPath, i%-1) + &quot;\&quot; + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%)
+		else
+			if sTemp = &quot;|&quot; then
+				sTmpWorkPath = Left (sTmpWorkPath, i%-1) + &quot;:&quot; + Right (sTmpWorkPath, Len(sTmpWorkPath)-i%)
+			end If
+		end If
+	next i%
+	ConvertPathToWin = sTmpWorkPath
+end Function
+
+Sub TestAllDocs()
+DIM sDocURL as String, sDocPath as String
+DIM nStrPos as Long
+
+	sWorkPath = GetWorkPath
+	sWorkPathURL = GetWorkURL
+	
+	if GetSystem (sWorkPath) = &quot;windows&quot; then
+		sWorkPath = ConvertPathToWin (sWorkPath)
+	end if
+	
+	&apos;search ExtensionURL
+	sDocURL = gOutPutDoc.URL
+	CompatibilityMode(true)
+	nStrPos = InStrRev (sDocURL, &quot;/&quot; )
+	CompatibilityMode(false)
+	sExtensionURL = Left (sDocURL, nStrPos)
+
+	call DeleteAllSavedFiles()
+	call DeleteAllLogFiles()
+	MainFileChannel = OpenLogDat (sLogFileName)
+    call WriteTestSequence (MainFileChannel)
+	if bMakeWriterTest then
+		call MakeDocTest (frmWriter)
+	end if
+	if bMakeCalcTest then
+		call MakeDocTest (frmCalc)
+	end if
+	if bMakeImpressTest then
+		call MakeDocTest (frmImpress)
+	end if
+	if bMakeDrawTest then
+		call MakeDocTest (frmDraw)
+	end if
+	if bMakeHTMLTest then
+		call MakeDocTest (frmHyperText)
+	end if
+	if bMakeChartTest then
+		call MakeChartTest (frmChart)
+	end if	
+	if bMakeMathTest then
+		call MakeNewDoc (frmMath)
+	end if
+	if bMakeJavaTest then
+		call TestJava (frmJava)
+	end if
+	if bMakeDBTest then
+		call Test_DB.TestDB (frmDataBase)
+	end if
+	if bMakeExtensionTest then
+		call Test_Ext.TestExtensions (frmExtension)
+	end if
+	
+	Close #MainFileChannel
+end Sub
+
+Sub WriteTestSequence (FileChannel as integer)
+	Print #FileChannel, &quot;Sequence of testing&quot;
+	
+	if bMakeWriterTest then
+		WriteTests (&quot;writer  : &quot;, true, FileChannel)
+	end if
+	if bMakeCalcTest then
+		WriteTests (&quot;calc    : &quot;, true, FileChannel)
+	end if
+	if bMakeImpressTest then
+		WriteTests (&quot;impress : &quot;, true, FileChannel)
+	end if
+	if bMakeDrawTest then
+		WriteTests (&quot;draw    : &quot;, true, FileChannel)
+	end if
+	if bMakeHTMLTest then
+		WriteTests (&quot;HTML    : &quot;, true, FileChannel)
+	end if
+	if bMakeChartTest then
+		WriteTests (&quot;chart   : &quot;, false, FileChannel)
+	end if	
+	if bMakeMathTest then
+		WriteTests (&quot;math    : &quot;, false, FileChannel)
+	end if
+	if bMakeJavaTest then
+		WriteTests (&quot;Java    : &quot;, false, FileChannel)
+	end if
+	if bMakeDBTest then
+		WriteDBTests (&quot;Database    : &quot;, FileChannel)
+	end if
+	if bMakeExtensionTest then
+		WriteExtensionTests (&quot;Extension    : &quot;, FileChannel)
+	end if
+		
+	Print #FileChannel
+end Sub
+
+Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer)
+	Dim sWriteStr as string
+	
+	sWriteStr = sText
+	sWriteStr = sWriteStr + &quot;new&quot;
+	if bTestAll then
+	if bMakeCutTest then
+		sWriteStr = sWriteStr + &quot;, cut&quot;
+	end if
+	if bMakePasteTest then
+		sWriteStr = sWriteStr + &quot;, paste&quot;
+	end if
+	if bMakeSaveOpen8Test then
+		sWriteStr = sWriteStr + &quot;, save 8.0&quot;
+	end if
+	if bMakeSaveOpenXMLTest then
+		sWriteStr = sWriteStr + &quot;, save XML&quot;
+	end if
+	if bMakeSaveOpen50Test then
+		sWriteStr = sWriteStr + &quot;, save 5.0&quot;
+	end if
+	if bMakeSaveOpen8Test then
+		sWriteStr = sWriteStr + &quot;, open 8.0&quot;
+	end if
+	if bMakeSaveOpenXMLTest then
+		sWriteStr = sWriteStr + &quot;, open XML&quot;
+	end if
+	if bMakeSaveOpen50Test then
+		sWriteStr = sWriteStr + &quot;, open 5.0&quot;
+	end if
+	end if
+	
+	sWriteStr = sWriteStr + &quot;, close&quot;
+	
+	Print #nFileChannel, sWriteStr
+end Sub
+
+Sub WriteDBTests (sText as string, nFileChannel as integer)
+	Dim sWriteStr as string
+	
+	sWriteStr = sText
+	sWriteStr = sWriteStr + &quot;open / services&quot;
+	sWriteStr = sWriteStr + &quot;, insert&quot;
+	sWriteStr = sWriteStr + &quot;, delete&quot;
+	sWriteStr = sWriteStr + &quot;, seek&quot;
+	sWriteStr = sWriteStr + &quot;, close&quot;
+	
+	Print #nFileChannel, sWriteStr
+end Sub
+
+Sub WriteExtensionTests (sText as string, nFileChannel as integer)
+	Dim sWriteStr as string
+	
+	sWriteStr = sText
+	sWriteStr = sWriteStr + &quot;services&quot;
+	sWriteStr = sWriteStr + &quot;, install&quot;
+	sWriteStr = sWriteStr + &quot;, uninstall&quot;
+	
+	Print #nFileChannel, sWriteStr
+end Sub
+
+Sub MakeDocTest (FilterType as Integer)
+	Dim oDoc as Object
+	Dim sFileNameXML$, sFileName50$, sFileName8$
+	Dim bError as Boolean
+	Dim nCurrentAction as Integer
+	
+	On Local Error GoTo DOCTESTERROR
+	nCurrentAction = cLogfileFailed
+	FileChannel% = OpenLogDat (GetLogFileName(FilterType))
+	nCurrentAction = cDocNew
+	oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(FilterType or cFltNewDoc))
+	LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
+	LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
+	SetStatus (FilterType, cDocNew, not IsNull (oDoc))
+	if not IsNull (oDoc) then
+		nCurrentAction = cDocCut
+		call CutAndPaste(FilterType, oDoc)
+&apos;		bError = oDoc.CurrentController.frame.close
+		nCurrentAction = cDocSaveOpen8
+		if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then
+			sFileName8 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt8)
+			SaveDoc (sFileName8, oDoc, GetDocFilter(FilterType or cFlt8))
+		end if
+		nCurrentAction = cDocSaveOpenXML
+		if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then
+			sFileNameXML = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFltXML)
+			SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML))
+		end if
+		nCurrentAction = cDocSaveOpen50
+		if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
+			sFileName50 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt50)
+			SaveDoc (sFileName50, oDoc, GetDocFilter(FilterType or cFlt50))
+		end if	
+&apos;		oDoc.dispose
+		nCurrentAction = cDocClose
+		oDoc.close (true)
+&apos;		bError = true &apos; nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht
+&apos;		LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, FileChannel)
+&apos;		LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, MainFileChannel)
+&apos;		SetStatus (FilterType, cDocClose, bError)
+		nCurrentAction = cDocSaveOpen8
+		if bMakeSaveOpen8Test and IsFilterAvailable (FilterType or cFlt8) then
+			oDoc = LoadDoc (sFileName8)
+			
+&apos;			oDoc = Documents.open(sFileName)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen8Doc, FileChannel)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen8Doc, MainFileChannel)
+			SetStatus (FilterType, cDocSaveOpen8, not IsNull (oDoc))
+			
+			if not IsNull (oDoc) then
+&apos;				oDoc.dispose
+				nCurrentAction = cDocClose
+				oDoc.close (true)
+			end If	
+		end if
+		
+		nCurrentAction = cDocSaveOpenXML
+		if bMakeSaveOpenXMLTest and IsFilterAvailable (FilterType or cFltXML) then
+			oDoc = LoadDoc (sFileNameXML)
+			
+&apos;			oDoc = Documents.open(sFileName)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpenXMLDoc, FileChannel)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpenXMLDoc, MainFileChannel)
+			SetStatus (FilterType, cDocSaveOpenXML, not IsNull (oDoc))
+			
+			if not IsNull (oDoc) then
+&apos;				oDoc.dispose
+				nCurrentAction = cDocClose
+				oDoc.close (true)
+			end If	
+		end if
+		
+		nCurrentAction = cDocSaveOpen50
+		if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
+			oDoc = LoadDoc (sFileName50)
+			
+&apos;			oDoc = Documents.open(sFileName)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, FileChannel)
+			LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, MainFileChannel)
+			SetStatus (FilterType, cDocSaveOpen50, not IsNull (oDoc))
+			
+			if not IsNull (oDoc) then
+&apos;				oDoc.dispose
+				nCurrentAction = cDocClose
+				oDoc.close (true)
+			end If	
+		end if
+	end If		
+	Print #FileChannel, &quot;---&quot;
+	Close #FileChannel%
+	Exit Sub &apos; Without error
+	
+	DOCTESTERROR:
+	If 	(nCurrentAction = cLogfileFailed) then
+		SetStatus (FilterType, cDocNew, False)
+		Exit Sub
+	else
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
+		SetStatus (FilterType, nCurrentAction, False)
+		Close #FileChannel%
+	End If	
+	Exit Sub &apos; With error
+End Sub
+
+Sub MakeNewDoc (FilterType as Integer)
+	DIM oDoc as Object
+	Dim bError as Boolean
+	Dim nCurrentAction as Integer
+	On Local Error GoTo DOCTESTERROR2
+	nCurrentAction = cLogfileFailed
+	FileChannel% = OpenLogDat (GetLogFileName(FilterType))
+	nCurrentAction = cDocNew
+&apos;	oDoc = Documents.Add(GetDocFilter(FilterType))
+	oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(FilterType or cFltNewDoc))
+	LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
+	LogState (not IsNull (oDoc), GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
+	SetStatus (FilterType, cDocNew, not IsNull (oDoc))
+	if not IsNull (oDoc) then
+		nCurrentAction = cDocClose
+&apos;		oDoc.dispose
+		oDoc.close (true)
+&apos;		bError = true &apos; nur zum ¦bergang, weil bError = oDoc.CurrentController.frame.close nicht geht
+&apos;		LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, FileChannel)
+&apos;		LogState (bError, GetDocFilter(FilterType)+&quot; &quot;+ cMessageCloseDoc, MainFileChannel)
+&apos;		SetStatus (FilterType, cDocClose, bError)
+	end	If
+	Print #FileChannel, &quot;---&quot;
+	Close #FileChannel%
+	Exit Sub &apos; Without error
+	
+	DOCTESTERROR2:
+	If 	(nCurrentAction = cLogfileFailed) then
+		SetStatus (FilterType, cDocNew, False)
+		Exit Sub
+	else
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
+		SetStatus (FilterType, nCurrentAction, False)
+		Close #FileChannel%
+	End If	
+	Exit Sub &apos; With error
+End Sub
+
+Sub MakeChartTest (FilterType as Integer)
+	Dim oCharts as Object
+	Dim oDoc as Object
+	Dim oRange(0) as New com.sun.star.table.CellRangeAddress
+	Dim oRect as New com.sun.star.awt.Rectangle
+	const cChartName=&quot;TestChart&quot;
+	Dim bError as Boolean
+	Dim nCurrentAction as Integer
+	On Local Error GoTo CHARTTESTERROR
+	nCurrentAction = cLogfileFailed
+	FileChannel% = OpenLogDat (GetLogFileName(FilterType))
+	nCurrentAction = cDocNew
+	oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(frmCalc or cFltNewDoc))
+	if not IsNull (oDoc) then
+		oCharts = oDoc.sheets(0).Charts
+		oCharts.AddNewByName (cChartName, oRect, oRange(), true, true)
+		bError=oCharts.HasByName(cChartName)
+		LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
+		LogState (bError, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
+		SetStatus (FilterType, cDocNew, bError)
+&apos;		oDoc.dispose
+		nCurrentAction = cDocClose
+		oDoc.close (true)
+	else
+		LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FileChannel)
+		LogState (not IsNull (oDoc), GetDocFilter(frmCalc or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, MainFileChannel)
+		SetStatus (frmCalc, cDocNew, not IsNull (oDoc))
+	End if
+	Print #FileChannel, &quot;---&quot;
+	Close #FileChannel%
+	Exit Sub &apos; Without error
+	
+	CHARTTESTERROR:
+	If 	(nCurrentAction = cLogfileFailed) then
+		SetStatus (FilterType, cDocNew, False)
+		Exit Sub
+	else
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), FileChannel)
+		LogState (False, GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(nCurrentAction), MainFileChannel)
+		SetStatus (FilterType, nCurrentAction, False)
+		Close #FileChannel%
+	End If	
+	Exit Sub &apos; With error
+End Sub
+
+Sub LogState (bState as Boolean, sText as String, nLocaleFileChannel as integer)
+	if bState then
+		Print #nLocaleFileChannel, sText+&quot; -&gt; ok&quot;
+	else
+		Print #nLocaleFileChannel, sText+&quot; -&gt; error&quot;
+	end If	
+end Sub
+
+Function GetDocEndings (DocType as Integer) as String
+	Select Case ( DocType )
+		case frmWriter or cFlt8
+			GetDocEndings = &quot;odt&quot; &apos; Textdokument 
+		case frmCalc or cFlt8
+			GetDocEndings = &quot;ods&quot; &apos;Tabellendokument 
+		case frmImpress or cFlt8
+			GetDocEndings = &quot;odp&quot; &apos;PrÕsentation 
+		case frmDraw or cFlt8
+			GetDocEndings = &quot;odg&quot; &apos;Zeichen
+		case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
+			GetDocEndings = &quot;html&quot; &apos;Hypertext-Dokument
+		case frmWriter or cFlt50
+			GetDocEndings = &quot;sdw&quot; &apos; Textdokument 5.0
+		case frmCalc or cFlt50
+			GetDocEndings = &quot;sdc&quot; &apos;Tabellendokument 5.0
+		case frmImpress or cFlt50
+			GetDocEndings = &quot;sdd&quot; &apos;PrÕsentation 5.0
+		case frmDraw or cFlt50
+			GetDocEndings = &quot;sda&quot; &apos;Zeichen 5.0
+		case frmWriter or cFltXML
+			GetDocEndings = &quot;sxw&quot; &apos; Textdokument 
+		case frmCalc or cFltXML
+			GetDocEndings = &quot;sxc&quot; &apos;Tabellendokument 
+		case frmImpress or cFltXML
+			GetDocEndings = &quot;sxi&quot; &apos;PrÕsentation 
+		case frmDraw or cFltXML
+			GetDocEndings = &quot;sxd&quot; &apos;Zeichen
+		case else
+			GetDocEndings = &quot;&quot;
+	end Select		
+end Function
+
+Function GetDocFilter (DocType as Integer) as String
+	Select Case ( DocType )
+		case frmWriter or cFlt8 
+			GetDocFilter = &quot;writer8&quot; &apos; Textdokument 
+		case frmCalc or cFlt8
+			GetDocFilter = &quot;calc8&quot; &apos;Tabellendokument 
+		case frmImpress or cFlt8
+			GetDocFilter = &quot;impress8&quot; &apos;Präsentation 
+		case frmDraw or cFlt8
+			GetDocFilter = &quot;draw8&quot; &apos;Zeichen
+		case frmMath or cFlt8
+			GetDocFilter = &quot;math8&quot; &apos;Formel
+			
+		case frmWriter or cFltXML
+			GetDocFilter = &quot;StarOffice XML (Writer)&quot; &apos; Textdokument 
+		case frmCalc or cFltXML
+			GetDocFilter = &quot;StarOffice XML (Calc)&quot; &apos;Tabellendokument 
+		case frmImpress or cFltXML
+			GetDocFilter = &quot;StarOffice XML (Impress)&quot; &apos;Präsentation 
+		case frmDraw or cFltXML
+			GetDocFilter = &quot;StarOffice XML (Draw)&quot; &apos;Zeichen
+		case frmMath or cFltXML
+			GetDocFilter = &quot;StarOffice XML (Math)&quot; &apos;Formel 
+			
+		case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
+			GetDocFilter = &quot;HTML&quot; &apos;Hypertext-Dokument
+		case frmWriter or cFlt50
+			GetDocFilter = &quot;StarWriter 5.0&quot; &apos; Textdokument 5.0
+		case frmCalc or cFlt50
+			GetDocFilter = &quot;StarCalc 5.0&quot; &apos;Tabellendokument 5.0
+		case frmImpress or cFlt50
+			GetDocFilter = &quot;StarImpress 5.0&quot; &apos;Präsentation 5.0
+		case frmDraw or cFlt50
+			GetDocFilter = &quot;StarDraw 5.0&quot; &apos;Zeichen 5.0
+		case frmMath or cFlt50
+			GetDocFilter = &quot;StarMath 5.0&quot; &apos;Formel 5.0
+			
+		case frmWriter or cFltNewDoc
+			GetDocFilter = &quot;swriter&quot; &apos; Textdokument 
+		case frmCalc or cFltNewDoc
+			GetDocFilter = &quot;scalc&quot; &apos;Tabellendokument 
+		case frmMessage or cFltNewDoc
+			GetDocFilter = &quot;Message&quot; &apos;Nachricht 
+		case frmImpress or cFltNewDoc
+			GetDocFilter = &quot;simpress&quot; &apos;Präsentation 
+		case frmDraw or cFltNewDoc
+			GetDocFilter = &quot;sdraw&quot; &apos;Zeichen
+		case frmMath or cFltNewDoc
+			GetDocFilter = &quot;smath&quot; &apos;Formel 
+		case frmImage or cFltNewDoc
+			GetDocFilter = &quot;simage&quot; &apos;Bild 
+		case frmHyperText or cFltNewDoc
+			GetDocFilter = &quot;swriter/web&quot; &apos;Hypertext-Dokument
+		case frmChart or cFltNewDoc
+			GetDocFilter = &quot;schart&quot; &apos;Diagramm 			
+		case else
+			GetDocFilter = &quot;&quot;
+	end Select		
+end Function
+
+Function GetLogFileName (DocType as Integer) as String
+	Select Case ( DocType )
+		case frmWriter 
+			GetLogFileName = sSWLogFileName &apos; Textdokument 
+		case frmCalc
+			GetLogFileName = sSCLogFileName &apos;Tabellendokument 
+		case frmMessage
+			GetLogFileName = sSMessageLogFileName &apos;Nachricht 
+		case frmImpress
+			GetLogFileName = sSDLogFileName &apos;PrÕsentation 
+		case frmDraw
+			GetLogFileName = sSDrawLogFileName &apos;Zeichnen
+		case frmMath
+			GetLogFileName = sSMathLogFileName &apos;Formel 
+		case frmImage
+			GetLogFileName = sSImDLogFileName &apos;Bild 
+		case frmHyperText
+			GetLogFileName = sSHptLogFileName &apos;Hypertext-Dokument 
+		case frmChart
+			GetLogFileName = sSChartLogFileName &apos;Diagramm 
+		case frmJava
+			GetLogFileName = sJavaLogFileName &apos;Java
+		case frmDataBase
+			GetLogFileName = sSDBLogFileName &apos;Database	
+		case frmExtension
+			GetLogFileName = sExtLogFileName &apos;Extension	
+		case else
+			GetLogFileName = &quot;&quot;
+	end Select		
+end Function
+
+Function GetErrorMessageOnAction (nAction as Integer) as String
+	Select Case ( nAction )
+		case cDocNew 
+			GetErrorMessageOnAction = cMessageNewDoc 
+		case cDocCut
+			GetErrorMessageOnAction = cMessageCutObj 
+		case cDocPaste
+			GetErrorMessageOnAction = cMessagePasteObj 
+		case cDocSaveOpen8
+			GetErrorMessageOnAction = cMessageSaveOpen8Doc
+		case cDocSaveOpenXML
+			GetErrorMessageOnAction = cMessageSaveOpenXMLDoc
+		case cDocSaveOpen50
+			GetErrorMessageOnAction = cMessageSaveOpen50Doc
+		case cDocClose
+			GetErrorMessageOnAction = cMessageCloseDoc
+		case else
+			GetErrorMessageOnAction = &quot;&quot;
+	end Select		
+end Function
+
+Function IsFilterAvailable (FilterType as Integer) as boolean
+	IsFilterAvailable = true
+	if ((FilterType = (frmHyperText or cFlt50)) or (FilterType = (frmHyperText or cFltXML))) then
+		IsFilterAvailable = false
+	end if
+End Function
+
+Function TestJava (FilterType as Integer) as boolean
+	Dim oObj as Object
+	FileChannel% = OpenLogDat (GetLogFileName(FilterType))
+	oObj = createUnoService(cUnoJavaLoader)
+	LogState (not IsNull (oObj), &quot;Java &quot;+ cMessageNewDoc, FileChannel)
+	LogState (not IsNull (oObj), &quot;Java &quot;+ cMessageNewDoc, MainFileChannel)
+	SetStatus (FilterType, cDocNew, not IsNull (oObj))
+	
+	Print #FileChannel, &quot;---&quot;
+	Close #FileChannel%
+	
+	TestJava = not IsNull (oObj)
+End Function
+
+Sub CutAndPaste (DocType as Integer, oDoc as Object)
+	Dim sText as String
+	Dim oWin as Object
+	Dim oText as Object
+	Dim oView as Object
+	Dim bCutState as boolean, bPasteState as boolean
+	Select Case ( DocType )
+		case frmWriter
+			Dim oCursor as Object
+			
+			sText = &quot;AutomaticText&quot;
+			oText = oDoc.GetText
+			oCursor = oText.CreateTextCursor
+			oText.InsertString(oCursor, sText, true) &apos; Cursor selektiert den Text
+			oView = oDoc.getCurrentController
+			oView.Select(oCursor)
+			
+			if bMakeCutTest then
+			call CutText (oDoc)
+			
+			if oText.GetString = &quot;&quot; Then
+				bCutState = True
+			else
+				bCutState = False
+			end If
+			SetStatus (DocType, cDocCut, bCutState)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
+			end if
+			
+			if bMakePasteTest and bMakeCutTest then
+			call PasteText (oDoc)
+			
+			if oText.GetString = sText Then
+				bPasteState = True
+			else
+				bPasteState = False
+			end If
+			SetStatus (DocType, cDocPaste, bPasteState)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
+			end if
+
+		case frmCalc
+			DIM oCell as Object
+			
+			sText = &quot;AutomaticText&quot;
+			oCell = oDoc.Sheets(0).GetCellByPosition(0, 0)
+			oCell.String = sText
+			oView = oDoc.getCurrentController
+			oView.Select(oCell)
+			
+			if bMakeCutTest then
+			call CutText (oDoc)
+			
+			if oCell.String = &quot;&quot; Then
+				bCutState = True
+			else
+				bCutState = False
+			end If
+			SetStatus (DocType, cDocCut, bCutState)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
+			end if
+			
+			if bMakePasteTest and bMakeCutTest then
+			call PasteText (oDoc)
+			
+			if oCell.String = sText Then
+				bPasteState = True
+			else
+				bPasteState = False
+			end If
+			SetStatus (DocType, cDocPaste, bPasteState)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
+			end if
+		case frmMessage
+		case frmImpress, frmDraw
+			Dim oPage as Object
+			Dim oRect as Object
+			Dim xSize as Object
+			Dim xPoint as Object
+			Dim bObjState as Boolean
+			
+			xSize = CreateUnoStruct (&quot;com.sun.star.awt.Size&quot;)
+			xPoint = CreateUnoStruct (&quot;com.sun.star.awt.Point&quot;)
+			xSize.Width = 2000
+			xSize.Height = 2000
+			xPoint.x = 10000
+			xPoint.y = 10000
+			oPage = oDoc.DrawPages(0)
+			
+			if DocType = frmImpress Then
+				oPage.Layout = 20 &apos; set page layot to none
+			end If
+				
+			oRect = oDoc.CreateInstance(&quot;com.sun.star.drawing.RectangleShape&quot;)
+			oRect.Size = xSize
+			oRect.Position = xPoint
+			oPage.add(oRect)
+			
+			oView = oDoc.getCurrentController
+			oView.Select(oRect)
+			
+			&apos; Prüft ob überhaupt ein Object angelegt wurde
+			if oPage.count = 1 Then
+				bObjState = True
+			else
+				bObjState = False
+			end If
+			
+			if bMakeCutTest then			
+			call CutText (oDoc)
+			
+			if (oPage.count = 0) and bObjState Then
+				bCutState = True
+			else
+				bCutState = False
+			end If
+			SetStatus (DocType, cDocCut, bCutState)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, FileChannel)
+			LogState (bCutState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessageCutObj, MainFileChannel)
+			end if 
+
+			wait (1000) &apos;wait after cut
+			
+			if bMakePasteTest and bMakeCutTest then
+			call PasteText (oDoc)
+			
+			if (oPage.count = 1) and bObjState Then
+				bPasteState = True
+			else
+				bPasteState = False
+			end If
+			SetStatus (DocType, cDocPaste, bPasteState)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, FileChannel)
+			LogState (bPasteState, GetDocFilter(DocType or cFltNewDoc)+&quot; &quot;+ cMessagePasteObj, MainFileChannel)
+			end if
+		case frmMath
+		case frmImage
+		case frmHyperText
+		case frmChart
+	end Select		
+end Sub
+
+Sub LoadLibrary( LibName as String )
+	
+	dim args(1)
+	dim arg as new com.sun.star.beans.PropertyValue
+	arg.Name = &quot;LibraryName&quot;
+	arg.Value = LibName
+	args(0) = arg
+	
+	dim url as new com.sun.star.util.URL
+	dim trans as object
+	trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
+	url.Complete = &quot;slot:6517&quot;
+	trans.parsestrict( url )
+
+	dim disp as object
+	disp = StarDesktop.currentFrame.queryDispatch( url, &quot;&quot;, 0 )
+	disp.dispatch( url, args() )
+	
+End Sub
+
+Sub LoadDoc (DocName as String) as Object
+	dim trans as object
+	trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
+	url = createUnoStruct(&quot;com.sun.star.util.URL&quot; )
+	url.Complete = DocName
+	if Left(DocName, 5 ) &lt;&gt; &quot;file:&quot; then
+	trans.parsestrict( url )
+	endif
+	
+	Dim aPropArray(0) as Object
+	aPropArray(0) = CreateUnoStruct(&quot;com.sun.star.beans.PropertyValue&quot;)
+	aPropArray(0).Name = &quot;OpenFlags&quot;
+	aPropArray(0).Value = &quot;S&quot;
+
+	dim doc as object
+	dim noargs()
+	doc = StarDesktop.loadComponentFromURL( url.Complete, &quot;_blank&quot;, 0, aPropArray() )	&apos; XModel
+	LoadDoc = doc
+End Sub
+
+Sub SaveDoc (DocName as String, oDoc as Object, sFilterName as string )
+	dim trans as object
+	trans = createUnoService(&quot;com.sun.star.util.URLTransformer&quot; )
+	url = createUnoStruct(&quot;com.sun.star.util.URL&quot; )
+	url.Complete = DocName
+	if Left(DocName, 5 ) &lt;&gt; &quot;file:&quot; then
+	trans.parsestrict( url )
+	endif
+	
+	if not (sFilterName = &quot;&quot;) then
+		Dim aPropArray(0) as Object
+		aPropArray(0) = CreateUnoStruct(&quot;com.sun.star.beans.PropertyValue&quot;)
+		aPropArray(0).Name = &quot;FilterName&quot;
+		aPropArray(0).Value = sFilterName
+	
+		oDoc.storeAsURL( url.Complete, aPropArray() )
+	else
+		MessageBox &quot;Filtername is unknown!&quot;
+	end if	
+end Sub
+</script:module>

File smoketestoo_native/data/Test_DB.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test_DB" script:language="StarBasic">REM  *****  Database Test  *****
+
+const cMessageDatabaseService = &quot;Database Service&quot;
+const cMessageDatabaseOpen = &quot;Open Database&quot;
+const cMessageDatabaseInsert = &quot;Insert record into Database&quot;
+const cMessageDatabaseDelete = &quot;Delete record from Database&quot;
+const cMessageDatabaseSeek = &quot;Read other record from Database&quot;
+const cMessageDatabaseClose = &quot;Close Database&quot;
+
+Sub TestDB (FilterType as Integer)
+
+Dim oDBConnection as Object, oDataSource as Object, oDBContext as Object
+Dim sDBName as String, sTable as String, sCurrentMessage as String
+Dim nRowCount as Integer, nCurrentAction as Integer
+Dim bResult as Boolean
+Const sTestString = &quot;Automatical Test&quot;
+
+
+	On Local Error GoTo DBERROR
+	
+	nCurrentAction = cLogfileFailed
+	FileChannel% = OpenLogDat (GetLogFileName(FilterType))
+
+	nCurrentAction = cDBService
+	sCurrentMessage = cMessageDatabaseService + &quot; &quot; + cUnoDatabaseContext
+	
+	oDBContext = CreateUnoService(cUnoDatabaseContext)
+	sDBName=oDBContext.ElementNames(0) &apos;Names of Databases
+	
+	nCurrentAction = cDBOpen
+	sCurrentMessage = cMessageDatabaseOpen
+	
+	oDataSource = oDBContext.GetByName(sDBName)
+	sTable=oDataSource.Tables.ElementNames(0)
+	oDBConnection = oDBContext.GetByName(sDBName).GetConnection(&quot;&quot;,&quot;&quot;)
+	
+	LogState (not IsNull (oDBConnection), &quot;Database &quot;+ cMessageDatabaseOpen, FileChannel)
+	LogState (not IsNull (oDBConnection), &quot;Database &quot;+ cMessageDatabaseOpen, MainFileChannel)
+	SetStatus (FilterType, cDBOpen, not IsNull (oDBConnection))
+	if (IsNull(oDBConnection)) then
+   		Close #FileChannel%
+		Exit Sub
+	End If
+	
+	&apos; Database is open now
+	
+	nCurrentAction = cDBService
+	sCurrentMessage = cMessageDatabaseService + &quot; &quot; + cUnoRowSet
+	oRowSet = createUnoService(cUnoRowSet)
+
+	if (IsNull(oRowSet)) then
+		LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService + &quot; &quot; + cUnoRowSet, FileChannel)
+		LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService + &quot; &quot; + cUnoRowSet, MainFileChannel)
+		SetStatus (FilterType, cDBService, not IsNull (oRowSet))
+		Exit Sub
+	else
+		LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService, FileChannel)
+		LogState (not IsNull (oRowSet), &quot;Database &quot;+ cMessageDatabaseService, MainFileChannel)
+		SetStatus (FilterType, cDBService, not IsNull (oRowSet))
+	End If
+	
+	nCurrentAction = cDBInsert
+	sCurrentMessage = cMessageDatabaseInsert
+	
+	oRowSet.ActiveConnection = oDBConnection
+
+    oRowSet.CommandType = com.sun.star.sdb.CommandType.COMMAND
+    oRowSet.Command = &quot;SELECT * FROM &quot; + sTable
+	oRowSet.execute()
+
+	oRowSet.moveToInsertRow
+	oRowSet.updateString(5, sTestString)
+
+	oRowSet.insertRow()
+	nRowCount=oRowSet.RowCount
+	
+	oRowSet.moveToCurrentRow()
+	
+	bResult = (oRowSet.getString(5) = sTestString)
+	LogState (bResult, &quot;Database &quot;+ cMessageDatabaseInsert, FileChannel)
+	LogState (bResult, &quot;Database &quot;+ cMessageDatabaseInsert, MainFileChannel)
+	SetStatus (FilterType, cDBInsert, bResult)
+	
+	&apos;delete only if insert passed
+	
+	if (bResult) Then
+		nCurrentAction = cDBDelete
+		sCurrentMessage = cMessageDatabaseDelete
+		oRowSet.deleteRow()
+		bResult = (nRowCount - oRowSet.RowCount = 0)
+		if ( bResult ) Then
+			oRowSet.next()
+			bResult = (nRowCount - oRowSet.RowCount = 1)
+		End If
+		LogState (bResult, &quot;Database &quot;+ cMessageDatabaseDelete, FileChannel)
+		LogState (bResult, &quot;Database &quot;+ cMessageDatabaseDelete, MainFileChannel)
+		SetStatus (FilterType, cDBDelete, bResult)
+	End If	
+
+	&apos; read other record
+	
+	nCurrentAction = cDBSeek
+	sCurrentMessage = cMessageDatabaseSeek
+	oRowSet.first()
+	bResult = not (oRowSet.getString(5) = sTestString)
+	LogState (bResult, &quot;Database &quot;+ cMessageDatabaseSeek, FileChannel)
+	LogState (bResult, &quot;Database &quot;+ cMessageDatabaseSeek, MainFileChannel)
+	SetStatus (FilterType, cDBSeek, bResult)
+	
+	nCurrentAction = cDBClose
+	sCurrentMessage = cMessageDatabaseClose
+	oDBConnection.Dispose()
+	LogState (True, &quot;Database &quot;+ cMessageDatabaseClose, FileChannel)
+	LogState (True, &quot;Database &quot;+ cMessageDatabaseClose, MainFileChannel)
+	SetStatus (FilterType, cDBClose, True)
+