1: 2:The first three lines are XML header. You should pay attention with script name 3: 4: 5:<?xml version="1.0" encoding="UTF-8"?> 6:<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 7:<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sw_SwXBodyText" script:language="StarBasic"> 8: 9:The GNU header 10: 11:'************************************************************************* 12:'* 13:CVS-Tags 14:'* 15:'* $RCSfile: sw_SwXBodyText.html,v $ 16:'* 17:'* $Revision: 1.1 $ 18:'* 19:'* last change:$Date: 2004/03/10 16:30:27 $ 20:'* 21:'* The Contents of this file are made available subject to the terms of 22:'* either of the following licenses 23:'* 24:'* - GNU Lesser General Public License Version 2.1 25:'* - Sun Industry Standards Source License Version 1.1 26:'* 27:'* Sun Microsystems Inc., October, 2000 28:'* 29:'* GNU Lesser General Public License Version 2.1 30:'* ============================================= 31:'* Copyright 2000 by Sun Microsystems, Inc. 32:'* 901 San Antonio Road, Palo Alto, CA 94303, USA 33:'* 34:'* This library is free software; you can redistribute it and/or 35:'* modify it under the terms of the GNU Lesser General Public 36:'* License version 2.1, as published by the Free Software Foundation. 37:'* 38:'* This library is distributed in the hope that it will be useful, 39:'* but WITHOUT ANY WARRANTY; without even the implied warranty of 40:'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 41:'* Lesser General Public License for more details. 42:'* 43:'* You should have received a copy of the GNU Lesser General Public 44:'* License along with this library; if not, write to the Free Software 45:'* Foundation, Inc., 59 Temple Place, Suite 330, Boston, 46:'* MA 02111-1307 USA 47:'* 48:'* 49:'* Sun Industry Standards Source License Version 1.1 50:'* ================================================= 51:'* The contents of this file are subject to the Sun Industry Standards 52:'* Source License Version 1.1 (the "License"); You may not use this file 53:'* except in compliance with the License. You may obtain a copy of the 54:'* License at http://www.openoffice.org/license.html. 55:'* 56:'* Software provided under this License is provided on an "AS IS" basis, 57:'* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, 58:'* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, 59:'* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. 60:'* See the License for the specific provisions governing your rights and 61:'* obligations concerning the Software. 62:'* 63:'* The Initial Developer of the Original Code is: Sun Microsystems, Inc. 64:'* 65:'* Copyright: 2000 by Sun Microsystems, Inc. 66:'* 67:'* All Rights Reserved. 68:'* 69:'* Contributor(s): _______________________________________ 70:'* 71:'* 72:'************************************************************************* 73:'************************************************************************* 74: 75:use "option explicit" to define all local variables 76:option explicit 77: 78: 79: 80: 81:' REQUIRED VARIABLES for interface/service tests: 82:if some interfaces need additional parameters, define them here 83: 84:'Required for com.sun.star.text.XText 85:Global oCollection As Object 86:Global oInstance As Object 87:Global aAddons() 88: 89:Sub CreateObj() 90: 91:'************************************************************************* 92:' COMPONENT: 93:' sw.SwXBodyText 94:'************************************************************************* 95:On Error Goto ErrHndl 96:oDoc and cObjectName are already defined as Global variables. cObject 97:contains the name of the object. oDoc is used to store a reference to the 98:document that will be disposed during object disposing automatically. 99: 100: Dim bOK As Boolean 101: bOK = true 102: 103:The function createDocument() from module utils of BasicBridge.sxw is 104:used to create a writer document. 105: 106: oDoc = utils.createDocument("swriter", cObjectName) 107: 108:the global variable oObj should be set to object hat should be tested 109: 110: oObj = oDoc.Text 111: 112:creation of global objects for specific interface tests 113: 114: oInstance = oDoc.createInstance("com.sun.star.text.TextTable") 115: oInstance.initialize(5, 5) 116: 117: oCollection = oDoc.TextTables 118: 119: 120:Exit Sub 121:In case of exceptions, function Exception from module Test is used to 122:pass information to Java # 123:ErrHndl: 124: Test.Exception() 125:End Sub 126:</script:module>