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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: basic_modulehide.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : joerg.skottke@sun.com
36 '* short description : Verify that hiding modules works
38 '\******************************************************************************
40 testcase tBasicIdeModuleHide
42 '///<h1>Hiding modules (make them invisible)</h1>
45 const CFN = "tBasicIdeModuleHide::"
49 dim cDefaultTabName as string
51 gApplication = "WRITER"
54 '///<li>Create a new BASIC module for the current (writer) document</li>
55 brc = hOpenBasicOrganizerFromDoc()
56 brc = hCreateModuleForDoc()
58 '///<li>Write a macro (one that is unique to all modules)</li>
59 brc = hInsertMacro( 1 )
61 printlog( CFN & "Macro has been written successfully" )
63 warnlog( CFN & "Failed to insert macro" )
66 '///<li>Hide the module using the Tab-Bar's context menu</li>
69 warnlog( "Some unexpected error occurred while trying to hide the module" )
72 '///<li>Verify if the module is really hidden.</li>
74 ' hTestMacro is expected to fail, so we jump to the catch statement
77 warnlog( "For some reason the original module is still visible" )
79 warnlog( "There should not be any editingwindow visible" )
82 printlog( " * unable to locate editwindow -> no module visible." )
85 '///<li>Open the BASIC organizer and select the hidden module</li>
86 if ( hOpenBasicObjectOrganizer( 1 ) ) then
88 modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" )
89 '///<li>Click 'Edit' to open the module in the IDE</li>
93 warnlog( "#i35097# Crash when editing last module" )
97 '///<li>Verify that the correct module is visible</li>
100 printlog( " * the correct macro-module is open. Good." )
102 warnlog( "The open macro-module is not the one that was expected" )
105 '///<li>Close IDE and document</li>
108 call hCloseDocument()
112 warnlog( "restarting the office to recover from errors" )
113 call exitRestartTheOffice()