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="text_TextTable" script:language="StarBasic"> 4 5 6'************************************************************************* 7' 8' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9' 10' Copyright 2000, 2010 Oracle and/or its affiliates. 11' 12' OpenOffice.org - a multi-platform office productivity suite 13' 14' This file is part of OpenOffice.org. 15' 16' OpenOffice.org is free software: you can redistribute it and/or modify 17' it under the terms of the GNU Lesser General Public License version 3 18' only, as published by the Free Software Foundation. 19' 20' OpenOffice.org is distributed in the hope that it will be useful, 21' but WITHOUT ANY WARRANTY; without even the implied warranty of 22' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23' GNU Lesser General Public License version 3 for more details 24' (a copy is included in the LICENSE file that accompanied this code). 25' 26' You should have received a copy of the GNU Lesser General Public License 27' version 3 along with OpenOffice.org. If not, see 28' <http://www.openoffice.org/license.html> 29' for a copy of the LGPLv3 License. 30' 31'************************************************************************* 32'************************************************************************* 33 34 35 36' Be sure that all variables are dimensioned: 37option explicit 38 39 40 41Sub RunTest() 42 43'************************************************************************* 44' SERVICE: 45' com.sun.star.text.TextTable 46'************************************************************************* 47On Error Goto ErrHndl 48 Dim bOK As Boolean 49 Dim border As Variant 50 Dim oldVal As Variant, newVal As Variant, getVal As Variant 51 52 53 PropertyTester.TestProperty("BreakType") 54 55 PropertyTester.TestProperty("LeftMargin") 56 57 PropertyTester.TestProperty("RightMargin") 58 59 PropertyTester.TestProperty("HoriOrient", Array( _ 60 com.sun.star.text.HoriOrientation.NONE, _ 61 com.sun.star.text.HoriOrientation.RIGHT, _ 62 com.sun.star.text.HoriOrientation.CENTER, _ 63 com.sun.star.text.HoriOrientation.LEFT, _ 64 com.sun.star.text.HoriOrientation.INSIDE, _ 65 com.sun.star.text.HoriOrientation.OUTSIDE, _ 66 com.sun.star.text.HoriOrientation.FULL, _ 67 com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH)) 68 69 PropertyTester.TestProperty("KeepTogether") 70 71 PropertyTester.TestProperty("Split") 72 73 PropertyTester.TestProperty("PageNumberOffset", Array(1, 2)) 74 75 PropertyTester.TestProperty("PageDescName", Array("First Page")) 76 77 PropertyTester.TestProperty("RelativeWidth", Array(50, 100)) 78 79 PropertyTester.TestProperty("RepeatHeadline") 80 81 PropertyTester.TestProperty("ShadowFormat") 82 83 PropertyTester.TestProperty("TopMargin") 84 85 PropertyTester.TestProperty("BottomMargin") 86 87 PropertyTester.TestProperty("BackTransparent") 88 89 PropertyTester.TestProperty("Width") 90 91 oldVal = oObj.ChartRowAsLabel 92 PropertyTester.TestProperty("ChartRowAsLabel") 93 oObj.ChartRowAsLabel = oldVal 94 95 oldVal = oObj.ChartColumnAsLabel 96 PropertyTester.TestProperty("ChartColumnAsLabel") 97 oObj.ChartColumnAsLabel = oldVal 98 99 border = oObj.TableBorder 100 oldVal = border.Distance 101 newVal = oldVal + 200 102 border.Distance = newVal 103 104 PropertyTester.TestProperty("TableBorder", Array(border)) 105 106 PropertyTester.TestProperty("TableColumnSeparators") 107 108 PropertyTester.TestProperty("TableColumnRelativeSum") 109 110 PropertyTester.TestProperty("BackColor") 111 112 PropertyTester.TestProperty("BackGraphicURL") 113 114 PropertyTester.TestProperty("BackGraphicFilter") 115 116 PropertyTester.TestProperty("BackGraphicLocation") 117 118 oObj.HoriOrient = com.sun.star.text.HoriOrientation.CENTER 119 oObj.RelativeWidth = 50 120 PropertyTester.TestProperty("IsWidthRelative", Array(FALSE)) 121 122Exit Sub 123ErrHndl: 124 Test.Exception() 125 bOK = false 126 resume next 127End Sub 128</script:module> 129