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: extras_labels.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.co
36 '* short description : test names of labels
38 '\******************************************************************************
40 testcase tLabelTypes()
42 if ( gIsoLang <> "en-US" ) then
43 printlog( "No testing for non-en_US languages" )
47 '///<h1>Localization test for labels: Branding and types</h1>
48 '///<i>This test opens the labels dialog and compares the list of labels
49 '///+ with their brands and associated types agains a reference list.</i><br>
52 dim iBrandCount as integer
53 dim iCurrentBrand as integer
54 dim cBrandName as string
56 dim iTypeCount as integer
57 dim iCurrentType as integer
58 dim cTypeName as string
60 dim cBrandType as string
62 dim al_UI_Labels( 1600 ) as string
63 al_UI_Labels( 0 ) = "0"
68 sFile = "Labels_" & gISOLang & ".txt"
71 sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\" & sFile
72 sFileIn = convertpath( sFileIn )
74 dim sFileOut as string
75 sFileOut = hGetWorkPath() & sFile
78 '///+<li>Open the labels-dialog (suggested way: File->New->Labels)</li>
81 '///+<li>Switch to the Labels-Tab (which is the default)</li>
83 Active.SetPage TabEtiketten
85 kontext "TabEtiketten"
87 '///+<li>Find out how many brands are listed (might be language dependent)</li>
88 iBrandCount = Marke.getItemCount()
90 '///+<li>Collect the types for each brand</li>
92 for iCurrentBrand = 1 to iBrandCount
94 '///+<li>Select brand</li>
95 Marke.select( iCurrentBrand )
97 '///+<li>Retrieve brand name</li>
98 cBrandName = Marke.getSelText()
100 '///+<li>Count the number of types for the current brand</li>
101 iTypeCount = Typ.getItemCount()
103 '///+<li>Retrieve the list of types</li>
105 for iCurrentType = 1 to iTypeCount
107 '///+<li>Select the next type</li>
108 Typ.select( iCurrentType )
110 '///+<li>Get the name of the current type</li>
111 cTypeName = Typ.getSelText()
113 '///+<li>Build the list - format is: "Brand:Type"</li>
114 cBrandType = cBrandName & ":" & cTypeName
115 ListAppend( al_UI_Labels() , cBrandType )
123 '///+<li>Close the label dialog</li>
124 TabEtiketten.Cancel()
126 '///+<li>Compare the list against the reference list</li>
127 irc = hManageComparisionList( sFileIn, sFileOut, al_UI_Labels() )
129 warnlog( "The list of labels (Brand/Types) has changed, please review." )
131 printlog( "The lists of labels are unchanged. Good." )