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