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 : Delete modules while BASIC is running
32 '\******************************************************************************
34 testcase tDeleteModulesAtRunningBasic
36 printlog( "Delete BASIC module while BASIC is running" )
38 const RAISE_MESSAGEBOX = 1
42 dim iMenuItemCount as integer
44 printlog( "Open a new writer-doc" )
45 gApplication = "WRITER"
48 printlog( "Open the BASIC Organizer" )
51 printlog( "Create a new module for the current document" )
52 brc = hCreateModuleForDoc()
54 warnlog( "Unable to create a basic module for the document" )
58 printlog( "Insert a short script (1. page)" )
59 brc = hInsertMacro( RAISE_MESSAGEBOX )
61 warnlog( "Unable to create a basic module for the document" )
66 printlog( "Click button: Step Procedure" )
68 if ( WaitSlot( MAX_WAIT ) <> WSFinished ) then
69 warnlog( "Slot not finished, timeout reached" )
73 printlog( "Check if disabled menu items are shown in context menu and 'delete' is not shown" )
74 Tabbar.OpenContextMenu()
77 iMenuItemCount = hMenuItemGetCount()
79 select case ( iMenuItemCount )
80 case 2 : printlog( "Correct number of items in menu: " & iMenuItemCount )
81 case 3 : warnlog ( "Delete is active in context menu for a running macro => BUG!" )
82 case 5 : warnlog ( "#i101972# - Disabled entries are shown in context menu on tab bar" )
83 case else : warnlog ( "Incorrect itemcount in context menu: " & iMenuItemCount )
86 warnlog( "Unable to retrieve the number of menuitems" )
90 printlog( "Stop the running script" )
94 if ( WaitSlot( MAX_WAIT ) <> WSFinished ) then
95 warnlog( "Slot not finished, timeout reached" )