blob: 08e2dc27f61bac93f0fc933edbb178e4c241cdbb [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sch_ChartTitle" script:language="StarBasic">
'*************************************************************************
'
' Licensed to the Apache Software Foundation (ASF) under one
' or more contributor license agreements. See the NOTICE file
' distributed with this work for additional information
' regarding copyright ownership. The ASF licenses this file
' to you under the Apache License, Version 2.0 (the
' "License"); you may not use this file except in compliance
' with the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing,
' software distributed under the License is distributed on an
' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
' KIND, either express or implied. See the License for the
' specific language governing permissions and limitations
' under the License.
'
'*************************************************************************
' Be sure that all variables are dimensioned:
option explicit
' REQUIRED VARIABLES for interface/service tests:
Global oComponentDoc As Object
Global oComponentInstance As Object
Sub CreateObj()
'*************************************************************************
' COMPONENT:
' sch.ChartTitle
'*************************************************************************
On Error Goto ErrHndl
Dim oChart As Object
Dim oCompChart as Object
oDoc = utils.createDocument("scalc", cObjectName)
oChart = utils.createChartObject(oDoc, cObjectName)
oComponentDoc = utils.createDocument("scalc", cObjectName &amp; "1")
oCompChart = utils.createChartObject(oComponentDoc, cObjectName)
oChart.hasMainTitle = true
oObj = oChart.Title
oComponentInstance = oComponentDoc.Title
Exit Sub
ErrHndl:
Test.Exception()
End Sub
Sub FillCells()
Dim oRange As Object
Dim n1 As Integer
Dim n2 As Integer
oRange = oDoc.Sheets(0).getCellRangeByPosition(0, 0, nCol, nRow)
for n1 = 1 to nCol - 1
For n2 = 1 To nRow - 1
oRange.getCellByPosition(n1, n2).Value = n2 * (n1 + 1)
Next n2
next n1
for n1 = 1 to nCol - 1
oRange.getCellByPosition(n1, 0).String = "Col " + n1
next n1
for n2 = 1 to nRow - 1
oRange.getCellByPosition(0, n2).String = "Row " + n2
next n2
End Sub
Sub DisposeObj()
if NOT isNULL(oComponentDoc) then oComponentDoc.dispose()
End Sub
</script:module>