merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / basic / mod / defreg / NestedRegistry / defreg_NestedRegistry.xba
blob3a4098dba065855068bf7eccdc9e2098aa8c4df5
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="defreg_NestedRegistry" script:language="StarBasic">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 '
10 ' Copyright 2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: defreg_NestedRegistry.xba,v $
16 ' $Revision: 1.3 $
18 ' This file is part of OpenOffice.org.
20 ' OpenOffice.org is free software: you can redistribute it and/or modify
21 ' it under the terms of the GNU Lesser General Public License version 3
22 ' only, as published by the Free Software Foundation.
24 ' OpenOffice.org is distributed in the hope that it will be useful,
25 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ' GNU Lesser General Public License version 3 for more details
28 ' (a copy is included in the LICENSE file that accompanied this code).
30 ' You should have received a copy of the GNU Lesser General Public License
31 ' version 3 along with OpenOffice.org. If not, see
32 ' <http://www.openoffice.org/license.html>
33 ' for a copy of the LGPLv3 License.
35 '*************************************************************************
36 '*************************************************************************
40 ' Be sure that all variables are dimensioned:
41 option explicit
44 ' REQUIRED VARIABLES for interface/service tests:
46 ' Requiered for com.sun.star.lang.XInitialization
47 Global aInitArgs As Variant
49 Global oReg1 As Object
50 Global oReg2 As Object
53 Sub CreateObj()
55 '*************************************************************************
56 ' COMPONENT:
57 ' defreg.NestedRegistry
58 '*************************************************************************
59 On Error Goto ErrHndl
60 Dim cURL1 As String
61 Dim cURL2 As String
63 oObj = createUnoService("com.sun.star.registry.NestedRegistry")
65 oReg1 = createUnoService("com.sun.star.registry.SimpleRegistry")
66 oReg2 = createUnoService("com.sun.star.registry.SimpleRegistry")
67 cURL1 = utils.getTempFileURL("BAS_forNestedRegistry1.rdb")
68 cURL2 = utils.getTempFileURL("BAS_forNestedRegistry2.rdb")
70 if FileExists(cURL1) then
71 kill(cURL1)
72 end if
74 if FileExists(cURL2) then
75 kill(cURL2)
76 end if
78 oReg1.open(cURL1, true, true)
79 oReg2.open(cURL2, false, true)
81 Dim aArgs(1) As Object
82 aArgs(0) = oReg1
83 aArgs(1) = oReg2
85 aInitArgs = aArgs()
87 oObj.initialize(aInitArgs())
89 Exit Sub
90 ErrHndl:
91 Test.Exception()
92 End Sub
94 Sub DisposeObj()
95 oReg1.close()
96 oReg2.close()
97 End Sub
98 </script:module>