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_TableChartsEnumeration" 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_TableChartsEnumeration
42'*************************************************************************
43On Error Goto ErrHndl
44    Dim bOK As Boolean
45    Dim oSheet As Object
46    Dim i as Integer,j As Integer
47	Dim oCharts as Object
48
49    bOK = true
50    oDoc = utils.createDocument("scalc", cObjectName)
51    oSheet = oDoc.Sheets(0)
52
53    ' Filling some cells with the text
54    for i = 1 to 6
55      oSheet.getCellByPosition(0, i).setString("Row" &amp; i)
56      oSheet.getCellByPosition(i, 0).setString("Col" &amp; i)
57    next i
58
59    for i = 1 to 6
60        for j = 1 to 6
61            oSheet.getCellByPosition(i, j).Value = (i + 1) * j
62        next j
63    next i
64
65    Dim tAddr As New com.sun.star.table.CellRangeAddress
66    tAddr.Sheet = 0
67    tAddr.StartRow = 0
68    tAddr.StartColumn = 0
69    tAddr.EndRow = 6
70    tAddr.EndColumn = 6
71
72    Dim tRect As New com.sun.star.awt.Rectangle
73    tRect.X = 200
74    tRect.Y = 200
75    tRect.Width = 10000
76    tRect.Height = 5000
77
78    oCharts = oSheet.getCharts()
79
80    Dim oRanges(0) As New com.sun.star.table.CellRangeAddress
81    oRanges(0) = tAddr
82    oCharts.addNewByName(cObjectName, tRect, oRanges(), true, true)
83
84	oObj = oCharts.createEnumeration()
85
86Exit Sub
87ErrHndl:
88    Test.Exception()
89End Sub
90</script:module>
91