1 'encoding UTF-8 Do not remove or change this line!
\r
2 '**************************************************************************
\r
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
\r
5 '* Copyright 2008 by Sun Microsystems, Inc.
\r
7 '* OpenOffice.org - a multi-platform office productivity suite
\r
9 '* $RCSfile: misc_RegisterDatabase.inc,v $
\r
13 '* last change: $Author: jsi $ $Date: 2008/06/16 07:43:42 $
\r
15 '* This file is part of OpenOffice.org.
\r
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
\r
18 '* it under the terms of the GNU Lesser General Public License version 3
\r
19 '* only, as published by the Free Software Foundation.
\r
21 '* OpenOffice.org is distributed in the hope that it will be useful,
\r
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
24 '* GNU Lesser General Public License version 3 for more details
\r
25 '* (a copy is included in the LICENSE file that accompanied this code).
\r
27 '* You should have received a copy of the GNU Lesser General Public License
\r
28 '* version 3 along with OpenOffice.org. If not, see
\r
29 '* <http://www.openoffice.org/license.html>
\r
30 '* for a copy of the LGPLv3 License.
\r
32 '/************************************************************************
\r
34 '* owner : marc.neumann@sun.com
\r
36 '* short description : macros in databases
\r
38 '\***********************************************************************
\r
42 printlog "------------------- misc_Macros.inc ------------------------"
\r
47 '-------------------------------------------------------------------------
\r
50 hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
\r
52 dim sFileName as String
\r
53 sFileName = ConvertPath(gOfficePath + "/user/work/hsql_macros_in_subdocument.odb")
\r
54 app.FileCopy ConvertPath(gTesttoolPath + "/dbaccess/optional/input/hsql_datasource/hsql_macros_in_subdocument.odb"), ConvertPath(gOfficePath + "/user/work/hsql_macros_in_subdocument.odb")
\r
56 ' delete the backup file
\r
57 if fileexists(sFileName + "backup.odb") then
\r
58 app.kill sFileName + "backup.odb"
\r
63 Kontext "OeffnenDlg"
\r
64 '/// open the given file
\r
65 printlog "open the file: " + sFileName
\r
66 Dateiname.SetText sFileName
\r
71 printlog "check if the subdocument contains macros dialog appear"
\r
72 Kontext "MessageBox"
\r
73 if (MessageBox.exists(1)) then
\r
76 warnlog "the subdocument contains macros dialog does not appear"
\r
83 Kontext "MacroMigration"
\r
84 if not (MacroMigration.exists(1)) then
\r
85 warnlog "MacroMigration wizard does not appear"
\r
90 DatabaseFile.settext sFileName + "backup.odb"
\r
98 printlog "open the database again to see if the message box appear again"
\r
102 Kontext "OeffnenDlg"
\r
103 '/// open the given file
\r
104 printlog "open the file: " + sFileName
\r
105 Dateiname.SetText sFileName
\r
110 Kontext "MessageBox"
\r
111 if (MessageBox.exists(1)) then
\r
112 warnlog "MessageBox about macros appear. Should not after migration."
\r
117 call fCloseDatabase
\r
119 hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
\r