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