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__FillProperties" 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
32
33Sub RunTest()
34
35'*************************************************************************
36' SERVICE:
37' com.sun.star.drawing.FillProperties
38'*************************************************************************
39On Error Goto ErrHndl
40    Dim bOK As Boolean
41
42
43    PropertyTester.TestProperty("FillStyle")
44    oObj.FillStyle = com.sun.star.drawing.FillStyle.SOLID
45
46    PropertyTester.TestProperty("FillColor")
47
48    PropertyTester.TestProperty("FillTransparence")
49
50    Dim aTranspNames(1) As String
51    aTranspNames(0) = "Transparency 2"
52    aTranspNames(1) = "Transparency 1"
53    PropertyTester.TestProperty("FillTransparenceGradientName", aTranspNames())
54
55    PropertyTester.TestProperty("FillTransparenceGradient")
56
57    Dim aGradientNames(1) As String
58    aGradientNames(0) = "Gradient 2"
59    aGradientNames(1) = "Gradient 1"
60    PropertyTester.TestProperty("FillGradientName", aGradientNames())
61
62    PropertyTester.TestProperty("FillGradient")
63
64    Dim aHatchNames(1) As String
65    aHatchNames(0) = "Black 0 Degrees"
66    aHatchNames(1) = "Black 45 Degrees"
67    PropertyTester.TestProperty("FillHatchName", aHatchNames())
68
69    PropertyTester.TestProperty("FillHatch")
70
71    Dim aBitmapNames(1) As String
72    aBitmapNames(0) = "Sky"
73    aBitmapNames(1) = "Metal"
74    PropertyTester.TestProperty("FillBitmapName", aBitmapNames())
75
76    PropertyTester.TestProperty("FillBitmap")
77
78    Test.StartMethod("FillBitmapURL")
79    Dim sURL1 As String
80    Dim sURL2 As String
81    oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) &amp; "crazy-blue.jpg")
82    sURL1 = oObj.getPropertyValue("FillBitmapURL")
83    oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) &amp; "space-metal.jpg")
84    sURL2 = oObj.getPropertyValue("FillBitmapURL")
85    Test.MethodTested("FillBitmapURL", sURL1 &lt;&gt; sURL2)
86
87    Dim aOffsets(1) As Integer
88    aOffsets(0) = 10
89    aOffsets(1) = -10
90    PropertyTester.TestProperty("FillBitmapOffsetX", aOffsets())
91
92    PropertyTester.TestProperty("FillBitmapOffsetY", aOffsets())
93
94    PropertyTester.TestProperty("FillBitmapPositionOffsetX", aOffsets())
95
96    PropertyTester.TestProperty("FillBitmapPositionOffsetY", aOffsets())
97
98    PropertyTester.TestProperty("FillBitmapRectanglePoint")
99
100    PropertyTester.TestProperty("FillBitmapLogicalSize")
101
102    PropertyTester.TestProperty("FillBitmapSizeX")
103
104    PropertyTester.TestProperty("FillBitmapSizeY")
105
106    PropertyTester.TestProperty("FillBitmapMode")
107
108    PropertyTester.TestProperty("FillBackground")
109
110Exit Sub
111ErrHndl:
112    Test.Exception()
113    bOK = false
114    resume next
115End Sub
116</script:module>
117