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="sch_ChartTitle" script:language="StarBasic">
4
5
6'*************************************************************************
7'
8'  Licensed to the Apache Software Foundation (ASF) under one
9'  or more contributor license agreements.  See the NOTICE file
10'  distributed with this work for additional information
11'  regarding copyright ownership.  The ASF licenses this file
12'  to you under the Apache License, Version 2.0 (the
13'  "License"); you may not use this file except in compliance
14'  with the License.  You may obtain a copy of the License at
15'
16'    http://www.apache.org/licenses/LICENSE-2.0
17'
18'  Unless required by applicable law or agreed to in writing,
19'  software distributed under the License is distributed on an
20'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21'  KIND, either express or implied.  See the License for the
22'  specific language governing permissions and limitations
23'  under the License.
24'
25'*************************************************************************
26
27
28
29
30
31' Be sure that all variables are dimensioned:
32option explicit
33
34' REQUIRED VARIABLES for interface/service tests:
35Global oComponentDoc As Object
36Global oComponentInstance As Object
37
38
39Sub CreateObj()
40
41'*************************************************************************
42' COMPONENT:
43' sch.ChartTitle
44'*************************************************************************
45On Error Goto ErrHndl
46
47    Dim oChart As Object
48	Dim oCompChart as Object
49
50    oDoc = utils.createDocument("scalc", cObjectName)
51    oChart = utils.createChartObject(oDoc, cObjectName)
52    oComponentDoc = utils.createDocument("scalc", cObjectName &amp; "1")
53    oCompChart = utils.createChartObject(oComponentDoc, cObjectName)
54
55    oChart.hasMainTitle = true
56    oObj = oChart.Title
57    oComponentInstance = oComponentDoc.Title
58Exit Sub
59ErrHndl:
60    Test.Exception()
61End Sub
62
63Sub FillCells()
64    Dim oRange As Object
65    Dim n1 As Integer
66    Dim n2 As Integer
67
68    oRange = oDoc.Sheets(0).getCellRangeByPosition(0, 0, nCol, nRow)
69
70    for n1 = 1 to nCol - 1
71        For n2 = 1 To nRow - 1
72            oRange.getCellByPosition(n1, n2).Value = n2 * (n1 + 1)
73        Next n2
74    next n1
75
76    for n1 = 1 to nCol - 1
77        oRange.getCellByPosition(n1, 0).String = "Col " + n1
78    next n1
79    for n2 = 1 to nRow - 1
80        oRange.getCellByPosition(0, n2).String = "Row " + n2
81    next n2
82End Sub
83
84Sub DisposeObj()
85    if NOT isNULL(oComponentDoc) then oComponentDoc.dispose()
86End Sub
87</script:module>
88