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 dim iToolsMenuItemCount as integer
54 iToolsMenuItemCount = 4 : if ( gPlatform = "osx" ) then iToolsMenuItemCount = 3
55 'Options entry is called Preferences and resides in application MacOS X menu
57 printlog "Close all document windows (File / Close)"
58 Do Until GetDocumentCount = 0
61 printlog "File / New / Spreadsheet"
64 printlog "insert a Chart Object"
65 if fInsertOLE = FALSE then
66 warnlog "It was not possible to insert a chart as OLE."
69 Kontext "DocumentCalc"
71 printlog "check if there are 21 items in the FILE menu."
72 hMenuSelectNr(1) ' FILE
73 iCount = hMenuItemGetCount()
74 if (iCount <> iMainMenuItemCount ) then
75 warnlog "There should be 20 or 21 items in the file menu but there are " + iCount + " items."
77 call hMenuClose() ' close the FILE menu
79 printlog "check if there are 12 items in the FILE/NEW menu."
81 hMenuSelectNr(1) ' FILE
82 hMenuSelectNr(1) ' NEW
83 iCount = hMenuItemGetCount()
84 if (iCount <> 12) then
85 warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items."
87 call hMenuClose() ' close the FILE menu
89 printlog "check if there are 8 items in the FILE/AUTOPILOT menu."
91 hMenuSelectNr(1) ' FILE
92 hMenuSelectNr(4) ' AUTOPILOT
93 iCount = hMenuItemGetCount()
95 warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items."
99 printlog "check if there are 5 items in the EDIT menu."
102 iCount = hMenuItemGetCount()
103 if (iCount <> 5) then
104 warnlog "There should 5 items in the edit menu but there are " + iCount + " items."
108 printlog "check if there are 4 items in the VIEW menu."
111 iCount = hMenuItemGetCount()
112 if (iCount <> 4) then
113 warnlog "There should 4 items in the view menu but there are " + iCount + " items."
117 printlog "check if there are 4 items in the VIEW/TOOLBAR menu."
119 hMenuSelectNr(3) ' VIEW
120 hMenuSelectNr(1) ' TOOLBAR
121 iCount = hMenuItemGetCount()
122 if (iCount <> 4) then
123 warnlog "There should 4 items in the VIEW/TOOLBAR menu but there are " + iCount + " items."
127 printlog "check if there are 9 items in the INSERT menu."
129 hMenuSelectNr(4) 'INSERT
130 iCount = hMenuItemGetCount()
131 if (iCount <> 9) then
132 warnlog "There should 9 items in the INSERT menu but there are " + iCount + " items."
136 printlog "check if there are 13 items in the FORMAT menu."
138 hMenuSelectNr(5) ' FORMAT
139 iCount = hMenuItemGetCount()
140 if (iCount <> 13) then
141 warnlog "There should 13 items in the FORMAT menu but there are " + iCount + " items."
144 printlog "check if there are 2 items in the FORMAT/ARRANGEMENT menu."
146 hMenuSelectNr(5) ' FORMAT
147 hMenuSelectNr(3) ' ARRANGEMENT
148 iCount = hMenuItemGetCount()
149 if (iCount <> 2) then
150 warnlog "There should 2 items in the FORMAT/ARRANGEMENT menu but there are " + iCount + " items."
153 printlog "check if there are 6 items in the FORMAT/AXIS menu."
155 hMenuSelectNr(5) ' FORMAT
156 hMenuSelectNr(6) ' AXIS
157 iCount = hMenuItemGetCount()
158 if (iCount <> 6) then
159 warnlog "There should 6 items in the FORMAT/AXIS menu but there are " + iCount + " items."
162 printlog "check if there are 7 items in the FORMAT/GRID menu."
164 hMenuSelectNr(5) ' FORMAT
165 hMenuSelectNr(7) ' GRID
166 iCount = hMenuItemGetCount()
167 if (iCount <> 7) then
168 warnlog "There should 7 items in the FORMAT/GRID menu but there are " + iCount + " items."
171 printlog "check if there are 6 items in the FORMAT/Title menu."
173 hMenuSelectNr(5) ' FORMAT
174 hMenuSelectNr(4) ' TITLE
175 iCount = hMenuItemGetCount()
176 if (iCount <> 8) then
177 warnlog "There should 8 items in the FORMAT/Title menu but there are " + iCount + " items."
180 printlog "check if there are " + iToolsMenuItemCount + " items in the TOOLS menu."
183 iCount = hMenuItemGetCount()
184 if (iCount <> iToolsMenuItemCount) then
185 warnlog "There should " + iToolsMenuItemCount + " items in the tools menu but there are " + iCount + " items."
189 printlog "check if there are 4 items in the TOOLS/MACRO menu."
193 iCount = hMenuItemGetCount()
194 if (iCount <> 4) then
195 warnlog "There should 4 items in the TOOLS/MACRO menu but there are " + iCount + " items."
199 printlog "check if there are 5 items in the WINDOW menu."
202 iCount = hMenuItemGetCount()
203 if (iCount <> 5) then
204 warnlog "There should 5 items in the WINDOW menu but there are " + iCount + " items."
208 printlog "check if there are 5 or 6 items in the HELP menu. Depends on if it's a patched version"
211 iCount = hMenuItemGetCount()
212 if (iCount <> ( iHelpMenuItemCount + 1 ) AND iCount <> iHelpMenuItemCount ) then
213 warnlog "There should 5 OR 6 items in the HELP menu but there are " + iCount + " items."