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="drawing_MeasureProperties" 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.drawing.MeasureProperties
41'*************************************************************************
42On Error Goto ErrHndl
43
44    Dim bOK As Boolean
45
46    PropertyTester.TestProperty("MeasureBelowReferenceEdge")
47
48    PropertyTester.TestProperty("MeasureHelpLine1Length")
49
50    PropertyTester.TestProperty("MeasureHelpLine2Length")
51
52    PropertyTester.TestProperty("MeasureHelpLineDistance")
53
54    PropertyTester.TestProperty("MeasureHelpLineOverhang")
55
56    Test.StartMethod("MeasureKind")
57    bOK = true
58
59    oObj.MeasureKind = com.sun.star.drawing.MeasureKind.STANDARD
60    bOK = bOK AND oObj.MeasureKind = com.sun.star.drawing.MeasureKind.STANDARD
61
62    oObj.MeasureKind = com.sun.star.drawing.MeasureKind.RADIUS
63    bOK = bOK AND oObj.MeasureKind = com.sun.star.drawing.MeasureKind.RADIUS
64
65    Test.MethodTested("MeasureKind", bOK)
66
67    PropertyTester.TestProperty("MeasureLineDistance")
68
69    PropertyTester.TestProperty("MeasureOverhang")
70
71    PropertyTester.TestProperty("MeasureShowUnit")
72
73    PropertyTester.TestProperty("MeasureTextAutoAngle")
74
75    PropertyTester.TestProperty("MeasureTextAutoAngleView")
76
77    PropertyTester.TestProperty("MeasureTextFixedAngle")
78
79    Test.StartMethod("MeasureTextHorizontalPosition")
80    bOK = true
81
82    oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.AUTO
83    bOK = bOK AND oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.AUTO
84
85    oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.LEFTOUTSIDE
86    bOK = bOK AND oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.LEFTOUTSIDE
87
88    Test.MethodTested("MeasureTextHorizontalPosition", bOK)
89
90    Test.StartMethod("MeasureTextVerticalPosition")
91    bOK = true
92
93    oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.AUTO
94    bOK = bOK AND oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.AUTO
95
96    oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.EAST
97    bOK = bOK AND oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.EAST
98
99    Test.MethodTested("MeasureTextVerticalPosition", bOK)
100
101    PropertyTester.TestProperty("MeasureTextIsFixedAngle")
102
103    PropertyTester.TestProperty("MeasureTextRotate90")
104
105    PropertyTester.TestProperty("MeasureTextUpsideDown")
106
107    PropertyTester.TestProperty("MeasureDecimalPlaces")
108
109Exit Sub
110ErrHndl:
111    Test.Exception()
112    bOK = false
113    resume next
114End Sub
115</script:module>
116