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: w_fields7.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:27:37 $
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 : helge.delfs@sun.com
36 '* short description : Fields - L10N test
38 '\***********************************************************************
42 Call tL10NtestAboveBelow
48 '-----------------------------------------------------------------
50 testcase tL10NtestAboveBelow
53 QaErrorLog "Currently no any other language than English. Aborting."
57 Dim sTestFile as String
58 Dim sAbove() as String
59 Dim sBelow() as String
60 Dim iCountry() as Integer
64 Dim sUILanguage as integer, sLocale as integer
65 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
66 Dim sAsiancb as boolean, sCTLcb as boolean
67 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
69 if iSprache <> 01 then
70 QAErrorlog "This is a English-only testcase"
74 ' Get current settings on language tabpage and remember
76 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
77 sUILanguage = UILanguage.GetSelIndex
78 sLocale = Gebietsschema.GetSelIndex
79 sCurrency = StandardWaehrung.GetSelIndex
80 sWestern = Westlich.GetSelIndex
81 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
82 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
83 sAsiancb = Aktivieren.IsEnabled
84 sCTLcb = ComplexScriptEnabled.IsEnabled
85 sAsiancbChecked = Aktivieren.IsChecked
86 sCTLcbChecked = ComplexScriptEnabled.IsChecked
87 Kontext "ExtrasOptionenDlg"
88 ExtrasOptionenDlg.Cancel
91 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\AboveBelow.sxw")
119 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
120 55, 81 , 82 , 86 , 88 )
122 printlog "L10N test - above/below"
123 '/// <b> L10N test - above/below </b>
127 '/// Open test file AboveBelow.sxw
128 Call hFileOpen(sTestFile)
129 Call sMakeReadOnlyDocumentEditable
131 '/// Check if reference above/below is changed after language is changed
135 Call wTypeKeys "<MOD1 Home>"
136 fSetLocale(fGetLanguageName(iCountry(i)))
137 if iCountry(i) < 80 then
138 fSetWestern(fGetLanguageName(iCountry(i)))
142 fSetAsian(fGetLanguageName(iCountry(i)))
145 Call wTypeKeys "<F9>"
146 Call wTypeKeys "<Shift Right>"
147 if fGetFieldContent() <> sBelow(i) then
148 Warnlog "Should get " & sBelow(i) & " but get " & fGetFieldContent()
150 Call wTypeKeys "<MOD1 End>"
151 Call wTypeKeys "<Shift Left>"
152 if fGetFieldContent() <> sAbove(i) then
153 Warnlog i & " - Should get " & sAbove(i) & " but get " & fGetFieldContent()
157 ' set back language tabpage values
159 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
160 UILanguage.Select sUILanguage
161 Gebietsschema.Select sLocale
162 StandardWaehrung.Select sCurrency
163 Westlich.Select sWestern
164 if sAsiancb = true then
165 if sAsiancbChecked = true then Aktivieren.IsChecked
168 if sCTLcb = true then
169 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
172 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
173 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
175 Kontext "ExtrasOptionenDlg"
182 '-----------------------------------------------------------------
184 testcase tL10NtestDate
185 if iSprache <> 1 then
186 QaErrorLog "Currently no any other language than English. Aborting."
190 Dim sTestFile as String
191 Dim sOriginalFile as string
192 Dim sDate() as String
193 Dim iCountry() as Integer
196 Dim sUILanguage as integer, sLocale as integer
197 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
198 Dim sAsiancb as boolean, sCTLcb as boolean
199 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
201 if iSprache <> 01 then
202 QAErrorlog "This is a English-only testcase"
207 ' Get current settings on language tabpage and remember
209 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
210 sUILanguage = UILanguage.GetSelIndex
211 sLocale = Gebietsschema.GetSelIndex
212 sCurrency = StandardWaehrung.GetSelIndex
213 sWestern = Westlich.GetSelIndex
214 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
215 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
216 sAsiancb = Aktivieren.IsEnabled
217 sCTLcb = ComplexScriptEnabled.IsEnabled
218 sAsiancbChecked = Aktivieren.IsChecked
219 sCTLcbChecked = ComplexScriptEnabled.IsChecked
220 Kontext "ExtrasOptionenDlg"
221 ExtrasOptionenDlg.Cancel
224 sTestFile = Convertpath (gOfficepath + "user\work\Date.sxw")
225 sOriginalFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Date.sxw")
226 ' document has to be copied to local file system to avoid opening a read-only file
227 ' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
228 FileCopy (sOriginalFile, sTestFile)
229 if hFileExists ( sTestFile ) = false then
230 Warnlog "Test document couldn't be copied to local file system. Test aborted!"
236 "Tuesday, August 3, 2004" , _
237 "mardi 3 août 2004" , _
238 "martes, 3 de agosto de 2004" , _
239 "martedì 3 agosto 2004" , _
240 "tisdag 3 augusti 2004" , _
241 "Dienstag, 3. August 2004" , _
242 "Terça-feira, 3 de Agosto de 2004" , _
246 "中華民國93年8月3日 星期二" , _
248 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
249 55, 81 , 82 , 86 , 88 )
251 printlog "L10N test - Date"
252 '/// <b> L10N test - Date </b>
256 '/// Open test file Date.sxw
257 Call hFileOpen(sTestFile)
259 '/// Check if Date is changed after language is changed
262 Call wTypeKeys "<MOD1 Home>"
263 fSetLocale(fGetLanguageName(iCountry(i)))
264 if iCountry(i) < 80 then
265 fSetWestern(fGetLanguageName(iCountry(i)))
269 fSetAsian(fGetLanguageName(iCountry(i)))
272 Call wTypeKeys "<F9>"
273 Call wTypeKeys "<Shift Right>"
274 if fGetFieldContent() <> sDate(i) then
275 Warnlog i & " - Should get " & sDate(i) & " but get " & fGetFieldContent()
279 ' set back language tabpage values
281 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
282 UILanguage.Select sUILanguage
283 Gebietsschema.Select sLocale
284 StandardWaehrung.Select sCurrency
285 Westlich.Select sWestern
286 if sAsiancb = true then
287 if sAsiancbChecked = true then Aktivieren.IsChecked
290 if sCTLcb = true then
291 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
294 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
295 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
297 Kontext "ExtrasOptionenDlg"
304 '-----------------------------------------------------------------
306 testcase tL10NtestTime
307 if iSprache <> 1 then
308 QaErrorLog "Currently no any other language than English. Aborting."
312 Dim sTestFile as String
313 Dim sOriginalFile as string
314 Dim sTime() as String
315 Dim iCountry() as Integer
319 Dim sUILanguage as integer, sLocale as integer
320 Dim sCurrency as integer, sWestern as integer, sAsian as integer, sCTL as integer
321 Dim sAsiancb as boolean, sCTLcb as boolean
322 Dim sAsiancbChecked as boolean, sCTLcbChecked as boolean
324 if iSprache <> 01 then
325 QAErrorlog "This is a English-only testcase"
330 ' Get current settings on language tabpage and remember
332 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
333 sUILanguage = UILanguage.GetSelIndex
334 sLocale = Gebietsschema.GetSelIndex
335 sCurrency = StandardWaehrung.GetSelIndex
336 sWestern = Westlich.GetSelIndex
337 if Asiatisch.IsEnabled then sAsian = Asiatisch.GetSelIndex
338 if LanguageComplexScript.IsEnabled then sCTL = LanguageComplexScript.GetSelIndex
339 sAsiancb = Aktivieren.IsEnabled
340 sCTLcb = ComplexScriptEnabled.IsEnabled
341 sAsiancbChecked = Aktivieren.IsChecked
342 sCTLcbChecked = ComplexScriptEnabled.IsChecked
343 Kontext "ExtrasOptionenDlg"
344 ExtrasOptionenDlg.Cancel
347 sTestFile = Convertpath (gOfficepath + "user\work\Time.sxw")
348 sOriginalFile = Convertpath (gTesttoolpath + "writer\optional\input\fields\Time.sxw")
349 ' document has to be copied to local file system to avoid opening a read-only file
350 ' because all field data gets lost if documents write-protection is removed via 'sMakeReadOnlyDocumentEditable'
351 FileCopy (sOriginalFile, sTestFile)
352 if hFileExists ( sTestFile ) = false then
353 Warnlog "Test document couldn't be copied to local file system. Test aborted!"
364 "04:46:08 nachm." , _
371 iCountry = Array ( 1 , 33 , 34 , 39 , 46 , 49 , _
372 55, 81 , 82 , 86 , 88 )
374 printlog "L10N test - time"
375 '/// <b> L10N test - time </b>
379 '/// Open test file Time.sxw
380 Call hFileOpen(sTestFile)
382 '/// Check if time is changed after language is changed
385 Call wTypeKeys "<MOD1 Home>"
386 fSetLocale(fGetLanguageName(iCountry(i)))
387 if iCountry(i) < 80 then
388 fSetWestern(fGetLanguageName(iCountry(i)))
392 fSetAsian(fGetLanguageName(iCountry(i)))
395 Call wTypeKeys "<F9>"
396 Call wTypeKeys "<Shift Right>"
397 if fGetFieldContent() <> sTime(i) then
398 Warnlog i & " - Should get " & sTime(i) & " but get " & fGetFieldContent()
402 ' set back language tabpage values
404 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
405 UILanguage.Select sUILanguage
406 Gebietsschema.Select sLocale
407 StandardWaehrung.Select sCurrency
408 Westlich.Select sWestern
409 if sAsiancb = true then
410 if sAsiancbChecked = true then Aktivieren.IsChecked
413 if sCTLcb = true then
414 if sCTLcbChecked = true then ComplexScriptEnabled.IsChecked
417 if Asiatisch.IsEnabled and sAsian > 0 then Asiatisch.Select sAsian
418 if LanguageComplexScript.IsEnabled and sCTL > 0 then LanguageComplexScript.Select sCTL
420 Kontext "ExtrasOptionenDlg"
427 '-----------------------------------------------------------------