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_DDELinksEnumeration" 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: 35Global oTestDoc As Object 36 37Sub CreateObj() 38 39'************************************************************************* 40' COMPONENT: 41' sc.ScIndexEnumeration_DDELinksEnumeration 42'************************************************************************* 43On Error Goto ErrHndl 44 Dim testDoc, oF As String 45 Dim oSheet As Object 46 47 oDoc = utils.createDocument("scalc", cObjectName) 48 oSheet = oDoc.Sheets.getByIndex(0) 49 50 oTestDoc = utils.loadTestDocument("ScDDELinksObj.sdc") 51 52 ' This construction of 2-way convertion of testdocs location 53 ' should take place here, because there is unnecessary slash at the end of 54 ' cTestDocsDir. 55 testDoc = utils.URL2Path(utils.Path2URL(cTestDocsDir & "ScDDELinksObj.sdc")) 56 57 oF = "=DDE(""soffice"";""" & testDoc & """;""Sheet1.A1"")" 58 59 oSheet.getCellByPosition(1, 2).Formula = oF 60 oSheet.getCellByPosition(3, 4).Formula = oF 61 oSheet.getCellByPosition(5, 6).Formula = oF 62 63 oObj = oDoc.getPropertyValue("DDELinks").createEnumeration() 64 65Exit Sub 66ErrHndl: 67 Test.Exception() 68End Sub 69 70' close ScDDELinksObj.sdc 71Sub DisposeObj() 72 oTestDoc.dispose() 73end sub 74</script:module> 75