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' Licensed to the Apache Software Foundation (ASF) under one 8' or more contributor license agreements. See the NOTICE file 9' distributed with this work for additional information 10' regarding copyright ownership. The ASF licenses this file 11' to you under the Apache License, Version 2.0 (the 12' "License"); you may not use this file except in compliance 13' with the License. You may obtain a copy of the License at 14' 15' http://www.apache.org/licenses/LICENSE-2.0 16' 17' Unless required by applicable law or agreed to in writing, 18' software distributed under the License is distributed on an 19' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20' KIND, either express or implied. See the License for the 21' specific language governing permissions and limitations 22' under the License. 23' 24'************************************************************************* 25 26 27 28 29 30' Be sure that all variables are dimensioned: 31option explicit 32 33 34' REQUIRED VARIABLES for interface/service tests: 35 36 37Sub CreateObj() 38 39'************************************************************************* 40' COMPONENT: 41' sc.ScIndexEnumeration_TableConditionalEntryEnumeration 42'************************************************************************* 43On Error Goto ErrHndl 44 45 Dim bOK As Boolean 46 Dim oSheet, oConditionalFormat As Object 47 48 bOK = true 49 oDoc = utils.createDocument("scalc", cObjectName) 50 51 oSheet = oDoc.Sheets(0) 52 oSheet.getCellByPosition(5, 5).Value = 15 53 oSheet.getCellByPosition(1, 4).Value = 10 54 oSheet.getCellByPosition(2, 0).Value = -5.15 55 56 oConditionalFormat = oSheet.getPropertyValue("ConditionalFormat") 57 58 Dim oCellAddress As New com.sun.star.table.CellAddress 59 oCellAddress.Sheet = 0 60 oCellAddress.Row = 1 61 oCellAddress.Column = 5 62 63 Dim oProps(4) As New com.sun.star.beans.PropertyValue 64 oProps(0).Name = "StyleName" 65 oProps(0).Value = "Result2" 66 oProps(1).Name = "Formula1" 67 oProps(1).Value = "$Sheet1.$B$5" 68 oProps(2).Name = "Formula2" 69 oProps(2).Value = "" 70 oProps(3).Name = "Operator" 71 oProps(3).Value = com.sun.star.sheet.ConditionOperator.EQUAL 72 oProps(4).Name = "SourcePosition" 73 oProps(4).Value = oCellAddress 74 75 oConditionalFormat.AddNew(oProps()) 76 77 oCellAddress.Sheet = 0 78 oCellAddress.Row = 1 79 oCellAddress.Column = 5 80 81 oProps(0).Name = "StyleName" 82 oProps(0).Value = "Result2" 83 oProps(1).Name = "Formula1" 84 oProps(1).Value = "$Sheet1.$B$3" 85 oProps(2).Name = "Formula2" 86 oProps(2).Value = "" 87 oProps(3).Name = "Operator" 88 oProps(3).Value = com.sun.star.sheet.ConditionOperator.EQUAL 89 oProps(4).Name = "SourcePosition" 90 oProps(4).Value = oCellAddress 91 92 oConditionalFormat.AddNew(oProps()) 93 94 oObj = oConditionalFormat.createEnumeration() 95 96 97Exit Sub 98ErrHndl: 99 Test.Exception() 100End Sub 101</script:module> 102