1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3<script:module xmlns:script="http://openoffice.org/2000/script" script:name="table_CellProperties" script:language="StarBasic"> 4 5 6'************************************************************************* 7' 8' Licensed to the Apache Software Foundation (ASF) under one 9' or more contributor license agreements. See the NOTICE file 10' distributed with this work for additional information 11' regarding copyright ownership. The ASF licenses this file 12' to you under the Apache License, Version 2.0 (the 13' "License"); you may not use this file except in compliance 14' with the License. You may obtain a copy of the License at 15' 16' http://www.apache.org/licenses/LICENSE-2.0 17' 18' Unless required by applicable law or agreed to in writing, 19' software distributed under the License is distributed on an 20' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21' KIND, either express or implied. See the License for the 22' specific language governing permissions and limitations 23' under the License. 24' 25'************************************************************************* 26 27 28 29 30 31' Be sure that all variables are dimensioned: 32option explicit 33 34 35Dim bOK As Boolean 36Dim oTB As Variant, oldVal As Variant 37Dim newVal As Variant, valToSet As Variant 38 39 40 41Sub RunTest() 42 43'************************************************************************* 44' SERVICE: 45' com.sun.star.table.CellProperties 46'************************************************************************* 47On Error Goto ErrHndl 48 Dim aCellStyles(1) As String 49 50 aCellStyles(0) = "Result" 51 aCellStyles(1) = "Default" 52 PropertyTester.TestProperty("CellStyle", aCellStyles()) 53 54 PropertyTester.TestProperty("CellBackColor") 55 56 PropertyTester.TestProperty("IsCellBackgroundTransparent") 57 58 Dim aNumberFormats(1) As Integer 59 aNumberFormats(0) = 2 60 aNumberFormats(1) = 1 61 PropertyTester.TestProperty("NumberFormat", aNumberFormats()) 62 63 PropertyTester.TestProperty("ShadowFormat") 64 65 PropertyTester.TestProperty("HoriJustify") 66 67 PropertyTester.TestProperty("VertJustify") 68 69 PropertyTester.TestProperty("Orientation") 70 71 PropertyTester.TestProperty("CellProtection") 72 73 Test.StartMethod("TableBorder") 74 75 Dim oTBNew As New com.sun.star.table.TableBorder 76 bOK = true 77 oldVal = oObj.TableBorder.Distance 78 Out.Log("value of 'TableBorder.Distance' before: "+oldVal) 79 oTBNew = oObj.TableBorder 80 Out.Log("setting value: "+ (oldVal + 20)) 81 oTBNew.Distance = oldVal + 20 82 oObj.setPropertyValue("TableBorder", oTBNew) 83 newVal = oObj.TableBorder.Distance 84 Out.Log("value of 'TableBorder.Distance' after: "+newVal) 85 bOK = bOK AND (newVal = oTBNew.Distance) 86 Test.MethodTested("TableBorder", bOK) 87 88 PropertyTester.TestProperty("IsTextWrapped") 89 90 Dim nRotate(1) As Integer 91 nRotate(0) = 30999 92 nRotate(1) = 4500 93 PropertyTester.TestProperty("RotateAngle",nRotate()) 94 95 PropertyTester.TestProperty("RotateReference") 96 97 PropertyTester.TestProperty("AsianVerticalMode") 98Exit Sub 99ErrHndl: 100 Test.Exception() 101 bOK = false 102 resume next 103End Sub 104</script:module> 105