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: hhConversion2.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:30:03 $
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 : Test of Hangul/Hanja Conversion - 2
38 '************************************************************************
40 ' #1 tHHConversion_1 'Hanja/Hangul (Korean -> Chinese)
41 ' #1 tHHConversion_2 'Hanja/Hangul (Chinese -> Korean)
42 ' #1 tHHConversion_3 'Hanja(Hangul) (Korean -> Chinese)
43 ' #1 tHHConversion_4 'Hanja(Hangul) (Chinese -> Korean)
44 ' #1 tHHConversion_5 'Hangul(Hanja) (Korean -> Chinese)
45 ' #1 tHHConversion_6 'Hangul(Hanja) (Chinese -> Korean)
46 ' #1 tHHConversion_7 ''Hanja As Ruby Above Hangul' (Korean -> Chinese)
47 ' #1 tHHConversion_8 ''Hanja As Ruby Above Hangul' (Chinese -> Korean)
48 ' #1 tHHConversion_9 ''Hanja As Ruby Below Hangul' (Korean -> Chinese)
49 ' #1 tHHConversion_10 ''Hanja As Ruby Below Hangul' (Chinese -> Korean)
50 ' #1 tHHConversion_11 ''Hangul As Ruby Above Hanja' (Korean -> Chinese)
51 ' #1 tHHConversion_12 ''Hangul As Ruby Above Hanja' (Chinese -> Korean)
52 ' #1 tHHConversion_13 ''Hangul As Ruby Below Hanja' (Korean -> Chinese)
53 ' #1 tHHConversion_14 ''Hangul As Ruby Below Hanja' (Chinese -> Korean)
54 ' #1 tHHConversion_15 'Hangul Only
55 ' #1 tHHConversion_16 'Hanja Only
56 ' #1 tHHConversion_17 'Ignore
57 ' #1 tHHConversion_18 'Always Ignore -1
58 ' #1 tHHConversion_19 'Always Ignore -2
59 ' #1 tHHConversion_20 'Replace
60 ' #1 tHHConversion_21 'Always Replace -1
61 ' #1 tHHConversion_22 'Always Replace -2
62 ' #1 tHHConversion_23 'Always Replace -3
63 ' #1 tHHConversion_24 'Replace by character -1
64 ' #1 tHHConversion_25 'Replace by character -2(Always Ignore)
65 ' #1 tHHConversion_26 'Replace by character -3(Always Replace)
67 '\***********************************************************************
69 testcase tHHConversion_1
71 Dim sTestFile as String
75 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
76 sResult = "漢字入力은該當하入力하中文信息"
79 printlog "- Hanja/Hangul (Korean -> Chinese)"
80 '/// <b> Simple convert from Hangul into Hanja </b>
84 '/// Open a test file , which includes some
85 '/// + Korean chacters and chinese character
86 Call hFileOpen(sTestFile)
87 Call wTypeKeys "<MOD1 Home>"
89 '/// Tools / HangulHanjaConversion ,
90 '/// + Press Peplace button
91 ToolsLanguageHangulHanjaConversion
92 Kontext "HangulHanjaConversion"
94 if NOT HangulHanjaConversion.Exists then
101 '/// Check if the result is correct
102 Call wTypeKeys "<MOD1 Home>"
103 Call wTypeKeys "<Shift End>"
106 if GetClipboardText <> sResult then
107 Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
114 '-----------------------------------------------------------------
116 testcase tHHConversion_2
118 Dim sTestFile as String
119 Dim sResult as String
122 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
123 sResult = "상산하乡황하长강력은해당"
125 printlog "- Hanja/Hangul (Chinese -> Korean)"
126 '/// <b> Simple convert from Hanja into Hangul </b>
130 '/// Open a test file , which includes some
131 '/// + Chinese character and Korean chacters
132 Call hFileOpen(sTestFile)
133 Call wTypeKeys "<MOD1 Home>"
135 '/// Tools / HangulHanjaConversion , check hanja only .
136 '/// + Press Peplace button
137 ToolsLanguageHangulHanjaConversion
138 Kontext "HangulHanjaConversion"
141 if NOT HangulHanjaConversion.Exists then
148 '/// Check if the result is correct
149 Call wTypeKeys "<MOD1 Home>"
150 Call wTypeKeys "<Shift End>"
153 if GetClipboardText <> sResult then
154 Warnlog "Conversion doesn't work well !"
161 '-----------------------------------------------------------------
163 testcase tHHConversion_3
165 Dim sTestFile as String
166 Dim sResult as String
169 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
170 sResult = "漢字(한자)入力(입력)은該當(해당)하入力(입력)하中文信息"
173 printlog "- Hanja(Hangul) (Korean -> Chinese)"
174 '/// <b> Test Hanja(Hangul) - Simple convert from Hangul into Hanja </b>
178 '/// Open a test file , which includes some
179 '/// + Korean chacters and chinese character
180 Call hFileOpen(sTestFile)
181 Call wTypeKeys "<MOD1 Home>"
183 '/// Tools / HangulHanjaConversion , check Hanja(Hangul)
184 '/// + Press Peplace button
185 ToolsLanguageHangulHanjaConversion
186 Kontext "HangulHanjaConversion"
190 if NOT HangulHanjaConversion.Exists then
197 '/// Check if the result is correct
198 Call wTypeKeys "<MOD1 Home>"
199 Call wTypeKeys "<Shift End>"
202 if GetClipboardText <> sResult then
203 Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
210 '-----------------------------------------------------------------
212 testcase tHHConversion_4
214 Dim sTestFile as String
215 Dim sResult as String
218 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
219 sResult = "上山下(상산하)乡黄河(황하)长江(강)력은該當(해당)"
222 printlog "- Hanja(Hangul) (Chinese -> Korean)"
223 '/// <b> Test Hanja(Hangul) - Simple convert from Hanja into Hangul </b>
227 '/// Open a test file , which includes some
228 '/// + Chinese character and Korean chacters
229 Call hFileOpen(sTestFile)
230 Call wTypeKeys "<MOD1 Home>"
232 '/// Tools / HangulHanjaConversion , check Hanja(Hangul).
233 '/// + Press Peplace button
234 ToolsLanguageHangulHanjaConversion
235 Kontext "HangulHanjaConversion"
239 if NOT HangulHanjaConversion.Exists then
246 '/// Check if the result is correct
247 Call wTypeKeys "<MOD1 Home>"
248 Call wTypeKeys "<Shift End>"
251 if GetClipboardText <> sResult then
252 Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
259 '-----------------------------------------------------------------
261 testcase tHHConversion_5
263 Dim sTestFile as String
264 Dim sResult as String
267 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
268 sResult = "한자(漢字)입력(入力)은해당(該當)하입력(入力)하中文信息"
271 printlog "- Hangul(Hanja) (Korean -> Chinese)"
272 '/// <b> Test Hangul(Hanja) - Simple convert from Hangul into Hanja </b>
276 '/// Open a test file , which includes some
277 '/// + Korean chacters and chinese character
278 Call hFileOpen(sTestFile)
279 Call wTypeKeys "<MOD1 Home>"
281 '/// Tools / HangulHanjaConversion , check Hangul(Hanja) ,
282 '/// + Press Peplace button
283 ToolsLanguageHangulHanjaConversion
284 Kontext "HangulHanjaConversion"
288 if NOT HangulHanjaConversion.Exists then
295 '/// Check if the result is correct
296 Call wTypeKeys "<MOD1 Home>"
297 Call wTypeKeys "<Shift End>"
300 if GetClipboardText <> sResult then
301 Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
308 '-----------------------------------------------------------------
310 testcase tHHConversion_6
312 Dim sTestFile as String
313 Dim sResult as String
316 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
317 sResult = "상산하(上山下)乡황하(黄河)长강(江)력은해당(該當)"
321 printlog "- Hangul(Hanja) (Chinese -> Korean)"
322 '/// <b> Test Hangul(Hanja) - Simple convert from Hanja into Hangul </b>
326 '/// Open a test file , which includes some
327 '/// + Chinese character and Korean chacters
328 Call hFileOpen(sTestFile)
329 Call wTypeKeys "<MOD1 Home>"
331 '/// Tools / HangulHanjaConversion , check Hangul(Hanja),
332 '/// + Press Peplace button
333 ToolsLanguageHangulHanjaConversion
334 Kontext "HangulHanjaConversion"
338 if NOT HangulHanjaConversion.Exists then
345 '/// Check if the result is correct
346 Call wTypeKeys "<MOD1 Home>"
347 Call wTypeKeys "<Shift End>"
350 if GetClipboardText <> sResult then
351 Warnlog "Conversion result not: " & sResult & " but: " & GetClipboardText
358 '-----------------------------------------------------------------
360 testcase tHHConversion_7
362 Dim sTestFile as String
363 Dim sHangulText , sHanjaText as String
364 Dim iAlignment , iPosition as Integer
368 iAlignment = 2 'Center
370 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
372 printlog "- 'Hanja As Ruby Above Hangul' (Korean -> Chinese)"
373 '/// <b> Test 'Hanja As Ruby Above Hangul' - Simple convert from Hangul into Hanja </b>
377 '/// Open a test file , which includes some Korean chacters
378 Call hFileOpen(sTestFile)
379 Call wTypeKeys "<Home>"
381 '/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Above Hangul' ,
382 '/// + press Peplace button
383 ToolsLanguageHangulHanjaConversion
384 Kontext "HangulHanjaConversion"
385 HanjaAsRubyAbove.Check
389 HangulHanjaConversion.Close
391 Call wTypeKeys "<Home>"
392 '/// Format/Ruby , check if the result is correct
396 if BasisText1.GetText <> sHangulText then
397 Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
399 if RubyText1.GetText <> sHanjaText then
400 Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
402 if Adjust.GetSelIndex <> iAlignment then
403 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
405 if RubyPosition.GetSelIndex <> iPosition then
406 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
415 '-----------------------------------------------------------------
417 testcase tHHConversion_8
419 Dim sTestFile as String
420 Dim sHangulText , sHanjaText as String
421 Dim iAlignment , iPosition as Integer
425 iAlignment = 2 'Center
427 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
429 printlog "- 'Hanja As Ruby Above Hangul' (Chinese -> Korean)"
430 '/// <b> Test 'Hanja As Ruby Above Hangul' - Simple convert from Hanja into Hangul </b>
434 '/// Open a test file , which includes some Chinese chacters
435 Call hFileOpen(sTestFile)
436 Call wTypeKeys "<Home>"
438 '/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Above Hangul' ,
439 '/// + press Peplace button
440 ToolsLanguageHangulHanjaConversion
441 Kontext "HangulHanjaConversion"
442 HanjaAsRubyAbove.Check
446 HangulHanjaConversion.Close
448 Call wTypeKeys "<Home>"
449 '/// Format/Ruby , check if the result is correct
453 if BasisText1.GetText <> sHangulText then
454 Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
456 if RubyText1.GetText <> sHanjaText then
457 Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
459 if Adjust.GetSelIndex <> iAlignment then
460 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
462 if RubyPosition.GetSelIndex <> iPosition then
463 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
472 '-----------------------------------------------------------------
474 testcase tHHConversion_9
476 Dim sTestFile as String
477 Dim sHangulText , sHanjaText as String
478 Dim iAlignment , iPosition as Integer
482 iAlignment = 2 'Center
483 iPosition = 2 'Bottom
484 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
486 printlog "- 'Hanja As Ruby Below Hangul' (Korean -> Chinese)"
487 '/// <b> Test 'Hanja As Ruby Below Hangul' - Simple convert from Hangul into Hanja </b>
491 '/// Open a test file , which includes some Korean chacters
492 Call hFileOpen(sTestFile)
493 Call wTypeKeys "<Home>"
495 '/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Below Hangul' ,
496 '/// + press Peplace button
497 ToolsLanguageHangulHanjaConversion
498 Kontext "HangulHanjaConversion"
499 HanjaAsRubyBelow.Check
503 HangulHanjaConversion.Close
505 Call wTypeKeys "<Home>"
506 '/// Format/Ruby , check if the result is correct
510 if BasisText1.GetText <> sHangulText then
511 Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
513 if RubyText1.GetText <> sHanjaText then
514 Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
516 if Adjust.GetSelIndex <> iAlignment then
517 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
519 if RubyPosition.GetSelIndex <> iPosition then
520 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
529 '-----------------------------------------------------------------
531 testcase tHHConversion_10
533 Dim sTestFile as String
534 Dim sHangulText , sHanjaText as String
535 Dim iAlignment , iPosition as Integer
539 iAlignment = 2 'Center
540 iPosition = 2 'Bottom
541 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
543 printlog "- 'Hanja As Ruby Below Hangul' (Chinese -> Korean)"
544 '/// <b> Test 'Hanja As Ruby Below Hangul' - Simple convert from Hanja into Hangul </b>
548 '/// Open a test file , which includes some Chinese chacters
549 Call hFileOpen(sTestFile)
550 Call wTypeKeys "<Home>"
552 '/// Tools / HangulHanjaConversion , check 'Hanja As Ruby Below Hangul' ,
553 '/// + press Peplace button
554 ToolsLanguageHangulHanjaConversion
555 Kontext "HangulHanjaConversion"
556 HanjaAsRubyBelow.Check
560 HangulHanjaConversion.Close
562 Call wTypeKeys "<Home>"
563 '/// Format/Ruby , check if the result is correct
567 if BasisText1.GetText <> sHangulText then
568 Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
570 if RubyText1.GetText <> sHanjaText then
571 Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
573 if Adjust.GetSelIndex <> iAlignment then
574 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
576 if RubyPosition.GetSelIndex <> iPosition then
577 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
586 '-----------------------------------------------------------------
588 testcase tHHConversion_11
590 Dim sTestFile as String
591 Dim sHangulText , sHanjaText as String
592 Dim iAlignment , iPosition as Integer
596 iAlignment = 2 'Center
598 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
600 printlog "- 'Hangul As Ruby Above Hanja' (Korean -> Chinese)"
601 '/// <b> Test 'Hangul As Ruby Above Hanja' - Simple convert from Hangul into Hanja </b>
605 '/// Open a test file , which includes some Korean chacters
606 Call hFileOpen(sTestFile)
607 Call wTypeKeys "<Home>"
609 '/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Above Hanja' ,
610 '/// + press Peplace button
611 ToolsLanguageHangulHanjaConversion
612 Kontext "HangulHanjaConversion"
613 HangulAsRubyAbove.Check
617 HangulHanjaConversion.Close
619 Call wTypeKeys "<Home>"
620 '/// Format/Ruby , check if the result is correct
624 if BasisText1.GetText <> sHanjaText then
625 Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
627 if RubyText1.GetText <> sHangulText then
628 Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
630 if Adjust.GetSelIndex <> iAlignment then
631 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
633 if RubyPosition.GetSelIndex <> iPosition then
634 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
643 '-----------------------------------------------------------------
645 testcase tHHConversion_12
647 Dim sTestFile as String
648 Dim sHangulText , sHanjaText as String
649 Dim iAlignment , iPosition as Integer
653 iAlignment = 2 'Center
655 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
657 printlog "- 'Hangul As Ruby Above Hanja' (Chinese -> Korean)"
658 '/// <b> Test 'Hangul As Ruby Above Hanja' - Simple convert from Hanja into Hangul </b>
662 '/// Open a test file , which includes some Chinese chacters
663 Call hFileOpen(sTestFile)
664 Call wTypeKeys "<Home>"
666 '/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Above Hanja' ,
667 '/// + press Peplace button
668 ToolsLanguageHangulHanjaConversion
669 Kontext "HangulHanjaConversion"
670 HangulAsRubyAbove.Check
674 HangulHanjaConversion.Close
676 Call wTypeKeys "<Home>"
677 '/// Format/Ruby , check if the result is correct
681 if BasisText1.GetText <> sHanjaText then
682 Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
684 if RubyText1.GetText <> sHangulText then
685 Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
687 if Adjust.GetSelIndex <> iAlignment then
688 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
690 if RubyPosition.GetSelIndex <> iPosition then
691 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
700 '-----------------------------------------------------------------
702 testcase tHHConversion_13
704 Dim sTestFile as String
705 Dim sHangulText , sHanjaText as String
706 Dim iAlignment , iPosition as Integer
710 iAlignment = 2 'Center
711 iPosition = 2 'Bottom
712 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
714 printlog "- 'Hangul As Ruby Below Hanja' (Korean -> Chinese)"
715 '/// <b> Test 'Hangul As Ruby Below Hanja' - Simple convert from Hangul into Hanja </b>
719 '/// Open a test file , which includes some Korean chacters
720 Call hFileOpen(sTestFile)
721 Call wTypeKeys "<Home>"
723 '/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Below Hanja' ,
724 '/// + press Peplace button
725 ToolsLanguageHangulHanjaConversion
726 Kontext "HangulHanjaConversion"
727 HangulAsRubyBelow.Check
731 HangulHanjaConversion.Close
733 Call wTypeKeys "<Home>"
734 '/// Format/Ruby , check if the result is correct
738 if BasisText1.GetText <> sHanjaText then
739 Warnlog "Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
741 if RubyText1.GetText <> sHangulText then
742 Warnlog "Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
744 if Adjust.GetSelIndex <> iAlignment then
745 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
747 if RubyPosition.GetSelIndex <> iPosition then
748 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
757 '-----------------------------------------------------------------
759 testcase tHHConversion_14
761 Dim sTestFile as String
762 Dim sHangulText , sHanjaText as String
763 Dim iAlignment , iPosition as Integer
767 iAlignment = 2 'Center
768 iPosition = 2 'Bottom
769 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
771 printlog "- 'Hangul As Ruby Below Hanja' (Chinese -> Korean)"
772 '/// <b> Test 'Hangul As Ruby Below Hanja' - Simple convert from Hanja into Hangul </b>
776 '/// Open a test file , which includes some Chinese chacters
777 Call hFileOpen(sTestFile)
778 Call wTypeKeys "<Home>"
780 '/// Tools / HangulHanjaConversion , check 'Hangul As Ruby Below Hanja' ,
781 '/// + press Peplace button
782 ToolsLanguageHangulHanjaConversion
783 Kontext "HangulHanjaConversion"
784 HangulAsRubyBelow.Check
788 HangulHanjaConversion.Close
790 Call wTypeKeys "<Home>"
791 '/// Format/Ruby , check if the result is correct
795 if BasisText1.GetText <> sHanjaText then
796 Warnlog "#i39186# Base text : hope to get " & sHangulText & " but get " & BasisText1.GetText
798 if RubyText1.GetText <> sHangulText then
799 Warnlog "#i39186# Ruby text : hope to get " & sHanjaText & " but get " & RubyText1.GetText
801 if Adjust.GetSelIndex <> iAlignment then
802 Warnlog "Alignment : hope to get " & Adjust.GeTSelText(iAlignment) & " but get " & Adjust.GeTSelText
804 if RubyPosition.GetSelIndex <> iPosition then
805 Warnlog "Position: hope to get " & RubyPosition.GeTSelText(iPosition) & " but get " & RubyPosition.GeTSelText
814 '-----------------------------------------------------------------
816 testcase tHHConversion_15
818 Dim sTestFile as String
820 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
822 printlog "- Hangul Only"
823 '/// <b> Test 'Hangul Only' </b>
827 '/// Open a test file , which includes some Korean chacters .
828 '/// + Set focus before Korean character
829 Call hFileOpen(sTestFile)
830 Call wTypeKeys "<Home>"
832 '/// Tools / HangulHanjaConversion ,
833 '/// + 'Hangul Only' should be active and Unchecked,
834 '/// + 'Hanja Only' should be inactive
835 ToolsLanguageHangulHanjaConversion
836 Kontext "HangulHanjaConversion"
837 if HangulOnly.IsChecked = TRUE then
838 Warnlog "The default of Hangul Only should be Unchecked ! Bug#116320"
845 Warnlog "'Hangul Only' Should be active !"
850 Warnlog "'Hanja Only' should be inactive !"
853 HangulHanjaConversion.Close
859 '-----------------------------------------------------------------
861 testcase tHHConversion_16
863 Dim sTestFile as String
865 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\ChineseToKorean.sxw")
867 printlog "- Hanja Only"
868 '/// <b> Test 'Hanja Only' </b>
872 '/// Open a test file , which includes some Chinese chacters .
873 '/// + Set focus before Chinese character
874 Call hFileOpen(sTestFile)
875 Call wTypeKeys "<Home>"
877 '/// Tools / HangulHanjaConversion ,
878 '/// + 'Hanja Only' should be active and Unchecked,
879 '/// + 'Hangul Only' should be inactive
880 ToolsLanguageHangulHanjaConversion
881 Kontext "HangulHanjaConversion"
882 if HanjaOnly.IsChecked = TRUE then
883 Warnlog "The default of Hanja Only should be Unchecked ! Bug#116320"
890 Warnlog "'Hanja Only' Should be active !"
895 Warnlog "'Hangul Only' should be inactive !"
898 HangulHanjaConversion.Close
904 '-----------------------------------------------------------------
906 testcase tHHConversion_17
908 Dim sTestFile as String
909 Dim sResult , sWord as String
911 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\KoreanToChinese.sxw")
914 GetClipboardText = ""
917 '/// <b> Test 'Ignore' </b>
921 '/// Open a test file , which includes some Korean chacters .
922 Call hFileOpen(sTestFile)
923 Call wTypeKeys "<Home>"
925 '/// Tools / HangulHanjaConversion , press Ignore ,
926 '/// + next word should be selected for conversion.
927 ToolsLanguageHangulHanjaConversion
928 Kontext "HangulHanjaConversion"
931 if Word.GetText <> sWord then
932 Warnlog "Hope get " & sWord & " in Word" & " but get " & Word.GetText
936 HangulHanjaConversion.Close
938 Call wTypeKeys "<Home>"
939 Call wTypeKeys "<Shift Right>" , 4
941 if GetClipboardText <> sResult then
942 Warnlog "Should get " & sResult & " but get " & GetClipboardText
949 '-----------------------------------------------------------------
951 testcase tHHConversion_18
953 Dim sTestFile as String
954 Dim sResult as String
958 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
959 GetClipboardText = ""
961 sResult = "산하 황하 상산하乡 산하"
963 printlog "- Always Ignore -1"
964 '/// <b> Test 'Always Ignore' -1 </b>
968 '/// Open a test file , which includes some Chinese chacters =>.
970 Call hFileOpen(sTestFile)
971 Call wTypeKeys "<Home>"
973 '/// Tools / HangulHanjaConversion , press Always Ignore ,
974 '/// + (here, 山下 should be selected) , then press Replace
975 ToolsLanguageHangulHanjaConversion
976 Kontext "HangulHanjaConversion"
980 if NOT HangulHanjaConversion.Exists then
987 '/// The result should be only 黄河 and 上山下 are converted
988 Call wTypeKeys "<Home>"
989 Call wTypeKeys "<Shift End>"
991 if GetClipboardText <> sResult then
992 Warnlog "Should get " & sResult & " but get " & GetClipboardText
995 '/// Close this active document
998 '/// So far , there is still a StarOffice session exists .
1000 '/// Reopen the test file
1001 Call hFileOpen(sTestFile)
1002 Call wTypeKeys "<Home>"
1004 '/// Tools / HangulHanjaConversion ,
1005 '/// + ,(here, 黄河 should be selected)
1006 ToolsLanguageHangulHanjaConversion
1007 Kontext "HangulHanjaConversion"
1008 if Word.GetText <> sWord then
1009 Warnlog "#i39308# Don't get " & sWord & " but get " & Word.GetText
1013 if NOT HangulHanjaConversion.Exists then
1020 '/// The result should be only 黄河 and 上山下 are converted
1021 Call wTypeKeys "<Home>"
1022 Call wTypeKeys "<Shift End>"
1024 if GetClipboardText <> sResult then
1025 QAErrorlog "#i39308# Should get " & sResult & " but get " & GetClipboardText
1032 '-----------------------------------------------------------------
1034 testcase tHHConversion_19
1036 Dim sTestFile as String
1039 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
1042 printlog "- Always Ignore -2"
1043 '/// <b> Test 'Always Ignore' -2 </b>
1047 '/// Open a test file , which includes some Chinese chacters =>.
1049 Call hFileOpen(sTestFile)
1050 Call wTypeKeys "<Home>"
1052 '/// Tools / HangulHanjaConversion , press Always Ignore ,
1053 '/// + (here, 山下 should be selected)
1054 ToolsLanguageHangulHanjaConversion
1055 Kontext "HangulHanjaConversion"
1058 HangulHanjaConversion.Close
1062 '/// Close all Office session
1071 '/// Reopen the test file
1072 Call hFileOpen(sTestFile)
1073 Call wTypeKeys "<Home>"
1075 '/// Tools / HangulHanjaConversion , 山下 should be selcted
1076 ToolsLanguageHangulHanjaConversion
1077 Kontext "HangulHanjaConversion"
1078 if Word.GetText <> sWord then
1079 Warnlog "Don't get " & sWord & " but get " & Word.GetText
1081 HangulHanjaConversion.Close
1087 '-----------------------------------------------------------------
1089 testcase tHHConversion_20
1091 Dim sTestFile as String
1093 Dim sResult as String
1096 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
1100 GetClipboardText = ""
1102 printlog "- Replace"
1103 '/// <b> Test Replace </b>
1107 '/// Open a test file , which includes some Korean chacters
1108 Call hFileOpen(sTestFile)
1109 Call wTypeKeys "<Home>"
1111 '/// Tools / HangulHanjaConversion , select a word in selection
1112 '/// + then press Replace button
1113 ToolsLanguageHangulHanjaConversion
1114 Kontext "HangulHanjaConversion"
1117 Suggestions.Select sWord
1119 Warnlog "No suggestion made in Hangul/Hanja converter"
1120 HangulHanjaConversion.Close
1127 if NOT HangulHanjaConversion.Exists then
1134 '/// Check if the result is right
1135 Call wTypeKeys "<Home>"
1136 Call wTypeKeys "<Shift End>"
1138 if GetClipboardText <> sResult then
1139 Warnlog "Should get " & sResult & " but get " & GetClipboardText
1146 '-----------------------------------------------------------------
1148 testcase tHHConversion_21
1150 Dim sTestFile as String
1151 Dim sWord1 as String
1152 Dim sWord2 as String
1153 Dim sResult as String
1156 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
1157 sWord1 = "書翰" : sWord2 = "書翰"
1159 GetClipboardText = ""
1164 printlog "- Replace All -1"
1165 '/// <b> Test 'Replace All' -1</b>
1166 '/// <b> replace list will be active for the office session </b>
1170 '/// Open a test file , which includes some Korean chacters
1171 Call hFileOpen(sTestFile)
1172 Call wTypeKeys "<Home>"
1174 '/// Tools / HangulHanjaConversion , select a word in selection,
1175 '/// + press 'always replace' , then press Replace button
1176 ToolsLanguageHangulHanjaConversion
1177 Kontext "HangulHanjaConversion"
1179 Suggestions.Select sWord1
1181 Warnlog "No suggestion made in Hangul/Hanja converter"
1182 HangulHanjaConversion.Close
1191 if NOT HangulHanjaConversion.Exists then
1198 '/// Check if the result is right
1199 Call wTypeKeys "<Home>"
1200 Call wTypeKeys "<Shift End>"
1203 if GetClipboardText <> sResult then
1204 Warnlog "1st:Should get " & sResult & " but get " & GetClipboardText
1207 '/// Close the file , so far , there is still a StarOffice session
1212 '/// Reopen this test file
1213 Call hFileOpen(sTestFile)
1214 Call wTypeKeys "<Home>"
1216 '/// Tools / HangulHanjaConversion
1217 ToolsLanguageHangulHanjaConversion
1218 Kontext "HangulHanjaConversion"
1219 if Word.GetText <> sWord2 then
1220 Warnlog "#i39308# Should get " & sWord2 & " but get " & Word.GetText
1221 HangulHanjaConversion.Close
1226 if NOT HangulHanjaConversion.Exists then
1233 '/// Check if the result is right
1234 Call wTypeKeys "<Home>"
1235 Call wTypeKeys "<Shift End>"
1236 GetClipboardText = ""
1239 if GetClipboardText <> sResult then
1240 Warnlog "2nd:Should get " & sResult & " but get " & GetClipboardText
1247 '-----------------------------------------------------------------
1249 testcase tHHConversion_22
1251 Dim sTestFile as String
1254 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\Replace.sxw")
1255 GetClipboardText = ""
1257 printlog "- Replace All -2"
1258 '/// <b> Test 'Replace All' -2</b>
1259 '/// <b> replace list will NOT be active when office session is deleted </b>
1263 '/// Open a test file , which includes some Korean chacters
1264 Call hFileOpen(sTestFile)
1265 Call wTypeKeys "<Home>"
1267 '/// Tools / HangulHanjaConversion , select a word in selection,
1268 '/// + press 'always replace' , then press Replace button
1269 ToolsLanguageHangulHanjaConversion
1270 Kontext "HangulHanjaConversion"
1272 Suggestions.Select 1
1274 Warnlog "No suggestion made in Hangul/Hanja converter"
1275 HangulHanjaConversion.Close
1282 if HangulHanjaConversion.Exists then HangulHanjaConversion.Close
1284 '/// Close all documents
1285 For i = 1 to GetDocumentCount - 1
1289 '/// Restart the office
1290 Call hStartTheOffice
1292 '/// Reopen this test file
1293 Call hFileOpen(sTestFile)
1294 Call wTypeKeys "<Home>"
1296 '/// Tools / HangulHanjaConversion
1297 ToolsLanguageHangulHanjaConversion
1298 Kontext "HangulHanjaConversion"
1299 if HangulHanjaConversion.Exists then
1300 HangulHanjaConversion.Close
1302 Warnlog "Replace list is active after office-restart"
1309 '-----------------------------------------------------------------
1311 testcase tHHConversion_23
1313 Dim sTestFile as String
1315 Dim sResult as String
1318 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
1320 GetClipboardText = ""
1322 printlog "- Replace All -3"
1323 '/// <b> Test 'Replace All' -3 </b>
1324 '/// <b> Replacing AF must not lead to replace the AF within CAFE </b>
1328 '/// Open a test file , which includes some Korean chacters
1329 Call hFileOpen(sTestFile)
1330 Call wTypeKeys "<Home>"
1332 '/// Tools / HangulHanjaConversion , select a word in selection,
1333 '/// + press 'always replace' , then press Replace button
1334 ToolsLanguageHangulHanjaConversion
1335 Kontext "HangulHanjaConversion"
1337 if Replace.IsEnabled then
1339 Suggestions.Select 1
1341 Warnlog "No suggestion made in Hangul/Hanja converter"
1342 HangulHanjaConversion.Close
1354 if NOT HangulHanjaConversion.Exists then
1361 '/// Check if the result is right
1362 Call wTypeKeys "<Home>"
1363 Call wTypeKeys "<Shift End>"
1365 if GetClipboardText <> sResult then
1366 Warnlog "Should get " & sResult & " but get " & GetClipboardText
1373 '-----------------------------------------------------------------
1375 testcase tHHConversion_24
1377 Dim sTestFile as String
1378 Dim sResult as String
1381 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
1383 GetClipboardText = ""
1385 printlog "- Replace by character -1"
1386 '/// <b> Test 'Replace by character' -1 </b>
1390 '/// Open a test file , which includes some Korean chacters
1391 Call hFileOpen(sTestFile)
1392 Call wTypeKeys "<Home>"
1394 '/// Tools / HangulHanjaConversion , the default for 'Replace by character'
1395 '/// + is OFF . Check 'Replace by character' , then press Replace button
1396 ToolsLanguageHangulHanjaConversion
1397 Kontext "HangulHanjaConversion"
1398 if ReplaceByCharacter.IsChecked = TRUE then
1399 Warnlog "The default for 'Replace By Character' should be OFF !"
1401 ReplaceByCharacter.Check
1404 if NOT HangulHanjaConversion.Exists then
1411 '/// Check if the result is right
1412 Call wTypeKeys "<Home>"
1413 Call wTypeKeys "<Shift End>"
1415 if GetClipboardText <> sResult then
1416 Warnlog "Should get " & sResult & " but get " & GetClipboardText
1423 '-----------------------------------------------------------------
1425 testcase tHHConversion_25
1427 Dim sTestFile as String
1428 Dim sResult as String
1431 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\alwayIgnore.sxw")
1432 sResult = "山하 황하 상山하乡 山하"
1433 GetClipboardText = ""
1435 printlog "- Replace by character -2"
1436 '/// <b> Test 'Replace by character' -2 </b>
1437 '/// <b> Test Always Ignore when 'Replace by character' is checked </b>
1441 '/// Open a test file , which includes some Chinese chacters =>.
1443 Call hFileOpen(sTestFile)
1444 Call wTypeKeys "<Home>"
1446 '/// Tools / HangulHanjaConversion , Check 'Replace by character' ,
1447 '/// + press Always Ignore , then press Replace
1448 ToolsLanguageHangulHanjaConversion
1449 Kontext "HangulHanjaConversion"
1450 ReplaceByCharacter.Check
1455 if NOT HangulHanjaConversion.Exists then
1462 '/// The result should be only 黄河 and 上山下 are converted
1463 Call wTypeKeys "<Home>"
1464 Call wTypeKeys "<Shift End>"
1466 if GetClipboardText <> sResult then
1467 Warnlog "Should get " & sResult & " but get " & GetClipboardText
1470 '/// Close this active document
1473 'The purpose is to delete Office session
1483 '-----------------------------------------------------------------
1485 testcase tHHConversion_26
1487 Dim sTestFile as String
1489 Dim sResult as String
1492 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\hangulhanjaonversion\replaceAll.sxw")
1495 GetClipboardText = ""
1497 printlog "- Replace by character -3"
1498 '/// <b> Test 'Replace by character' -3 </b>
1499 '/// <b> Test Always Replace when 'Replace by character' is checked </b>
1503 '/// Open a test file , which includes some Korean chacters
1504 Call hFileOpen(sTestFile)
1505 Call wTypeKeys "<Home>"
1507 '/// Tools / HangulHanjaConversion , Check 'Replace by character' ,
1508 '/// + select a word in selection, press 'always replace' ,
1509 '/// + then press Replace button
1510 ToolsLanguageHangulHanjaConversion
1511 Kontext "HangulHanjaConversion"
1512 ReplaceByCharacter.Check
1514 Grid.Typekeys "<Right>"
1519 if NOT HangulHanjaConversion.Exists then
1526 '/// Check if the result is right
1527 Call wTypeKeys "<Home>"
1528 Call wTypeKeys "<Shift End>"
1530 if GetClipboardText <> sResult then
1531 Warnlog "Should get " & sResult & " but get " & GetClipboardText
1536 'Close all Office session
1545 '-----------------------------------------------------------------