1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"container_XHierarchicalName" script:
language=
"StarBasic">
4 '*************************************************************************
6 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 ' Copyright
2008 by Sun Microsystems, Inc.
10 ' OpenOffice.org - a multi-platform office productivity suite
12 ' $RCSfile: container_XHierarchicalName.xba,v $
16 ' This file is part of OpenOffice.org.
18 ' OpenOffice.org is free software: you can redistribute it and/or modify
19 ' it under the terms of the GNU Lesser General Public License version
3
20 ' only, as published by the Free Software Foundation.
22 ' OpenOffice.org is distributed in the hope that it will be useful,
23 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ' GNU Lesser General Public License version
3 for more details
26 ' (a copy is included in the LICENSE file that accompanied this code).
28 ' You should have received a copy of the GNU Lesser General Public License
29 ' version
3 along with OpenOffice.org. If not, see
30 '
<http://www.openoffice.org/license.html
>
31 ' for a copy of the LGPLv3 License.
33 '*************************************************************************
34 '*************************************************************************
36 ' This Interface/Service test depends on the followingobject relations
37 ' variables, which must be specified in the object creation:
39 ' ObjectRelation: oObjRelation(
0).Name =
"ElementName"
40 ' ObjectRelation: oObjRelation(
0).Value =
"MyAccessibleElementName"
41 ' ObjectRelation: oObjRelation(
1).Name =
"HierarchicalName"
42 ' ObjectRelation: oObjRelation(
1).Value =
"MyHierachicalName"
44 '*************************************************************************
46 ' Be sure that all variables are dimensioned:
51 '*************************************************************************
53 ' com.sun.star.container.XHierarchicalName
54 '*************************************************************************
58 Dim cElemName as Variant
59 cElemName = utils.getObjectRelation(
"ElementName")
60 if isNull(cElemName) then
61 out.log(
"Could not get relation 'ElenemtName' -> FALSE")
64 Dim cExpName as Variant
65 cExpName = utils.getObjectRelation(
"HierarchicalName")
66 if isNull(cExpName) then
67 out.log(
"Could not get relation 'HierarchicalName' -> FALSE")
70 Test.StartMethod(
"getHierarchicalName()")
73 cHName = oObj.getHierarchicalName()
75 result = instr(cHName, cExpName)
76 if len(result) =
0 then
77 olt.log(
"Getting: " + cHName +
" but expected it to start with " + _
81 Test.MethodTested(
"getHierarchicalName()", bOK)
83 Test.StartMethod(
"composeHierarchicalName()")
85 Dim gettedName as String
86 gettedName = oObj.composeHierarchicalName(cElemName)
87 result = instr(gettedName, cElemName)
88 if len(result) =
0 then
89 olt.log(
"Getting: " + gettedName +
" but expected it to start with " + _
93 Test.MethodTested(
"composeHierarchicalName()", bOK)