1:The first three lines are XML header. You should pay attention with script name
   2:<?xml version="1.0" encoding="UTF-8"?>
   3:<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
   4:<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_CellProperties" script:language="StarBasic">
   5:
   6:The GNU header
   7:'*************************************************************************
   8:'*  CSV-Tags
   9:'*  $RCSfile: text_CellProperties.html,v $ 
  10:'*
  11:'*  $Revision: 1.1 $ 
  12:'*
  13:'*  last change:$Date: 2004/03/10 16:30:03 $ 
  14:'*
  15:'*  The Contents of this file are made available subject to the terms of
  16:'*  either of the following licenses
  17:'*
  18:'*         - GNU Lesser General Public License Version 2.1
  19:'*         - Sun Industry Standards Source License Version 1.1
  20:'*
  21:'*  Sun Microsystems Inc., October, 2000
  22:'*
  23:'*  GNU Lesser General Public License Version 2.1
  24:'*  =============================================
  25:'*  Copyright 2000 by Sun Microsystems, Inc.
  26:'*  901 San Antonio Road, Palo Alto, CA 94303, USA
  27:'*
  28:'*  This library is free software; you can redistribute it and/or
  29:'*  modify it under the terms of the GNU Lesser General Public
  30:'*  License version 2.1, as published by the Free Software Foundation.
  31:'*
  32:'*  This library is distributed in the hope that it will be useful,
  33:'*  but WITHOUT ANY WARRANTY; without even the implied warranty of
  34:'*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  35:'*  Lesser General Public License for more details.
  36:'*
  37:'*  You should have received a copy of the GNU Lesser General Public
  38:'*  License along with this library; if not, write to the Free Software
  39:'*  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  40:'*  MA  02111-1307  USA
  41:'*
  42:'*
  43:'*  Sun Industry Standards Source License Version 1.1
  44:'*  =================================================
  45:'*  The contents of this file are subject to the Sun Industry Standards
  46:'*  Source License Version 1.1 (the "License"); You may not use this file
  47:'*  except in compliance with the License. You may obtain a copy of the
  48:'*  License at http://www.openoffice.org/license.html.
  49:'*
  50:'*  Software provided under this License is provided on an "AS IS" basis,
  51:'*  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  52:'*  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  53:'*  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  54:'*  See the License for the specific provisions governing your rights and
  55:'*  obligations concerning the Software.
  56:'*
  57:'*  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  58:'*
  59:'*  Copyright: 2000 by Sun Microsystems, Inc.
  60:'*
  61:'*  All Rights Reserved.
  62:'*
  63:'*  Contributor(s): _______________________________________
  64:'*
  65:'*
  66:'*************************************************************************
  67:
  68:use "option explicit" to define all local variables
  69:option explicit  
  70:
  71:'*************************************************************************
  72:This Interface/Service test depends on the following GLOBAL variables,
  73:which must be specified in the object creation:
  74:This interface test depends on some variables which must created and
  75:filled at the object creation. In this case none.
  76:
  77:Sub RunTest()
  78:
  79:'*************************************************************************
  80:' SERVICE: 
  81:' com.sun.star.text.CellProperties
  82:'*************************************************************************
  83:On Error Goto ErrHndl
  84:    Dim bOK As Boolean
  85:The function TestProperty() from module PropertyTester of BasicBridge.sxw
  86:test the property
  87:    PropertyTester.TestProperty("BackColor")
  88:
  89:    PropertyTester.TestProperty("BackGraphicURL")
  90:
  91:    PropertyTester.TestProperty("BackGraphicFilter")
  92:
  93:    PropertyTester.TestProperty("BackGraphicLocation")
  94:
  95:    PropertyTester.TestProperty("NumberFormat")
  96:
  97:    PropertyTester.TestProperty("BackTransparent")
  98:
  99:    PropertyTester.TestProperty("LeftBorder")
 100:
 101:    PropertyTester.TestProperty("RightBorder")
 102:
 103:    PropertyTester.TestProperty("TopBorder")
 104:
 105:    PropertyTester.TestProperty("BottomBorder")
 106:
 107:    PropertyTester.TestProperty("LeftBorderDistance")
 108:
 109:    PropertyTester.TestProperty("RightBorderDistance")
 110:
 111:    PropertyTester.TestProperty("TopBorderDistance")
 112:
 113:    PropertyTester.TestProperty("BottomBorderDistance")
 114:
 115:    PropertyTester.TestProperty("UserDefinedAttributes")
 116:
 117:    PropertyTester.TestProperty("TextSection")
 118:if the property needs special test parameters you can them define here. In
 119:this case the property will be set at first to TRUE and finaly to FALSE.
 120:    Dim myParams(2) As Boolean
 121:    myParams(0) = true
 122:    myParams(1) = false
 123:    PropertyTester.TestProperty("IsProtected", myParams())
 124:
 125:    PropertyTester.TestProperty("CellName")
 126:
 127:    Dim orient(9) as Integer
 128:    orient(0) = com.sun.star.text.VertOrientation.NONE
 129:    orient(1) = com.sun.star.text.VertOrientation.TOP
 130:    orient(2) = com.sun.star.text.VertOrientation.CENTER
 131:    orient(3) = com.sun.star.text.VertOrientation.BOTTOM
 132:    orient(4) = com.sun.star.text.VertOrientation.CHAR_TOP
 133:    orient(5) = com.sun.star.text.VertOrientation.CHAR_CENTER
 134:    orient(6) = com.sun.star.text.VertOrientation.CHAR_BOTTOM
 135:    orient(7) = com.sun.star.text.VertOrientation.LINE_TOP
 136:    orient(8) = com.sun.star.text.VertOrientation.LINE_CENTER
 137:    orient(9) = com.sun.star.text.VertOrientation.LINE_BOTTOM
 138:this property accept only special values. An Array was filled with the
 139:values. PropertyTest now iterates over every index of the Array and set
 140:the values to the property. The test has OK status if all of the values 
 141:could set.
 142:    PropertyTester.TestProperty("VertOrient", orient())
 143:
 144:Exit Sub
 145:ErrHndl:
 146:    Test.Exception()
 147:    bOK = false
 148:    resume next
 149:End Sub
 150:</script:module>