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: ch2_menu.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:38:53 $
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 : oliver.craemer@sun.com
36 '* short description : Resource Test for chart2 main menus
38 '**************************************************************************************************
40 ' #1 tMainMenu 'Checking the count of menu entries in each menu
42 '\*************************************************************************************************
45 dim iCount as integer ' the numbers of the items in the menu.
47 dim iMainMenuItemCount as integer
48 iMainMenuItemCount = 21 : if ( gPlatform = "osx" ) then iMainMenuItemCount = 20
50 dim iHelpMenuItemCount as integer
51 iHelpMenuItemCount = 5 : if ( gPlatform = "osx" ) then iHelpMenuItemCount = 4
53 printlog "Close all document windows (File / Close)"
54 Do Until GetDocumentCount = 0
57 printlog "File / New / Spreadsheet"
60 printlog "insert a Chart Object"
61 if fInsertOLE = FALSE then
62 warnlog "It was not possible to insert a chart as OLE."
65 Kontext "DocumentCalc"
67 printlog "check if there are 21 items in the FILE menu."
68 hMenuSelectNr(1) ' FILE
69 iCount = hMenuItemGetCount()
70 if (iCount <> iMainMenuItemCount ) then
71 warnlog "There should be 20 or 21 items in the file menu but there are " + iCount + " items."
73 call hMenuClose() ' close the FILE menu
75 printlog "check if there are 12 items in the FILE/NEW menu."
77 hMenuSelectNr(1) ' FILE
78 hMenuSelectNr(1) ' NEW
79 iCount = hMenuItemGetCount()
80 if (iCount <> 12) then
81 warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items."
83 call hMenuClose() ' close the FILE menu
85 printlog "check if there are 8 items in the FILE/AUTOPILOT menu."
87 hMenuSelectNr(1) ' FILE
88 hMenuSelectNr(4) ' AUTOPILOT
89 iCount = hMenuItemGetCount()
91 warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items."
95 printlog "check if there are 5 items in the EDIT menu."
98 iCount = hMenuItemGetCount()
100 warnlog "There should 5 items in the edit menu but there are " + iCount + " items."
104 printlog "check if there are 4 items in the VIEW menu."
107 iCount = hMenuItemGetCount()
108 if (iCount <> 4) then
109 warnlog "There should 4 items in the view menu but there are " + iCount + " items."
113 printlog "check if there are 4 items in the VIEW/TOOLBAR menu."
115 hMenuSelectNr(3) ' VIEW
116 hMenuSelectNr(1) ' TOOLBAR
117 iCount = hMenuItemGetCount()
118 if (iCount <> 4) then
119 warnlog "There should 4 items in the VIEW/TOOLBAR menu but there are " + iCount + " items."
123 printlog "check if there are 9 items in the INSERT menu."
125 hMenuSelectNr(4) 'INSERT
126 iCount = hMenuItemGetCount()
127 if (iCount <> 9) then
128 warnlog "There should 9 items in the INSERT menu but there are " + iCount + " items."
132 printlog "check if there are 13 items in the FORMAT menu."
134 hMenuSelectNr(5) ' FORMAT
135 iCount = hMenuItemGetCount()
136 if (iCount <> 13) then
137 warnlog "There should 13 items in the FORMAT menu but there are " + iCount + " items."
140 printlog "check if there are 2 items in the FORMAT/ARRANGEMENT menu."
142 hMenuSelectNr(5) ' FORMAT
143 hMenuSelectNr(3) ' ARRANGEMENT
144 iCount = hMenuItemGetCount()
145 if (iCount <> 2) then
146 warnlog "There should 2 items in the FORMAT/ARRANGEMENT menu but there are " + iCount + " items."
149 printlog "check if there are 6 items in the FORMAT/AXIS menu."
151 hMenuSelectNr(5) ' FORMAT
152 hMenuSelectNr(5) ' AXIS
153 iCount = hMenuItemGetCount()
154 if (iCount <> 6) then
155 warnlog "There should 6 items in the FORMAT/AXIS menu but there are " + iCount + " items."
158 printlog "check if there are 7 items in the FORMAT/GRID menu."
160 hMenuSelectNr(5) ' FORMAT
161 hMenuSelectNr(6) ' GRID
162 iCount = hMenuItemGetCount()
163 if (iCount <> 7) then
164 warnlog "There should 7 items in the FORMAT/GRID menu but there are " + iCount + " items."
167 printlog "check if there are 6 items in the FORMAT/Title menu."
169 hMenuSelectNr(5) ' FORMAT
170 hMenuSelectNr(4) ' TITLE
171 iCount = hMenuItemGetCount()
172 if (iCount <> 8) then
173 warnlog "There should 8 items in the FORMAT/Title menu but there are " + iCount + " items."
176 printlog "check if there are 13 items in the TOOLS menu."
179 iCount = hMenuItemGetCount()
180 if (iCount <> 13) then
181 warnlog "There should 13 items in the tools menu but there are " + iCount + " items."
185 printlog "check if there are 4 items in the TOOLS/MACRO menu."
189 iCount = hMenuItemGetCount()
190 if (iCount <> 4) then
191 warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items."
195 printlog "check if there are 5 items in the WINDOW menu."
198 iCount = hMenuItemGetCount()
199 if (iCount <> 5) then
200 warnlog "There should 5 items in the WINDOW menu but there are " + iCount + " items."
204 printlog "check if there are 5 or 6 items in the HELP menu. Depends on if it's a patched version"
207 iCount = hMenuItemGetCount()
208 if (iCount <> ( iHelpMenuItemCount + 1 ) AND iCount <> iHelpMenuItemCount ) then
209 warnlog "There should 5 OR 6 items in the HELP menu but there are " + iCount + " items."