summaryrefslogtreecommitdiff
path: root/smoketestoo_native/data/Test_10er.xml
diff options
context:
space:
mode:
Diffstat (limited to 'smoketestoo_native/data/Test_10er.xml')
-rw-r--r--smoketestoo_native/data/Test_10er.xml690
1 files changed, 0 insertions, 690 deletions
diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml
deleted file mode 100644
index a6f46b01eb78..000000000000
--- a/smoketestoo_native/data/Test_10er.xml
+++ /dev/null
@@ -1,690 +0,0 @@
-<?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 sSChartLogFileName = &quot;schlog.dat&quot;
-const sSHptLogFileName = &quot;shptlog.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 sTestGlueLogFileName = &quot;testgluelog.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 cMessageNewDoc = &quot;New Document&quot;
-const cMessageCloseDoc = &quot;Close Document&quot;
-
-Global sWorkPath$
-Global sWorkPathURL$
-Global LocalFileChannel%
-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
-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+sSChartLogFileName) then
- Kill (sWorkPath+sSChartLogFileName)
- End If
- If FileExists (sWorkPath+sSHptLogFileName) then
- Kill (sWorkPath+sSHptLogFileName)
- 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+sTestGlueLogFileName) then
- Kill (sWorkPath+sTestGlueLogFileName)
- 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
- if bMakeWriterTest then
- gCurrentDocTest = frmWriter
- call MakeDocTest
- end if
- if bMakeCalcTest then
- gCurrentDocTest = frmCalc
- call MakeDocTest
- end if
- if bMakeImpressTest then
- gCurrentDocTest = frmImpress
- call MakeDocTest
- end if
- if bMakeDrawTest then
- gCurrentDocTest = frmDraw
- call MakeDocTest
- end if
- if bMakeHTMLTest then
- gCurrentDocTest = frmHyperText
- call MakeDocTest
- end if
- if bMakeChartTest then
- gCurrentDocTest = frmChart
- call MakeChartTest
- end if
- if bMakeMathTest then
- gCurrentDocTest = frmMath
- call MakeNewDoc
- end if
- if bMakeJavaTest then
- gCurrentDocTest = frmJava
- call TestJava
- end if
- if bMakeDBTest then
- gCurrentDocTest = frmDataBase
- call Test_DB.TestDB
- end if
- if bMakeExtensionTest then
- gCurrentDocTest = frmExtension
- call Test_Ext.TestExtensions
- end if
-
- Close #MainFileChannel
- MainFileChannel = 0
-end Sub
-
-Sub WriteTestSequence
- Print #MainFileChannel, &quot;Sequence of testing&quot;
-
- if bMakeWriterTest then
- WriteTests (&quot;writer : &quot;, true, MainFileChannel)
- end if
- if bMakeCalcTest then
- WriteTests (&quot;calc : &quot;, true, MainFileChannel)
- end if
- if bMakeImpressTest then
- WriteTests (&quot;impress : &quot;, true, MainFileChannel)
- end if
- if bMakeDrawTest then
- WriteTests (&quot;draw : &quot;, true, MainFileChannel)
- end if
- if bMakeHTMLTest then
- WriteTests (&quot;HTML : &quot;, true, MainFileChannel)
- end if
- if bMakeChartTest then
- WriteTests (&quot;chart : &quot;, false, MainFileChannel)
- end if
- if bMakeMathTest then
- WriteTests (&quot;math : &quot;, false, MainFileChannel)
- end if
- if bMakeJavaTest then
- WriteTests (&quot;Java : &quot;, false, MainFileChannel)
- end if
- if bMakeDBTest then
- WriteDBTests (&quot;Database : &quot;, MainFileChannel)
- end if
- if bMakeExtensionTest then
- WriteExtensionTests (&quot;Extension : &quot;, MainFileChannel)
- end if
-
- Print #MainFileChannel
-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 bMakeSaveOpen8Test then
- sWriteStr = sWriteStr + &quot;, save 8.0&quot;
- end if
- if bMakeSaveOpenXMLTest then
- sWriteStr = sWriteStr + &quot;, save XML&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
- 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
- Dim oDoc as Object
- Dim sFileNameXML$, sFileName8$
- Dim bSuccess as Boolean
-
- On Local Error GoTo DOCTESTERROR
- gCurrentTestCase = cLogfileFailed
- LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest))
- gCurrentTestCase = cDocNew
- oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(gCurrentDocTest or cFltNewDoc))
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, not IsNull (oDoc) )
- if not IsNull (oDoc) then
- gCurrentTestCase = cDocSaveOpen8
- if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then
- sFileName8 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(gCurrentDocTest or cFlt8)
- SaveDoc (sFileName8, oDoc, GetDocFilter(gCurrentDocTest or cFlt8))
- end if
- gCurrentTestCase = cDocSaveOpenXML
- if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then
- sFileNameXML = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(gCurrentDocTest or cFltXML)
- SaveDoc (sFileNameXML, oDoc, GetDocFilter(gCurrentDocTest or cFltXML))
- end if
- gCurrentTestCase = cDocClose
- bSuccess = CloseDoc( oDoc )
- LogTestResult( GetDocFilter(gCurrentDocTest)+&quot; &quot;+ cMessageCloseDoc, bSuccess )
- gCurrentTestCase = cDocSaveOpen8
- if bMakeSaveOpen8Test and IsFilterAvailable (gCurrentDocTest or cFlt8) then
- oDoc = LoadDoc (sFileName8)
-
-&apos; oDoc = Documents.open(sFileName)
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen8Doc, not IsNull (oDoc) )
-
- if not IsNull (oDoc) then
- gCurrentTestCase = cDocClose
- oDoc.close (true)
- end If
- end if
-
- gCurrentTestCase = cDocSaveOpenXML
- if bMakeSaveOpenXMLTest and IsFilterAvailable (gCurrentDocTest or cFltXML) then
- oDoc = LoadDoc (sFileNameXML)
-
-&apos; oDoc = Documents.open(sFileName)
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpenXMLDoc, not IsNull (oDoc) )
-
- if not IsNull (oDoc) then
- gCurrentTestCase = cDocClose
- oDoc.close (true)
- end If
- end if
-
- end If
- Print #LocalFileChannel, &quot;---&quot;
- Close #LocalFileChannel%
- LocalFileChannel = 0
- Exit Sub &apos; Without error
-
- DOCTESTERROR:
- If ( gCurrentTestCase = cLogfileFailed ) then
- LogTestResult( "", False )
- Exit Sub
- else
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(gCurrentTestCase), False )
- Close #LocalFileChannel%
- LocalFileChannel = 0
- End If
- Exit Sub &apos; With error
-End Sub
-
-Sub MakeNewDoc
- DIM oDoc as Object
- Dim bSuccess as Boolean
- On Local Error GoTo DOCTESTERROR2
- gCurrentTestCase = cLogfileFailed
- LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest))
- gCurrentTestCase = cDocNew
-&apos; oDoc = Documents.Add(GetDocFilter(gCurrentDocTest))
- oDoc = LoadDoc (&quot;private:factory/&quot; + GetDocFilter(gCurrentDocTest or cFltNewDoc))
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, not IsNull (oDoc) )
- if not IsNull (oDoc) then
- gCurrentTestCase = cDocClose
- bSuccess = CloseDoc( oDoc )
- LogTestResult( GetDocFilter(gCurrentDocTest)+&quot; &quot;+ cMessageCloseDoc, bSuccess )
- end If
- Print #LocalFileChannel, &quot;---&quot;
- Close #LocalFileChannel%
- LocalFileChannel = 0
- Exit Sub &apos; Without error
-
- DOCTESTERROR2:
- If ( gCurrentTestCase = cLogfileFailed ) then
- LogTestResult( "", False )
- Exit Sub
- else
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(gCurrentTestCase), False )
- Close #LocalFileChannel%
- LocalFileChannel = 0
- End If
- Exit Sub &apos; With error
-End Sub
-
-Sub MakeChartTest
- 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 bSuccess as Boolean
- On Local Error GoTo CHARTTESTERROR
- gCurrentTestCase = cLogfileFailed
- LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest))
- gCurrentTestCase = 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)
- bSuccess=oCharts.HasByName(cChartName)
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, bSuccess )
- gCurrentTestCase = cDocClose
- oDoc.close (true)
- else
- LogTestResult( GetDocFilter(frmCalc or cFltNewDoc)+&quot; &quot;+ cMessageNewDoc, FALSE )
- End if
- Print #LocalFileChannel, &quot;---&quot;
- Close #LocalFileChannel%
- LocalFileChannel = 0
- Exit Sub &apos; Without error
-
- CHARTTESTERROR:
- If ( gCurrentTestCase = cLogfileFailed ) then
- LogTestResult( "", False )
- Exit Sub
- else
- LogTestResult( GetDocFilter(gCurrentDocTest or cFltNewDoc)+&quot; &quot;+ GetErrorMessage(gCurrentTestCase), FALSE )
- Close #LocalFileChannel%
- LocalFileChannel = 0
- 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 cFltXML
- GetDocEndings = &quot;html&quot; &apos;Hypertext-Dokument
- 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; text document
- case frmCalc or cFlt8
- GetDocFilter = &quot;calc8&quot; &apos; spreadsheet document
- case frmImpress or cFlt8
- GetDocFilter = &quot;impress8&quot; &apos; presentation
- case frmDraw or cFlt8
- GetDocFilter = &quot;draw8&quot; &apos; drawing
- case frmMath or cFlt8
- GetDocFilter = &quot;math8&quot; &apos; formula
-
- case frmWriter or cFltXML
- GetDocFilter = &quot;StarOffice XML (Writer)&quot; &apos; text document
- case frmCalc or cFltXML
- GetDocFilter = &quot;StarOffice XML (Calc)&quot; &apos; spreadsheet document
- case frmImpress or cFltXML
- GetDocFilter = &quot;StarOffice XML (Impress)&quot; &apos; presentation
- case frmDraw or cFltXML
- GetDocFilter = &quot;StarOffice XML (Draw)&quot; &apos; drawing
- case frmMath or cFltXML
- GetDocFilter = &quot;StarOffice XML (Math)&quot; &apos; formula
-
- case frmHyperText, frmHyperText or cFltXML
- GetDocFilter = &quot;HTML&quot; &apos; HTML document
-
- case frmWriter or cFltNewDoc
- GetDocFilter = &quot;swriter&quot; &apos; text document
- case frmCalc or cFltNewDoc
- GetDocFilter = &quot;scalc&quot; &apos; spreadsheet document
- case frmImpress or cFltNewDoc
- GetDocFilter = &quot;simpress&quot; &apos; presentation
- case frmDraw or cFltNewDoc
- GetDocFilter = &quot;sdraw&quot; &apos; drawing
- case frmMath or cFltNewDoc
- GetDocFilter = &quot;smath&quot; &apos; formula
- case frmHyperText or cFltNewDoc
- GetDocFilter = &quot;swriter/web&quot; &apos; HTML document
- case frmChart or cFltNewDoc
- GetDocFilter = &quot;schart&quot; &apos; chart
- case else
- GetDocFilter = &quot;&quot;
- end Select
-end Function
-
-Function GetLogFileName (DocType as Integer) as String
- Select Case ( DocType )
- case frmWriter
- GetLogFileName = sSWLogFileName &apos; text document
- case frmCalc
- GetLogFileName = sSCLogFileName &apos; spreadsheet document
- case frmImpress
- GetLogFileName = sSDLogFileName &apos; presentation
- case frmDraw
- GetLogFileName = sSDrawLogFileName &apos; drawing
- case frmMath
- GetLogFileName = sSMathLogFileName &apos; formula
- case frmHyperText
- GetLogFileName = sSHptLogFileName &apos; HTML document
- case frmChart
- GetLogFileName = sSChartLogFileName &apos; chart
- case frmJava
- GetLogFileName = sJavaLogFileName &apos;Java
- case frmOther
- GetLogFileName = sTestGlueLogFileName &apos; test framework
- 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 cDocSaveOpen8
- GetErrorMessageOnAction = cMessageSaveOpen8Doc
- case cDocSaveOpenXML
- GetErrorMessageOnAction = cMessageSaveOpenXMLDoc
- 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 cFltXML))) then
- IsFilterAvailable = false
- end if
-End Function
-
-Function TestJava
- Dim oObj as Object
- gCurrentTestCase = cLogfileFailed
- LocalFileChannel% = OpenLogDat (GetLogFileName(gCurrentDocTest))
- gCurrentTestCase = cDocNew
- oObj = createUnoService( cUnoJavaLoader )
- LogTestResult( &quot;Java &quot;+ cMessageNewDoc, not IsNull (oObj) )
-
- Print #LocalFileChannel, &quot;---&quot;
- Close #LocalFileChannel%
- LocalFileChannel = 0
-
- TestJava = not IsNull (oObj)
-End Function
-
-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
-
-Function CloseDoc( oDoc as Object )
- Dim oListener as Object
- oListener = CreateUnoListener( "Events.closeListener_", "com.sun.star.util.XCloseListener" )
- oDoc.addCloseListener( oListener )
-
- Events.ResetCloseListenerFlag()
- oDoc.close( true )
- closeDoc = Events.HasCloseListenerBeenCalled()
-
- if ( Not Events.HasCloseListenerBeenCalled() ) Then
- &apos; do this only if closing was not successful - otherwise, we'd get a DisposedException
- oDoc.removeCloseListener( oListener )
- End If
-End Function
-</script:module>