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 37' Be sure that all variables are dimensioned: 38option explicit 39 40 41 42Sub RunTest() 43 44'************************************************************************* 45' SERVICE: 46' com.sun.star.text.TextTable 47'************************************************************************* 48On Error Goto ErrHndl 49 Dim bOK As Boolean 50 Dim border As Variant 51 Dim oldVal As Variant, newVal As Variant, getVal As Variant 52 53 54 PropertyTester.TestProperty("BreakType") 55 56 PropertyTester.TestProperty("LeftMargin") 57 58 PropertyTester.TestProperty("RightMargin") 59 60 PropertyTester.TestProperty("HoriOrient", Array( _ 61 com.sun.star.text.HoriOrientation.NONE, _ 62 com.sun.star.text.HoriOrientation.RIGHT, _ 63 com.sun.star.text.HoriOrientation.CENTER, _ 64 com.sun.star.text.HoriOrientation.LEFT, _ 65 com.sun.star.text.HoriOrientation.INSIDE, _ 66 com.sun.star.text.HoriOrientation.OUTSIDE, _ 67 com.sun.star.text.HoriOrientation.FULL, _ 68 com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH)) 69 70 PropertyTester.TestProperty("KeepTogether") 71 72 PropertyTester.TestProperty("Split") 73 74 PropertyTester.TestProperty("PageNumberOffset", Array(1, 2)) 75 76 PropertyTester.TestProperty("PageDescName", Array("First Page")) 77 78 PropertyTester.TestProperty("RelativeWidth", Array(50, 100)) 79 80 PropertyTester.TestProperty("RepeatHeadline") 81 82 PropertyTester.TestProperty("ShadowFormat") 83 84 PropertyTester.TestProperty("TopMargin") 85 86 PropertyTester.TestProperty("BottomMargin") 87 88 PropertyTester.TestProperty("BackTransparent") 89 90 PropertyTester.TestProperty("Width") 91 92 oldVal = oObj.ChartRowAsLabel 93 PropertyTester.TestProperty("ChartRowAsLabel") 94 oObj.ChartRowAsLabel = oldVal 95 96 oldVal = oObj.ChartColumnAsLabel 97 PropertyTester.TestProperty("ChartColumnAsLabel") 98 oObj.ChartColumnAsLabel = oldVal 99 100 border = oObj.TableBorder 101 oldVal = border.Distance 102 newVal = oldVal + 200 103 border.Distance = newVal 104 105 PropertyTester.TestProperty("TableBorder", Array(border)) 106 107 PropertyTester.TestProperty("TableColumnSeparators") 108 109 PropertyTester.TestProperty("TableColumnRelativeSum") 110 111 PropertyTester.TestProperty("BackColor") 112 113 PropertyTester.TestProperty("BackGraphicURL") 114 115 PropertyTester.TestProperty("BackGraphicFilter") 116 117 PropertyTester.TestProperty("BackGraphicLocation") 118 119 oObj.HoriOrient = com.sun.star.text.HoriOrientation.CENTER 120 oObj.RelativeWidth = 50 121 PropertyTester.TestProperty("IsWidthRelative", Array(FALSE)) 122 123Exit Sub 124ErrHndl: 125 Test.Exception() 126 bOK = false 127 resume next 128End Sub 129</script:module> 130