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_CellAnnotationsEnumeration" 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_CellAnnotationsEnumeration 42'************************************************************************* 43On Error Goto ErrHndl 44 45 Dim oSheets as Object, oSheet as Object 46 Dim oAnnotations as Object 47 Dim oCell1 as Object, oCell2 as Object 48 Dim oAnno1 as Object, oAnno2 As Object 49 50 oDoc = utils.createDocument("scalc", cObjectName) 51 52 ' get a sheet 53 oSheets = oDoc.getSheets() 54 oSheet = oSheets.getByIndex(0) 55 56 ' filling cells with values... 57 oSheet.getCellByPosition(5, 5).setValue(15) 58 oSheet.getCellByPosition(1, 4).setValue(10) 59 oSheet.getCellByPosition(2, 0).setValue(-5.15) 60 61 Out.Log("Creating two annotations...") 62 63 oCell1 = oSheet.getCellByPosition(3, 5) 64 oAnno1 = oCell1.Annotation 65 oAnno1.setString("ScAnnotationsObj Anno 1") 66 67 oCell2 = oSheet.getCellByPosition(3, 6) 68 oAnno2 = oCell2.Annotation 69 oAnno2.setString("ScAnnotationsObj Anno 2") 70 71 ' get annotations 72 oAnnotations = oSheet.getAnnotations() 73 74 oObj = oAnnotations.createEnumeration() 75 76Exit Sub 77ErrHndl: 78 Test.Exception() 79End Sub 80</script:module> 81