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 : helge.delfs@oracle.com
30 '* short description : Testcases for the Tools-Menu
32 '\***********************************************************************
36 printLog Chr(13) + "--------- Tools Menu (w_007_.inc) ----------"
37 gApplication = "WRITER"
41 Call tToolsHyphenation
43 Call tToolsAutocorrectAutoformat
44 Call tToolsOutlineNumbering
45 Call tToolsLineNumbering
48 Call tToolsMailMergeWizard
49 Call tToolsTextInTables
53 Call tToolsOptionsTest
54 Call tToolsHangulHanjaConversion
55 Call tToolsChineseTranslation
59 Call tHtmlDocToolsHangulHanjaConversion
61 'Writer Master Document
62 gApplication = "MASTERDOCUMENT"
63 Call tMasterDocToolsHyphenation
64 gApplication = "WRITER"
67 ' -------------------------------------------
69 testcase tToolsSpellcheck
70 PrintLog "- Tools / Spellcheck"
73 Dim IsWriteable as boolean
75 ' As long as OOo has no modules for that, disabled
77 printlog "No spellchecking in OOo"
81 printlog " Open document where the formatting is set to the language we wish to test."
82 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
83 if ( not FileExists ( TheFile ) ) then
84 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
87 hFileOpenLocally( TheFile )
89 printlog " Insert some faulty text"
91 case 01 : Call wTypeKeys ("This is a spellchecktestttttt<Home>")
92 case 33 : Call wTypeKeys ("Je Suiss la Penneeee<Home>")
93 case 34 : Call wTypeKeys ("Habla Espanollll<Home>")
94 case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
95 case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
96 case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
97 case 07 : Printlog "- No Spellcheck in Russian!"
99 case 48 : Printlog "- No Spellcheck in Polish!"
101 case 55 : Printlog "- No Spellcheck in Brazilian!"
103 case 81 : Printlog "- No Spellcheck in Japanese!"
105 case 82 : Printlog "- No Spellcheck in Korean!"
107 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
109 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
111 case 03, 30, 35, 36, 37, 42, 47, 51, 90
112 Printlog "- No Spellcheck available !"
117 printlog " Tools / Spellcheck / Check"
118 ToolsSpellcheckWriter
120 if ( Active.Exists( 1 ) ) then
121 if Active.GetRT = 304 then
123 Active.Yes ' Start from beginning ?
124 if Active.exists then
125 if Active.GetRT = 304 then Active.Ok
126 Warnlog "Dialog 'Spellcheck' not up!"
132 Warnlog "Dialog 'Spellcheck' not up!"
139 printlog " Spellcheck dialog has to come up"
141 DialogTest ( Spellcheck )
143 printlog " Click 'Options'"
144 SpellcheckOptions.Click
147 kontext "TabLinguistik"
148 DialogTest ( TabLinguistik )
150 printlog " Step through all options in list and if 'Edit' is enabled click 'Edit'"
152 kontext "TabLinguistik"
153 Optionen.TypeKeys "<Down>"
154 if OptionenBearbeiten.IsEnabled then
155 OptionenBearbeiten.Click
157 Kontext "HyphenationOptions"
158 DialogTest ( HyphenationOptions )
159 HyphenationOptions.Cancel
163 printlog " Click 'New' in Options dialog"
167 Kontext "BenutzerwoerterbuchAnlegen"
168 Call DialogTest ( BenutzerwoerterbuchAnlegen )
169 BenutzerwoerterbuchAnlegen.Close
171 printlog " Check if there s a writeable dictionary and select it"
172 Kontext "TabLinguistik"
173 for i = 1 to Benutzerwoerterbuch.GetItemCount
174 Benutzerwoerterbuch.Select i
175 if Bearbeiten.IsEnabled = true then
181 if IsWriteable = true then
183 printlog " Click 'Edit' in 'Options dialog'"
185 Kontext "BenutzerwoerterbuchBearbeiten"
186 if BenutzerwoerterbuchBearbeiten.Exists(1) then
187 Call DialogTest ( BenutzerwoerterbuchBearbeiten )
188 BenutzerwoerterbuchBearbeiten.Close
190 Warnlog "Dialog 'Edit Dictionary' is not up!"
193 Warnlog "All dictionarys are write protected!"
196 printlog " Close 'Options' dialog"
197 Kontext "TabLinguistik"
202 printlog " Close 'Spellcheck' dialog"
205 PrintLog "Close active documents"
210 ' -------------------------------------------
212 testcase tToolsThesaurus
213 PrintLog "- Tools / Thesaurus"
214 Dim TheFile as string
216 ' As long as OOo has no modules for that, disabled
218 printlog "No spellchecking in OOo"
223 case 07 : Printlog "- No Thesaurus in Russian!"
225 case 48 : Printlog "- No Thesaurus in Polish!"
227 case 55 : Printlog "- No Thesaurus in Brazilian!"
229 case 81 : Printlog "- No Thesaurus in Japanese!"
231 case 82 : Printlog "- No Thesaurus in Korean!"
233 case 86 : Printlog "- No Thesaurus in Chinese (simplified)!"
235 case 88 : Printlog "- No Thesaurus in Chinese (traditional)!"
237 case 03, 30, 35, 36, 37, 42, 47, 51, 90
238 Printlog "- No Thesaurus available !"
242 printlog " Open document where the formatting is set to the language we wish to test."
243 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
244 if ( not FileExists ( TheFile ) ) then
245 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
248 call hFileOpenLocally( TheFile )
250 printlog " Insert some faulty text"
252 case 01 : Call wTypeKeys ("This is a spellchecktestttttt<Home>")
253 case 33 : Call wTypeKeys ("Je Suiss la Penneeee<Home>")
254 case 34 : Call wTypeKeys ("Habla Espanollll<Home>")
255 case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
256 case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
257 case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
258 case 07 : Printlog "- No Thesaurus in Russian!"
260 case 48 : Printlog "- No Thesaurus in Polish!"
262 case 55 : Printlog "- No Thesaurus in Brazilian!"
264 case 81 : Printlog "- No Thesaurus in Japanese!"
266 case 82 : Printlog "- No Thesaurus in Korean!"
268 case 86 : Printlog "- No Thesaurus in Chinese (simplified)!"
270 case 88 : Printlog "- No Thesaurus in Chinese (traditional)!"
272 case 03, 30, 35, 36, 37, 42, 47, 51, 90
273 Printlog "- No Thesaurus available !"
278 ToolsLanguageThesaurus
280 if Active.Exists then
282 Warnlog "Dialog 'Thesaurus' not up!"
288 DialogTest ( Thesaurus )
289 printlog " Close 'Thesaurus' dialog"
291 PrintLog "Close active documents"
296 ' -------------------------------------------
298 testcase tToolsHyphenation
299 Dim DieDatei as string
300 Dim LingFile as string
302 PrintLog "- Tools / Hyphenation"
303 ' As long as OOo has no modules for that, disabled
305 printlog "No hyphenation in OOo"
309 if gBuild < 9239 then
310 QAErrorlog "Hyphenation dialog freezes office!"
315 case 1,01 : LingFile = "01-44-hyph.dat"
316 DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\001.odt" )
317 case 7,07 : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\007.odt" )
318 case 3,03 : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\003.odt" )
319 case 81 : Printlog "- No Hyphenation in Japanese!"
321 case 82 : Printlog "- No Hyphenation in Korean!"
323 case 86 : Printlog "- No Hyphenation in Chinese (simplified)!"
325 case 88 : Printlog "- No Hyphenation in Chinese (traditional)!"
327 case else : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\0" + trim$(str$(iSprache)) + ".odt" )
328 LingFile = str$(iSprache) + "-hyph.dat"
331 if ( not FileExists( DieDatei ) ) then
332 Warnlog "No defined Errortext for language: " + isprache + "! Exit!"
336 Select Case gApplication
338 hFileOpenLocally( DieDatei )
340 Case "MASTERDOCUMENT"
341 if wInsertDocumentinMasterDoc(DieDatei) = False then
342 Warnlog "Loading document did not work!"
346 printlog " Open new document"
347 hUseAsyncSlot( "EditPaste" )
351 printlog "- No Hyphenation in WriterWeb!"
355 printlog " Insert file 'writer\required\input\linguistik\0 + [OfficeLanguage] + '.odt'"
357 Call wTypeKeys ("<Mod1 Home>")
359 hUseAsyncSlot( "ToolsLanguageHyphenate" )
360 printlog " Tools / Hyphenate"
366 if ( Active.Exists( 1 ) )then
367 if Active.GetRT = 304 then
369 ' Force pagesize change to bringup Hyphenation-dialog
370 hUseAsyncSlot( "FormatPageWriter" )
372 active.SetPage TabSeite
377 hUseAsyncSlot( "ToolsLanguageHyphenate" )
381 Kontext "Hyphenation"
382 printlog " Close upcoming 'Hyphenation' dialog"
383 if Hyphenation.Exists then
384 Call DialogTest ( Hyphenation )
387 Warnlog "Dialog 'Hyphenation' not up!"
389 if Active.Exists then
397 PrintLog "Close active documents"
398 Do Until GetDocumentCount = 0
403 ' -------------------------------------------
405 testcase tToolsWordCount
406 Printlog "- Tools / Word Count"
407 printlog " New Text document"
409 printlog " Tools / Word Count"
411 printlog " If if dialog has been opened"
413 if ( WordCount.Exists( 1 ) ) then
414 Call DialogTest ( WordCount )
415 printlog " Close dialog 'WordCount'"
418 Warnlog "Dialog 'WordCount' has not been opened!"
420 printlog " Close Text document"
424 ' -------------------------------------------
426 testcase tToolsAutocorrectAutoformat
427 PrintLog "- Tools / Autocorrect / Autoformat"
431 printlog " Open new document"
433 printlog " Tools / Autocorrect/Autoformat"
436 if Active.Exists then
437 if Active.GetRT = 304 then
438 Warnlog Active.Gettext
443 printlog " Step through all tabpages"
445 active.SetPage TabErsetzung
447 if Active.Exists then
448 if Active.GetRT = 304 then
449 Warnlog Active.Gettext
453 Kontext "TabErsetzung"
454 Call DialogTest ( TabErsetzung )
457 active.SetPage TabAusnahmen
459 if Active.Exists then
460 if Active.GetRT = 304 then
461 Warnlog Active.Gettext
465 Kontext "TabAusnahmen"
466 Call DialogTest ( TabAusnahmen )
469 active.SetPage TabOptionenAutokorrektur
470 Kontext "TabOptionenAutokorrektur"
471 Call DialogTest ( TabOptionenAutokorrektur )
472 printlog " Step through all options in list"
473 printlog " Tabpage Options: With entry 10 button 'Edit' should be enabled"
474 Einstellungen.TypeKeys "<Down>",9
476 if Bearbeiten.IsEnabled then
478 Kontext "Sonderzeichen"
479 DialogTest (Sonderzeichen)
482 Warnlog "- Button 'Edit' on Entry 10 disabled!"
485 Kontext "TabOptionenAutokorrektur"
486 printlog " Tabpage Options: With entry 16 button 'Edit' should be enabled"
487 Einstellungen.TypeKeys "<Down>",6
489 if Bearbeiten.IsEnabled then
491 Kontext "Sonderzeichen"
492 DialogTest (Sonderzeichen)
495 Warnlog "- Button 'Edit' on Entry 16 disabled!"
498 Kontext "TabOptionenAutokorrektur"
499 printlog " Tabpage Options: With entry 17 button 'Edit' should be enabled"
500 Einstellungen.TypeKeys "<Down>",1
502 if Bearbeiten.IsEnabled then
504 Kontext "Zusammenfassen"
505 DialogTest (Zusammenfassen)
506 Zusammenfassen.Cancel
507 Kontext "TabOptionenAutokorrektur"
509 Warnlog "- Button 'Edit' on Entry 17 disabled!"
513 active.SetPage TabLocalizedOptions
514 Kontext "TabLocalizedOptions"
515 SingleQuotesStart.Click
516 Kontext "Sonderzeichen"
517 Call DialogTest ( Sonderzeichen, 1 )
520 Kontext "TabLocalizedOptions"
521 SingleQuotesEnd.Click
522 Kontext "Sonderzeichen"
523 Call DialogTest ( Sonderzeichen, 2 )
526 Kontext "TabLocalizedOptions"
527 SingleQuotesDefault.Click
529 Kontext "TabLocalizedOptions"
530 DoubleQuotesStart.Click
531 Kontext "Sonderzeichen"
532 Call DialogTest ( Sonderzeichen, 3 )
535 Kontext "TabLocalizedOptions"
536 DoubleQuotesEnd.Click
537 Kontext "Sonderzeichen"
538 Call DialogTest ( Sonderzeichen, 4 )
541 Kontext "TabLocalizedOptions"
542 DoubleQuotesDefault.Click
545 Active.Setpage TabWortergaenzung
546 Kontext "TabWortergaenzung"
547 Call DialogTest ( TabWortergaenzung )
548 printlog " Close Autocorrect dialogue"
549 TabWortergaenzung.Cancel
551 printlog " Close active document"
555 ' -------------------------------------------
557 testcase tToolsOutlineNumbering
558 PrintLog "- Tools / Outline Numbering"
561 printlog " Open new document"
562 ToolsOutlineNumbering
563 printlog " Tools / Outline Numbering"
565 Active.SetPage TabKapitelnumerierung
566 Kontext "TabKapitelnumerierung"
567 Call DialogTest ( TabKapitelnumerierung )
570 Active.SetPage TabPositionKapitelnumerierung
571 Call DialogTest ( TabPositionKapitelnumerierung )
572 printlog " Step through tabpages and close dialog"
574 TabPositionKapitelnumerierung.Cancel
575 printlog " Close active document"
579 ' -------------------------------------------
581 testcase tToolsLineNumbering
582 PrintLog "- Tools / Line Numbering"
585 printlog " Open new document"
587 printlog " Tools / Line Numbering"
588 Kontext "TabZeilennumerierung"
589 printlog " Check checkbox 'Show numbering'"
591 Call DialogTest ( TabZeilennumerierung )
592 printlog " Close dialog"
593 TabZeilennumerierung.Cancel
594 printlog " Close active document"
598 '-----------------------------------------------------------
600 testcase tToolsFootnotes
601 PrintLog "- Tools / Footnotes"
604 printlog " Open new document"
606 printlog " Tools / Footnotes"
608 Active.Setpage TabFussnoten
609 Kontext "TabFussnoten"
610 DialogTest ( TabFussnoten )
611 printlog " Step through all tabpages"
613 Active.SetPage TabEndnoten
614 Kontext "TabEndnoten"
615 DialogTest ( TabEndnoten )
616 printlog " Close dialog"
618 printlog " Close active document"
622 ' -------------------------------------------
624 testcase tToolsGallery
627 printlog "- Tools / Gallery"
629 printlog " Open new document"
631 if Not Gallery.Exists then ToolsGallery
632 printlog " Tools / Gallery"
635 printlog " Gallery has to be opened"
636 if Not Gallery.Exists then
637 Warnlog "Gallery has not been opened! No test"
640 printlog " Step through all themes"
641 printlog "- Step through all Themes"
642 For i = 1 to Gallerys.GetItemCount
646 printlog "- New theme"
651 printlog " Close gallery with Tools / Gallery"
653 if Gallery.Exists then Warnlog "Gallery has not been closed!"
655 printlog " Close active document"
659 ' -------------------------------------------
661 testcase tToolsMailMergeWizard
664 PrintLog "- Tools / Mail Merge"
665 if gApplication = "HTML" then goto endsub
668 printlog " Open new document"
671 printlog " Tools / Mail Merge Wizard"
672 Kontext "MailMergeWizard"
673 if ( MailMergeWizard.Exists( 5 ) ) then
674 printlog( "Dialog <MailmergeWizard> is available" )
676 Warnlog( "FATAL: Dialog <MailmergeWizard> not available" )
681 Call DialogTest ( MailMergeWizard )
682 Kontext "TabMailMergeSourceDocument"
683 Call DialogTest ( TabMailMergeSourceDocument )
685 printlog " Click document 'Browse' button"
689 if ( OeffnenDlg.Exists( 1 ) ) then
692 Warnlog "Filedialog not up on document 'Browse' button"
695 Kontext "TabMailMergeSourceDocument"
696 printlog " Click template 'Browse' button"
700 if ( Neu.exists( 1 ) ) then
701 Call DialogTest ( Neu )
704 warnlog( "Dialog <Neu> is not available" )
707 Kontext "TabMailMergeSourceDocument"
708 printlog " Check 'Use the current document' radio button"
709 UseTheCurrentDocument.Check
711 printlog " Click 'Next' button"
712 Kontext "MailMergeWizard"
715 Kontext "TabMailMergeDocumentType"
716 Call DialogTest ( TabMailMergeDocumentType )
718 printlog " Click 'Next' button"
719 Kontext "MailMergeWizard"
722 Kontext "TabMailMergeAddressBlock"
723 Call DialogTest ( TabMailMergeAddressBlock )
725 printlog " Click 'Select Address List'"
726 SelectAddressListButton.Click
729 if ( Active.Exists( 1 ) ) then
730 if Active.GetRT = 304 then
731 Warnlog Active.Gettext
736 Kontext "SelectAddressList"
737 if ( SelectAddressList.exists( 2 ) ) then
738 Call DialogTest ( SelectAddressList )
740 Warnlog "Problems selecting addresses"
741 Kontext "MailMergeWizard"
742 MailMergeWizard.Cancel
747 printlog " In 'Select address list' dialog click 'Add'"
751 if ( OeffnenDlg.Exists( 1 ) ) then
754 Warnlog "Filedialog not up on template 'Browse' button"
757 Kontext "SelectAddressList"
758 if ( SelectAddressList.exists( 1 ) ) then
759 printlog " In 'Select address list' dialog click 'Create'"
762 warnlog( "Dialog <SelectAddressList> is not available" )
765 Kontext "NewAddressList"
766 if ( NewAddressList.exists( 1 ) ) then
767 Call DialogTest ( NewAddressList )
768 printlog " In 'New address' dialog click 'Find' button"
771 warnlog( "Dialog <NewAddressList> is not available" )
775 if ( FindEntry.Exists( 1 ) ) then
776 Call DialogTest ( FindEntry )
779 Warnlog "Dialog 'Find entry' not up"
782 printlog " In 'New address' dialog click 'Customize' button"
783 Kontext "NewAddressList"
786 Kontext "CustomizeAddressList"
787 if ( CustomizeAddressList.Exists( 1 ) ) then
788 Call DialogTest ( CustomizeAddressList )
789 printlog " In 'Customize Addresss List' dialog select first entry in list"
790 AddressListElements.Select 1
791 printlog " Click 'add' button"
793 Kontext "RenameElement"
794 Call DialogTest ( RenameElement )
795 printlog " Close 'Add Element' dialog"
797 Kontext "CustomizeAddressList"
798 printlog " Click 'Rename' button"
800 Kontext "RenameElement"
801 Call DialogTest ( RenameElement )
804 Kontext "CustomizeAddressList"
805 CustomizeAddressList.Cancel
807 Warnlog "Dialog 'Customize Address List' is not up"
810 printlog " Close all open dialogs"
812 Kontext "NewAddressList"
813 if ( NewAddressList.exists( 1 ) ) then
814 NewAddressList.Cancel
816 warnlog( "Dialog <NewAddressList> is not available" )
819 Kontext "SelectAddressList"
820 if ( SelectAddressList.exists( 1 ) ) then
821 SelectAddressList.Cancel
823 warnlog( "Dialog <SelectAddressList> is not available" )
826 Kontext "MailMergeWizard"
827 if ( MailMergeWizard.exists( 1 ) ) then
828 MailMergeWizard.Cancel
830 warnlog( "Dialog <MailMergeWizard> is not available" )
833 printlog " Close active document"
837 ' -------------------------------------------
839 testcase tToolsTextInTables
840 PrintLog "- Tools / Text <-> Tables"
841 printlog " Open new document"
843 printlog " Insert some text and select it"
844 Call wTypeKeys ("Hallo dieser Text soll in eine Tabelle")
845 Call wTypeKeys ("<Shift Home>")
847 printlog " Tools / Text<->Table"
848 Kontext "TextInTabelleUmwandeln"
849 DialogTest ( TextInTabelleUmwandeln )
850 printlog " Close upcoming dialog"
851 TextInTabelleUmwandeln.Cancel
852 printlog " Close active document"
856 ' -------------------------------------------
860 PrintLog "- Tools / Sort"
863 printlog " Open new document"
866 Call wTypeKeys ("<Return>")
868 Call wTypeKeys ("<Mod1 A>")
871 Call DialogTest ( Sortieren )
873 printlog " Close active document"
877 ' -------------------------------------------
879 testcase tToolsCalculate
880 PrintLog "- Tools / Calculate"
883 printlog " Open new document"
884 Call wTypeKeys( "2+4" )
885 printlog " Insert text: 2+4"
887 printlog " Edit / Select All"
889 printlog " Tools / Calculate"
890 Call wTypeKeys ("<End> Das Ergebnis ist = ")
891 printlog " Paste result of calculation with Edit / Paste"
894 printlog " Close active document"
897 ' -------------------------------------------
899 testcase tToolsUpdate
900 PrintLog "- Tools / Update"
901 if gApplication = "HTML" then
902 printlog "Not in WriterWeb !"
905 printlog " Open new document"
908 printlog " - Update Indexes ( all, current )"
909 printlog " Add a text to document"
910 Call wTypeKeys ("Dieser Text ist zur Aktualisierung")
911 printlog " Insert / Indexes"
916 if ( Active.Exists( 2 ) ) then
917 if active.GetRT = 304 then
918 Warnlog Active.Gettext
925 Active.Setpage TabVerzeichnisseVerzeichnis
927 printlog " Close upcoming Index dialog"
928 Kontext "TabVerzeichnisseVerzeichnis"
929 TabVerzeichnisseVerzeichnis.OK
931 printlog " Tools / Update / All Indexes"
932 hUseAsyncSlot( "ToolsUpdateAllIndexes" )
934 printlog " Tools / Update / Current Index"
935 ToolsUpdateCurrentIndex
937 printlog " - Update Fields"
938 Call wTypeKeys ("<Up><Home><Tab>")
940 printlog " Insert / Fields / Author"
943 printlog " Insert / Fields / Time"
946 printlog " Tools / Update / Fields"
947 hUseAsyncSlot( "ToolsUpdateFields" )
949 printlog " - Update links"
950 printlog " Insert a graphic from file"
951 Call hGrafikVerknuepftEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
952 if ( hUseAsyncSlot( "ToolsUpdateLinks" ) = -1 ) then
953 Warnlog "Links can't be updated!"
956 printlog " - Update / Reformat Pages with Tools / Page formatting"
959 printlog " - update all with Tools / Update / Update All"
962 printlog " Close all active documents"
966 ' -------------------------------------------
968 testcase tToolsHangulHanjaConversion
969 Dim bAsianLanguage as Boolean
970 Dim sTestFile as String
972 if ( gApplication = "MASTERDOCUMENT" ) then
976 select case gApplication
977 case "HTML" : sTestFile = gTesttoolpath & "writer\required\input\hangul.html"
978 case "WRITER" : sTestFile = gTesttoolpath & "writer\required\input\hangul.sxw"
979 case default : goto endsub
982 PrintLog "- Tools / HangulHanjaConversion"
984 printlog " Enable 'Asian Language support' ON"
985 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
987 printlog " Open the test file"
988 hFileOpenLocally(sTestFile)
989 Call wTypeKeys("<MOD1 Home>")
991 printlog " Tools / HangulHanjaConversion"
993 ToolsLanguageHangulHanjaConversion
995 Warnlog "- Format / HangulHanjaConversion is disabled or hidden!"
996 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1001 Kontext "HangulHanjaConversion"
1002 if HangulHanjaConversion.Exists then
1003 Call DialogTest ( HangulHanjaConversion )
1005 Warnlog "- Format / HangulHanjaConversion doesn't work. Dialog is not up"
1006 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1011 printlog " Click button 'Options'"
1014 Kontext "HangulHanjaOptions"
1015 Call DialogTest ( HangulHanjaOptions )
1017 Warnlog "- Something is wrong in the button 'Options' !"
1023 Kontext "HangulHanjaNewDictionary"
1024 Call DialogTest ( HangulHanjaNewDictionary )
1025 HangulHanjaNewDictionary.Close
1027 Kontext "HangulHanjaOptions"
1028 HangulHanjaOptions.Cancel
1030 Kontext "HangulHanjaConversion"
1031 printlog " Close HangulHanja dialog"
1032 HangulHanjaConversion.Close
1034 printlog " Set the 'Asian Language support' to default"
1035 if bAsianLanguage = FALSE then
1036 Call ActiveDeactivateAsianSupport(FALSE)
1039 printlog " Close all active documents"
1040 Do Until GetDocumentCount = 0
1045 ' -------------------------------------------
1047 testcase tToolsChineseTranslation
1049 Dim bAsianLanguage as Boolean
1051 PrintLog "- Tools / Language / Chinese Translation"
1053 printlog " Open a new document"
1056 printlog " Enable 'Asian Language support' ON"
1057 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
1059 printlog " Tools / Language / Chinese Translation"
1061 ToolsLanguageChineseTranslation
1063 Warnlog "- Tools/language / Chinese Translation is disabled or hidden!"
1068 Kontext "ChineseTranslation"
1069 if ChineseTranslation.Exists then
1070 Call DialogTest ( ChineseTranslation )
1072 Warnlog "#i41364#Tools-> Language -> Chinese Translation does not work!"
1077 printlog " Press 'Edit Terms' button , a new dialog should appear"
1081 Warnlog "- Something is wrong in the button 'Edit Terms' !"
1082 Kontext "ChineseTranslation"
1083 ChineseTranslation.Cancel
1088 Kontext "ChineseDictionary"
1089 if ChineseDictionary.Exists then
1090 Call DialogTest ( ChineseDictionary )
1092 Warnlog "Button 'Edit Terms' does not bring up the dialog!"
1093 Kontext "ChineseTranslation"
1094 ChineseTranslation.Cancel
1098 ChineseDictionary.Cancel
1100 Kontext "ChineseTranslation"
1101 ChineseTranslation.Cancel
1103 printlog " Set the 'Asian Language support' to default"
1104 if bAsianLanguage = FALSE then
1105 Call ActiveDeactivateAsianSupport(FALSE)
1108 printlog " Close active document"
1112 ' -------------------------------------------
1114 testcase tHtmlDocToolsHangulHanjaConversion
1116 Dim bAsianLanguage as Boolean
1117 Dim sTestFile as String
1119 gApplication = "HTML"
1120 PrintLog "- Tools / HangulHanjaConversion"
1121 sTestFile = Convertpath (gTesttoolpath + "writer\required\input\hangul.html")
1123 printlog " Enable 'Asian Language support' ON"
1124 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
1126 printlog " Open the test file"
1127 hFileOpenLocally(sTestFile)
1128 Call wTypeKeys("<MOD1 Home>")
1130 printlog " Tools / HangulHanjaConversion"
1131 if ( hUseAsyncSlot( "ToolsLanguageHangulHanjaConversion" ) = -1 ) then
1132 Warnlog "- Format / HangulHanjaConversion is disabled or hidden!"
1133 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1138 Kontext "HangulHanjaConversion"
1139 if ( HangulHanjaConversion.Exists( 1 ) ) then
1140 Call DialogTest ( HangulHanjaConversion )
1142 Warnlog "- Format / HangulHanjaConversion doesn't work. Dialog is not up"
1143 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1148 printlog " Click button 'Options'"
1151 Kontext "HangulHanjaOptions"
1152 Call DialogTest ( HangulHanjaOptions )
1154 Warnlog "- Something is wrong in the button 'Options' !"
1160 Kontext "HangulHanjaNewDictionary"
1161 Call DialogTest ( HangulHanjaNewDictionary )
1162 HangulHanjaNewDictionary.Close
1164 Kontext "HangulHanjaOptions"
1165 HangulHanjaOptions.Cancel
1167 Kontext "HangulHanjaConversion"
1168 printlog " Close HangulHanja dialog"
1169 HangulHanjaConversion.Close
1171 printlog " Set the 'Asian Language support' to default"
1172 if bAsianLanguage = FALSE then
1173 Call ActiveDeactivateAsianSupport(FALSE)
1176 PrintLog "Close active documents"
1177 Do Until GetDocumentCount = 0
1180 gApplication = "WRITER"
1183 ' -------------------------------------------
1185 testcase tMasterDocToolsHyphenation
1186 Dim sTestFile as string
1187 Dim LingFile as string
1189 gApplication = "MASTERDOCUMENT"
1190 PrintLog "- Tools / Hyphenation"
1192 ' As long as OOo has no modules for that, disabled
1194 printlog "No hyphenation in OOo"
1198 select case iSprache
1200 LingFile = "01-44-hyph.dat"
1201 sTestFile = gTesttoolpath + "writer\required\input\linguistik\001.odt"
1203 sTestFile = gTesttoolpath + "writer\required\input\linguistik\007.odt"
1205 sTestFile = gTesttoolpath + "writer\required\input\linguistik\003.odt"
1207 Printlog "- No Hyphenation in Japanese!"
1210 Printlog "- No Hyphenation in Korean!"
1213 Printlog "- No Hyphenation in Chinese (simplified)!"
1216 Printlog "- No Hyphenation in Chinese (traditional)!"
1219 sTestFile = gTesttoolpath + "writer\required\input\linguistik\0" + trim$(str$(iSprache)) + ".odt"
1220 LingFile = str$(iSprache) + "-hyph.dat"
1223 sTestFile = convertpath( sTestFile )
1224 if ( not FileExists( sTestFile ) )then
1225 Warnlog "No defined Errortext for language: " + isprache + "! Exit!"
1229 if ( not wInsertDocumentinMasterDoc( sTestFile ) ) then
1230 Warnlog "Loading document did not work!"
1234 printlog " Open new document"
1235 hUseAsyncSlot( "EditPaste" )
1239 printlog " Insert file 'writer\required\input\linguistik\0 + [OfficeLanguage] + '.odt'"
1241 Call wTypeKeys ("<Mod1 Home>")
1243 printlog " Tools / Hyphenate"
1244 hUseAsyncSlot( "ToolsLanguageHyphenate" )
1246 ' This is probably a workaround to make the hyphenation dialog work in any case.
1248 ' We really only know of three possible dialogs (in order of appearance):
1249 ' 1: Continue checking at the beginning of the document (Yes/No)
1250 ' 2: Hyphenation for language not installed (Ok)
1251 ' 3: Hyphenation completed (Ok)
1253 ' I have not changed the code, only beautified it a little but i feel the outcome of
1254 ' this test is somewhat random.
1256 if ( Active.exists( 1 ) ) then
1258 ' JSK: These messagboxes were originally handled silently.
1259 ' So i have no idea which of those is expected and which is not...
1260 printlog( "Messagebox: " & Active.getText() )
1262 printlog( "Trying to close messageboy with <YES>" )
1265 printlog( "<YES> failed... (Whatever that means)" )
1268 if ( Active.Exists() ) then
1269 printlog( "Messagebx: " & Active.getText() )
1270 if ( Active.GetRT() = 304 ) then
1272 ' Force pagesize change to bringup Hyphenation-dialog
1273 hUseAsyncSlot( "FormatPageWriter" )
1276 active.SetPage TabSeite
1281 hUseAsyncSlot( "ToolsLanguageHyphenate" )
1286 Kontext "Hyphenation"
1287 printlog " Close upcoming 'Hyphenation' dialog"
1288 if ( Hyphenation.Exists( 2 ) ) then
1289 Call DialogTest ( Hyphenation )
1292 Warnlog "Dialog 'Hyphenation' not up!"
1294 if ( Active.Exists() ) then
1302 printlog " Close active documents"
1304 gApplication = "WRITER"
1307 ' -------------------------------------------