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