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="sc_ScIndexEnumeration_TableConditionalEntryEnumeration" script:language="StarBasic">
4
5'*************************************************************************
6'
7' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8'
9' Copyright 2000, 2010 Oracle and/or its affiliates.
10'
11' OpenOffice.org - a multi-platform office productivity suite
12'
13' This file is part of OpenOffice.org.
14'
15' OpenOffice.org is free software: you can redistribute it and/or modify
16' it under the terms of the GNU Lesser General Public License version 3
17' only, as published by the Free Software Foundation.
18'
19' OpenOffice.org is distributed in the hope that it will be useful,
20' but WITHOUT ANY WARRANTY; without even the implied warranty of
21' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22' GNU Lesser General Public License version 3 for more details
23' (a copy is included in the LICENSE file that accompanied this code).
24'
25' You should have received a copy of the GNU Lesser General Public License
26' version 3 along with OpenOffice.org.  If not, see
27' <http://www.openoffice.org/license.html>
28' for a copy of the LGPLv3 License.
29'
30'*************************************************************************
31'*************************************************************************
32
33
34
35' Be sure that all variables are dimensioned:
36option explicit
37
38
39' REQUIRED VARIABLES for interface/service tests:
40
41
42Sub CreateObj()
43
44'*************************************************************************
45' COMPONENT:
46' sc.ScIndexEnumeration_TableConditionalEntryEnumeration
47'*************************************************************************
48On Error Goto ErrHndl
49
50    Dim bOK As Boolean
51    Dim oSheet, oConditionalFormat As Object
52
53    bOK = true
54    oDoc = utils.createDocument("scalc", cObjectName)
55
56    oSheet = oDoc.Sheets(0)
57    oSheet.getCellByPosition(5, 5).Value = 15
58    oSheet.getCellByPosition(1, 4).Value = 10
59    oSheet.getCellByPosition(2, 0).Value = -5.15
60
61    oConditionalFormat = oSheet.getPropertyValue("ConditionalFormat")
62
63    Dim oCellAddress As New com.sun.star.table.CellAddress
64    oCellAddress.Sheet = 0
65    oCellAddress.Row = 1
66    oCellAddress.Column = 5
67
68    Dim oProps(4) As New com.sun.star.beans.PropertyValue
69    oProps(0).Name = "StyleName"
70    oProps(0).Value = "Result2"
71    oProps(1).Name = "Formula1"
72    oProps(1).Value = "$Sheet1.$B$5"
73    oProps(2).Name = "Formula2"
74    oProps(2).Value = ""
75    oProps(3).Name = "Operator"
76    oProps(3).Value = com.sun.star.sheet.ConditionOperator.EQUAL
77    oProps(4).Name = "SourcePosition"
78    oProps(4).Value = oCellAddress
79
80    oConditionalFormat.AddNew(oProps())
81
82    oCellAddress.Sheet = 0
83    oCellAddress.Row = 1
84    oCellAddress.Column = 5
85
86    oProps(0).Name = "StyleName"
87    oProps(0).Value = "Result2"
88    oProps(1).Name = "Formula1"
89    oProps(1).Value = "$Sheet1.$B$3"
90    oProps(2).Name = "Formula2"
91    oProps(2).Value = ""
92    oProps(3).Name = "Operator"
93    oProps(3).Value = com.sun.star.sheet.ConditionOperator.EQUAL
94    oProps(4).Name = "SourcePosition"
95    oProps(4).Value = oCellAddress
96
97    oConditionalFormat.AddNew(oProps())
98
99    oObj = oConditionalFormat.createEnumeration()
100
101
102Exit Sub
103ErrHndl:
104    Test.Exception()
105End Sub
106</script:module>
107