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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : hercule.li@oracle.com
30 '* short description : CJK Feature Switch test
32 '\***********************************************************************
34 testcase tSwitchLocation
35 '/// Check if the switch "Asian Language support" exist -- tools/options/language settings/language
38 Call hToolsOptions("LANGUAGESETTINGS" , "LANGUAGES")
41 if Aktivieren.IsChecked = TRUE then
42 printLog "CJK language is checked"
44 printLog "CJK language isn't checked"
47 warnlog "Something wrong in checkbox 'Asian Language Support'"
50 Kontext "ExtrasOptionenDlg"
54 '-------------------------------------------------------------------------
56 testcase tWriterUIChangesTest1
57 '/// Check if checkbox "Snap to text grid" is enable or not -- Format/Paragraph tabpage "Alignment"
60 '/// turn on "Asian Language support" , check if checkbox "Snap to text grid" is enable
61 Call CheckAsianLanguageSupport("On")
65 Active.SetPage TabAusrichtungAbsatz
66 Kontext "TabAusrichtungAbsatz"
69 if TextrasterFangen.IsChecked = TRUE then
70 printLog "snap to text grid is checked"
72 printLog "snap to text grid isn't checked"
75 warnlog "Something wrong in checkbox 'snap to text grid'"
78 TabAusrichtungAbsatz.Cancel
80 '/// turn off "Asian Language support" , check if checkbox "Snap to text grid" isn't enable
81 if ( not hSystemHasAsianLocale() ) then
82 Call CheckAsianLanguageSupport("Off")
86 Active.SetPage TabAusrichtungAbsatz
87 Kontext "TabAusrichtungAbsatz"
90 if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
91 warnlog "Something wrong in checkbox 'snap to text grid'"
96 TabAusrichtungAbsatz.Cancel
99 ' JSK I have no idea why the tabpage was closed a second time so i do not fix it
100 ' but make closing the tabpage optional. I hate this.
101 kontext "TabAusrichtungAbsatz"
102 hCloseDialog( TabAusrichtungAbsatz, "cancel,optional" )
104 if ( not hSystemHasAsianLocale() ) then
105 Call CheckAsianLanguageSupport("Off")
109 Active.SetPage TabAusrichtungAbsatz
110 Kontext "TabAusrichtungAbsatz"
113 if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
114 warnlog "Something wrong in checkbox 'snap to text grid'"
119 TabAusrichtungAbsatz.Cancel
125 '-------------------------------------------------------------------------
127 testcase tWriterUIChangesTest2
128 '/// Check if tabpage "Asian Typography" appear or not -- Format/Paragraph
131 '/// turn on "Asian Language support" , check if tabpage "Asian Typography" appears
132 Call CheckAsianLanguageSupport("On")
138 Active.SetPage TabAsianTypography
139 Kontext "TabAsianTypography"
140 TabAsianTypography.Cancel
142 Active.SetPage TabAusrichtungAbsatz
143 Kontext "TabAusrichtungAbsatz"
144 TabAusrichtungAbsatz.Cancel
145 warnlog "Something wring in tabpage - Asian Typography!"
148 '/// turn off "Asian Language support" , check if tabpage "Asian Typography" disappear
149 if ( not hSystemHasAsianLocale() ) then
150 Call CheckAsianLanguageSupport("Off")
156 Active.SetPage TabAsianTypography
157 Kontext "TabAsianTypography"
158 TabAsianTypography.Cancel
159 warnlog "tabpage - Asian Typography should NOT appear!"
161 Active.SetPage TabAusrichtungAbsatz
162 Kontext "TabAusrichtungAbsatz"
163 TabAusrichtungAbsatz.Cancel
170 '-------------------------------------------------------------------------
172 testcase tWriterUIChangesTest3
173 '/// Check if list box "Asian text font" appear or not -- Format/Character
176 '/// turn on "Asian Language support" , Check if list box "Asian text font" appear
177 Call CheckAsianLanguageSupport("On")
182 active.SetPage TabFont
187 warnlog "Something wrong in list box Asian text font when Asian Language support is on"
191 '/// turn off "Asian Language support" , Check if list box "Asian text font" disappear
192 if ( not hSystemHasAsianLocale() ) then
193 Call CheckAsianLanguageSupport("Off")
198 active.SetPage TabFont
202 warnlog "Something wrong in list box Asian text font when Asian Language support is off"
211 '-------------------------------------------------------------------------
213 testcase tWriterUIChangesTest4
214 '/// Check if list box "Emphasis mark" appear or not -- Format/Character
217 '/// turn on "Asian Language support" , Check if list box "Emphasis mark" appear
218 Call CheckAsianLanguageSupport("On")
223 active.SetPage TabFontEffects
224 kontext "TabFontEffects"
228 warnlog "Something wrong in list box Emphasis mark when Asian Language support is on"
230 TabFontEffects.Cancel
232 '/// turn off "Asian Language support" , Check if list box "Emphasis mark" disappear
233 if ( not hSystemHasAsianLocale() ) then
234 Call CheckAsianLanguageSupport("Off")
239 active.SetPage TabFontEffects
240 kontext "TabFontEffects"
243 warnlog "Something wrong in list box Emphasis mark when Asian Language support is off"
246 TabFontEffects.Cancel
252 '-------------------------------------------------------------------------
254 testcase tWriterUIChangesTest5
255 '/// Check if tabpage "Searching in Japanese" appear or not -- tools/options/language settings/
258 '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" appear
259 Call CheckAsianLanguageSupport("On")
262 if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE") <> TRUE then
263 warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is on"
266 Kontext "ExtrasOptionenDlg"
267 ExtrasOptionenDlg.Cancel
269 '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" disappear
270 if ( not hSystemHasAsianLocale() ) then
271 Call CheckAsianLanguageSupport("Off")
274 if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE" , TRUE) = FALSE then
275 printLog Chr(13) & "Yes, 'Searching Japanese'-page has been disabled after switching Asian Language Support 'off'."
277 warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is off"
280 Kontext "ExtrasOptionenDlg"
281 ExtrasOptionenDlg.Cancel
287 '-------------------------------------------------------------------------
289 testcase tWriterUIChangesTest6
290 '/// Check if tabpage "Asian Layout" appear or not -- tools/options/language settings/
293 '/// turn on "Asian Language support" , Check if tabpage "Asian Layout" appear
294 Call CheckAsianLanguageSupport("On")
297 if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT") <> TRUE then
298 warnlog "Something wrong in tabpage Asian Layout when Asian Language support is on"
301 Kontext "ExtrasOptionenDlg"
302 ExtrasOptionenDlg.Cancel
304 '/// turn off "Asian Language support" , Check if tabpage "Asian Layout" disappear
305 if ( not hSystemHasAsianLocale() ) then
306 Call CheckAsianLanguageSupport("Off")
309 if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT", TRUE) = FALSE then
310 printLog Chr(13) & "Yes, 'Asian Layout'-page has been disabled after switching 'Asian Language Support' off."
312 warnlog "Something wrong in tabpage Asian Layout when Asian Language support is off"
315 Kontext "ExtrasOptionenDlg"
316 ExtrasOptionenDlg.Cancel
322 '-------------------------------------------------------------------------
324 testcase tWriterUIChangesTest7
325 '/// Check if menu format/Ruby is active or not
328 '/// turn on "Asian Language support" , Check if menu format/Ruby is actived
329 Call CheckAsianLanguageSupport("On")
337 warnlog "Something wrong in menu format/Ruby when Asian Language support is on"
340 '/// turn off "Asian Language support" , Check if menu format/Ruby is inactived
341 if ( not hSystemHasAsianLocale() ) then
342 Call CheckAsianLanguageSupport("Off")
350 warnlog "Something wrong in menu format/Ruby when Asian Language support is off"
358 '-------------------------------------------------------------------------
360 testcase tWriterUIChangesTest8
361 '/// Check if the following submenus in format/change case is active or not
369 '/// turn on "Asian Language support" , Check if submenus in format/change case is actived
370 Call CheckAsianLanguageSupport("On")
373 FormatChangeCaseHalfWidth
375 warnlog "Something wrong in submenu format/change case -> Half width when Asian Language support is on"
379 FormatChangeCaseFullWidth
381 warnlog "Something wrong in submenu format/change case -> Full width when Asian Language support is on"
385 FormatChangeCaseHiragana
387 warnlog "Something wrong in submenu format/change case -> Hiragana when Asian Language support is on"
391 FormatChangeCaseKatagana
393 warnlog "Something wrong in submenu format/change case -> Katagana when Asian Language support is on"
396 '/// turn off "Asian Language support" , Check if submenus in format/change case is inactived
397 if ( not hSystemHasAsianLocale() ) then
398 Call CheckAsianLanguageSupport("Off")
401 FormatChangeCaseHalfWidth
403 warnlog "Something wrong in submenu format/change case -> Half width when Asian Language support is off"
408 FormatChangeCaseFullWidth
410 warnlog "Something wrong in submenu format/change case -> Full width when Asian Language support is off"
415 FormatChangeCaseHiragana
417 warnlog "Something wrong in submenu format/change case -> Hiragana when Asian Language support is off"
422 FormatChangeCaseKatagana
424 warnlog "Something wrong in submenu format/change case -> Katagana when Asian Language support is off"
432 '-------------------------------------------------------------------------
434 testcase tWriterUIChangesTest9
437 '/// turn on "Asian Language support" , Check if list box text direction appear
438 Call CheckAsianLanguageSupport("On")
442 Active.SetPage TabSeite
448 warnlog "Something wrong in list box text direction when Asian Language support is on"
452 '/// turn off "Asian Language support" , Check if list box text direction disappear
453 if ( not hSystemHasAsianLocale() ) then
454 Call CheckAsianLanguageSupport("Off")
458 Active.SetPage TabSeite
463 warnlog "Something wrong in list box text direction when Asian Language support is off"
472 '-------------------------------------------------------------------------
474 testcase tWriterUIChangesTest10
476 '/// Check if vertical text box and callout appear or not
479 '/// turn on "Asian Language support" , Check if vertical text box and callout appear
480 Call CheckAsianLanguageSupport("On")
483 Call hToolbarSelect("DRAWING", true)
487 warnlog "Something wrong in vertical text box when Asian Language support is on"
490 VerticalCallout.Click
492 warnlog "Something wrong in vertical text callout when Asian Language support is on"
495 '/// turn off "Asian Language support" , Check if vertical text box and callout disappear
496 if ( not hSystemHasAsianLocale() ) then
497 Call CheckAsianLanguageSupport("Off")
501 warnlog "Something wrong in vertical text box when Asian Language support is off"
505 VerticalCallout.Click
506 warnlog "Something wrong in vertical text callout when Asian Language support is off"
515 '-------------------------------------------------------------------------
517 testcase tWriterUIChangesTest11
520 dim iCount as integer
522 const iHopeNumber1 = 42
523 const iHopeNumber2 = 23
525 '/// Check if the number in listbox numbering is right or not.
526 '/// [if the number of the listbox numbering is changed, this case should be modified according]
530 '/// turn on "Asian Language support" , Check if the number in listbox numbering is right
531 Call CheckAsianLanguageSupport("On")
533 FormatNumberingBullets
535 Active.SetPage TabOptionenNumerierung
536 Kontext "TabOptionenNumerierung"
538 iCount = Numerierung.GetItemCount
539 if iCount = iHopeNumber1 then
540 Numerierung.Select 15
541 TabOptionenNumerierung.OK
543 printLog Chr(13) & "Pls. go to the printer to find if you can get a paper"
544 printLog Chr(13) & "which is printed like '-'.Otherwise , something wrong!"
545 '/// --Pls. go to the printer to find if you can get a paper which is printed like '-'. Otherwise , something is wrong!
549 if Active.Exists( 1 ) then
550 if Active.GetRT = 304 then
552 QAErrorLog "No Default-Printer!"
554 hCloseDialog( Printing, "cancel,optional" )
558 hCloseDialog( Printing, "cancel,optional" )
562 printlog "(" & i & "/" & iCount & "): " & Numerierung.getItemText(i)
565 TabOptionenNumerierung.Cancel
566 qaerrorlog "the number of list box numbering is wrong when Asian Language support is on; expected: " + iHopeNumber1 + "; is: " + iCount
569 'print warning if no printer is available
571 if active.exists(5) then
572 qaErrorlog "print warning: '" + active.getText + "'"
576 'print warning if no printer is available
578 if active.exists(5) then
579 qaErrorlog "print warning: '" & active.getText & "'"
583 '/// turn off "Asian Language support" , Check if the number in listbox numbering is right
584 if ( not hSystemHasAsianLocale() ) then
585 Call CheckAsianLanguageSupport("Off")
587 FormatNumberingBullets
589 Active.SetPage TabOptionenNumerierung
590 Kontext "TabOptionenNumerierung"
592 iCount = Numerierung.GetItemCount
593 if iCount <> iHopeNumber2 then
595 printlog "(" & i & "/" & iCount & "): " & Numerierung.getItemText(i)
598 warnlog "the number of list box numbering is wrong when Asian Language support is off; expected: " & iHopeNumber2 & "; is: " & iCount
600 TabOptionenNumerierung.Cancel
606 '-------------------------------------------------------------------------
608 testcase tProlongedVowelsTest1
609 '/// Check if the default setting of "Prolonged vowels (ka-/kaa) will be ACTIVATED.
613 '/// turn on "Asian Language support" , Check if the default setting of "Prolonged vowels (ka-/kaa) is ACTIVATED.
614 Call CheckAsianLanguageSupport("On")
617 Call hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE")
619 if ( not ProlongedSoundmarks.IsChecked ) then
620 warnlog "The default setting of 'Prolonged vowels (ka-/kaa)' isn't ACTIVATED."
623 Kontext "ExtrasOptionenDlg"
624 ExtrasOptionenDlg.Cancel
630 '-------------------------------------------------------------------------
632 testcase tCalcUIChangesTest_10
634 '/// Check if vertical text box and callout appear or not
638 '/// turn on "Asian Language support" , Check if vertical text box and callout appear
639 Call CheckAsianLanguageSupport("On")
641 Call hToolbarSelect("DRAWING", true)
645 warnlog "Something wrong in vertical text box when Asian Language support is on"
648 VerticalCallout.Click
650 warnlog "Something wrong in vertical text callout when Asian Language support is on"
653 '/// turn off "Asian Language support" , Check if vertical text box and callout disappear
654 if ( not hSystemHasAsianLocale() ) then
655 Call CheckAsianLanguageSupport("Off")
659 warnlog "Something wrong in vertical text box when Asian Language support is off"
663 VerticalCallout.Click
664 warnlog "Something wrong in vertical text callout when Asian Language support is off"
673 '-------------------------------------------------------------------------
675 testcase tImpressUIChangesTest_10
677 '/// Check if vertical text box and callout and fit vertical text to frame appear or not
680 '/// turn on "Asian Language support" , Check if vertical text box appear
681 Call CheckAsianLanguageSupport("On")
688 warnlog "Something wrong in vertical text box when Asian Language support is on"
691 '/// turn off "Asian Language support" , Check if vertical text box disappear
692 if ( not hSystemHasAsianLocale() ) then
693 Call CheckAsianLanguageSupport("Off")
698 warnlog "Something wrong in vertical text box when Asian Language support is off"
707 '-------------------------------------------------------------------------
709 testcase tDrawUIChangesTest_10
711 '/// Check if vertical text box and callout and fit vertical text to frame appear or not
714 '/// turn on "Asian Language support" , Check if vertical text box appear
715 Call CheckAsianLanguageSupport("On")
721 warnlog "Something wrong in vertical text box when Asian Language support is on"
724 '/// turn off "Asian Language support" , Check if vertical text box disappear
725 if ( not hSystemHasAsianLocale() ) then
726 Call CheckAsianLanguageSupport("Off")
730 warnlog "Something wrong in vertical text box when Asian Language support is off"
739 '-------------------------------------------------------------------------
741 function hSystemHasAsianLocale() as boolean
743 select case ( iSystemSprache )
744 case 81, 82, 86, 88 : hSystemHasAsianLocale() = true
745 case else : hSystemHasAsianLocale() = false