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: wr_o_5.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:33:29 $
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 : This testcase is for thai issues only
38 '\***********************************************************************
42 Call tLanguageSettingsComplexTextLayout
46 testcase tLanguageSettingsComplexTextLayout
50 Dim iNumeralsCounter as integer
51 Dim iNumeralsCount as integer
52 Dim bAsianLanguage as boolean
53 Dim bCTLLanguage as boolean
54 Dim sCTLLan() as string
55 Dim sCurrentDocumentLanguage as string
56 Dim sCurrentCTLLanguage as string
57 Dim bSequenceChecking as boolean
59 '/// Open new writerdocument
61 '/// Activate Asian support
62 bAsianLanguage = ActiveDeactivateAsianSupport(True)
63 '/// Activate CTL support
64 bCTLLanguage = ActiveDeactivateCTLSupport(True)
67 '/// Goto 'Tools->Options->Language settings->Languages
68 Call hToolsOptions ("LanguageSettings","Languages")
69 sCurrentCTLLanguage = LanguageComplexScript.GetSelText
71 For i = 1 to LanguageComplexScript.GetItemCount
72 '/// Select CTL-Language
73 LanguageComplexScript.Select i
74 sCurrentDocumentLanguage = LanguageComplexScript.GetSelText
75 printlog "- Current selected CTL Language: " & sCurrentDocumentLanguage
76 '/// close options dialog with 'ok'
77 Kontext "ExtrasOptionenDlg"
79 '/// Reopen options and go to Tabpage 'Complex Text Layout'
81 Call hToolsOptions ("LanguageSettings","ComplexTextLayout")
83 Kontext "TabComplexTextLayout"
84 bSequenceChecking = FALSE
86 '/// Checkboxes under 'Sequence checking' should all be checked for CTL languages
87 '/// + like "Thai", "Lao", "Khmer", "Vietnamese"
89 sCTLLan = Array("Thai", "Lao", "Khmer", "Burmese", "Vietnamese")
91 sCTLLan = Array("Thai", "Lao", "Khmer", "Birmanisch", "Vietnamesisch")
93 QAErrorlog "Please adapt testcase for this language"
94 Kontext "ExtrasOptionenDlg"
100 if sCTLLan(j) = sCurrentDocumentLanguage then
101 bSequenceChecking = TRUE
106 Select Case bSequenceChecking
108 if UseSequenceChecking.IsChecked = False then
109 Warnlog "'Sequence Checking' should be checked for language: " & sCurrentDocumentLanguage
111 if Restricted.IsEnabled = False or Restricted.IsChecked = False then
112 Warnlog "'Restricted' should be enabled and checked for language: " & sCurrentDocumentLanguage
114 if TypeAndReplace.IsEnabled = False or TypeAndReplace.IsChecked = False then
115 Warnlog "'Type And Replace' should be enabled and checked for language: " & sCurrentDocumentLanguage
119 if UseSequenceChecking.IsChecked = True then
120 QAErrorlog "'Sequence Checking' should not be checked for language: " & sCurrentDocumentLanguage
122 if Restricted.IsEnabled = True AND Restricted.IsChecked = True then
123 QAErrorlog "'Restricted' should not be checked for language: " & sCurrentDocumentLanguage
125 if TypeAndReplace.IsEnabled = True AND TypeAndReplace.IsChecked = True then
126 QAErrorlog "'Type And Replace' should not checked for language: " & sCurrentDocumentLanguage
130 'Get the number of Numerals-entries.
131 iNumeralsCount = Numerals.GetItemCount
133 Kontext "ExtrasOptionenDlg"
136 Call hToolsOptions ("LanguageSettings","Languages")
137 Kontext "TabSprachen"
140 Kontext "ExtrasOptionenDlg"
141 if ExtrasOptionenDlg.Exists then ExtrasOptionenDlg.Ok
143 printlog "Check the Numerals-menu."
145 Call hToolsOptions ("LanguageSettings","ComplexTextLayout")
147 Printlog " Select every entry in the list, then press OK to close the dialogue, then open it again and check if the value got saved."
148 for iNumeralsCounter = 1 to iNumeralsCount
149 Numerals.Select iNumeralsCounter
150 Printlog " Numerals nr: " + iNumeralsCounter + " = " + Numerals.GetSelText
152 'Press ok, and open the dialogue again.
153 Kontext "ExtrasOptionenDlg"
154 if ExtrasOptionenDlg.Exists then ExtrasOptionenDlg.Ok
156 Call hToolsOptions ("LanguageSettings","ComplexTextLayout")
158 if Numerals.GetSelIndex <> iNumeralsCounter then Warnlog "The Numeral-Entry number: " + iNumeralsCounter + " didn't get saved when pressing OK in the FormatCharacter-dialogue."
159 next iNumeralsCounter
161 Kontext "ExtrasOptionenDlg"
164 '/// Choose Thai as CTL language
166 Call hToolsOptions ("LanguageSettings","Languages")
167 Kontext "TabSprachen"
168 LanguageComplexScript.Select sCTLLan(0)
169 Kontext "ExtrasOptionenDlg"
175 '/// Reopen options and go to Tabpage 'Complex Text Layout'
177 Call hToolsOptions ("LanguageSettings","ComplexTextLayout")
178 '/// Check if all checkboxes under 'Sequence checking' are checked
179 if UseSequenceChecking.IsChecked = False then
180 Warnlog "'Sequence Checking' should be checked for language: " & sCTLLan(0)
182 if Restricted.IsEnabled = False or Restricted.IsChecked = False then
183 Warnlog "'Restricted' should be enabled and checked for language: " & sCTLLan(0)
185 if TypeAndReplace.IsEnabled = False or TypeAndReplace.IsChecked = False then
186 Warnlog "'Type And Replace' should be enabled and checked for language: " & sCTLLan(0)
189 '/// Reset CTL Language
190 Kontext "ExtrasOptionenDlg"
193 Call hToolsOptions ("LanguageSettings","Languages")
194 Kontext "TabSprachen"
195 LanguageComplexScript.Select sCurrentCTLLanguage
196 Kontext "ExtrasOptionenDlg"
200 Call ActiveDeactivateAsianSupport(bAsianLanguage)
201 Call ActiveDeactivateCTLSupport(bCTLLanguage)
203 Do Until GetDocumentCount = 0