1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/******************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description : Import BASIC library (flat)
32 '\******************************************************************************
34 testcase tBasicLibraryImport
36 printlog( "Import a BASIC library" )
39 const LIBRARIES_TAB = 3
40 const STANDARD_LIBRARY = 1
42 const XLB_DIALOG_FILE = "dialog.xlb"
45 dim iCurrentLib as integer
47 dim cPath as string : cPath = hGetWorkPath() & LIBRARY_NAME
52 MakroAus.Select( MY_MACROS )
56 hSelectBasicObjectOrganizerTab( LIBRARIES_TAB )
58 printlog( "Select My macros" )
59 kontext "TabBibliotheken"
60 Bibliothek.select( STANDARD_LIBRARY )
62 printlog( "Click to add a library" )
65 printlog( "Enter the name of the library: " & LIBRARY_NAME )
67 DateiName.setText( LIBRARY_NAME )
69 printlog( "Step into the directory" )
70 OeffnenDlg.typeKeys( "<RETURN>" )
72 printlog( "Enter "dialog.xlb"" )
73 DateiName.setText( XLB_DIALOG_FILE )
75 printlog( "Open " & XLB_DIALOG_FILE )
79 if ( active.exists( 1 ) ) then
80 if ( active.getRT() <> 373 ) then
81 warnlog( "Autocompletion failed: " & Active.getText() )
84 DateiName.setText( XLB_DIALOG_FILE )
89 printlog( "Confirm to append the library" )
90 Kontext "AppendLibraries"
93 printlog( "Select the new library" )
94 kontext "TabBibliotheken"
95 for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
96 Bibliotheksliste.select( iCurrentLib )
97 if ( Bibliotheksliste.getSelText = LIBRARY_NAME ) then
102 printlog( "Delete the library, confirm with YES" )
103 Kontext "TabBibliotheken"
107 if ( Active.exists( 1 ) ) then
110 warnlog( "Deletion warning for libraries is missing" )
113 printlog( "Close macro/library organizer" )
114 kontext "TabBibliotheken"
115 TabBibliotheken.cancel()
117 printlog( "Close macro organizer" )
123 hDeleteFile( cPath & GetPathSeparator & XLB_DIALOG_FILE )
124 hDeleteFile( cPath & GetPathSeparator & "Module1.xba" )
125 hDeleteFile( cPath & GetPathSeparator & "script.xlb" )
126 rmdir( cPath ) : printlog( "Remove directory" )