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_007_.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:41:47 $
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 : Testcases for the Tools-Menu
38 '\***********************************************************************
42 printLog Chr(13) + "--------- Tools Menu (w_007_.inc) ----------"
43 gApplication = "WRITER"
47 Call tToolsHyphenation
49 Call tToolsAutocorrectAutoformat
50 Call tToolsOutlineNumbering
51 Call tToolsLineNumbering
54 Call tToolsMailMergeWizard
55 Call tToolsTextInTables
59 Call tToolsOptionsTest
60 Call tToolsHangulHanjaConversion
61 Call tToolsChineseTranslation
65 Call tHtmlDocToolsHangulHanjaConversion
67 'Writer Master Document
68 gApplication = "MASTERDOCUMENT"
69 Call tMasterDocToolsHyphenation
70 gApplication = "WRITER"
73 ' -------------------------------------------
75 testcase tToolsSpellcheck
76 PrintLog "- Tools / Spellcheck"
79 Dim IsWriteable as boolean
81 ' As long as OOo has no modules for that, disabled
83 printlog "No spellchecking in OOo"
87 printlog " Open document where the formatting is set to the language we wish to test."
88 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
89 if ( not hFileExists ( TheFile ) ) then
90 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
94 Call sMakeReadOnlyDocumentEditable
96 printlog " Insert some faulty text"
98 case 01 : Call wTypeKeys ("This is a spellchecktestttttt<Home>")
99 case 33 : Call wTypeKeys ("Je Suiss la Penneeee<Home>")
100 case 34 : Call wTypeKeys ("Habla Espanollll<Home>")
101 case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
102 case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
103 case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
104 case 07 : Printlog "- No Spellcheck in Russian!"
106 case 48 : Printlog "- No Spellcheck in Polish!"
108 case 55 : Printlog "- No Spellcheck in Brazilian!"
110 case 81 : Printlog "- No Spellcheck in Japanese!"
112 case 82 : Printlog "- No Spellcheck in Korean!"
114 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
116 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
118 case 03, 30, 35, 36, 37, 42, 47, 51, 90
119 Printlog "- No Spellcheck available !"
124 printlog " Tools / Spellcheck / Check"
125 ToolsSpellcheckWriter
127 if ( Active.Exists( 1 ) ) then
128 if Active.GetRT = 304 then
130 Active.Yes ' Start from beginning ?
131 if Active.exists then
132 if Active.GetRT = 304 then Active.Ok
133 Warnlog "Dialog 'Spellcheck' not up!"
139 Warnlog "Dialog 'Spellcheck' not up!"
146 printlog " Spellcheck dialog has to come up"
148 DialogTest ( Spellcheck )
150 printlog " Click 'Options'"
151 SpellcheckOptions.Click
154 kontext "TabLinguistik"
155 DialogTest ( TabLinguistik )
157 printlog " Step through all options in list and if 'Edit' is enabled click 'Edit'"
159 kontext "TabLinguistik"
160 Optionen.TypeKeys "<Down>"
161 if OptionenBearbeiten.IsEnabled then
162 OptionenBearbeiten.Click
164 Kontext "SilbentrennungOptionen"
165 DialogTest ( SilbentrennungOptionen )
166 SilbentrennungOptionen.Cancel
170 printlog " Click 'New' in Options dialog"
174 Kontext "BenutzerwoerterbuchAnlegen"
175 Call DialogTest ( BenutzerwoerterbuchAnlegen )
176 BenutzerwoerterbuchAnlegen.Close
178 printlog " Check if there s a writeable dictionary and select it"
179 Kontext "TabLinguistik"
180 for i = 1 to Benutzerwoerterbuch.GetItemCount
181 Benutzerwoerterbuch.Select i
182 if Bearbeiten.IsEnabled = true then
188 if IsWriteable = true then
190 printlog " Click 'Edit' in 'Options dialog'"
192 Kontext "BenutzerwoerterbuchBearbeiten"
193 if BenutzerwoerterbuchBearbeiten.Exists(1) then
194 Call DialogTest ( BenutzerwoerterbuchBearbeiten )
195 BenutzerwoerterbuchBearbeiten.Close
197 Warnlog "Dialog 'Edit Dictionary' is not up!"
200 Warnlog "All dictionarys are write protected!"
203 printlog " Close 'Options' dialog"
204 Kontext "TabLinguistik"
209 printlog " Close 'Spellcheck' dialog"
212 PrintLog "Close active documents"
213 Do Until GetDocumentCount = 0
218 ' -------------------------------------------
220 testcase tToolsThesaurus
221 PrintLog "- Tools / Thesaurus"
222 Dim TheFile as string
224 ' As long as OOo has no modules for that, disabled
226 printlog "No spellchecking in OOo"
231 case 07 : Printlog "- No Thesaurus in Russian!"
233 case 48 : Printlog "- No Thesaurus in Polish!"
235 case 55 : Printlog "- No Thesaurus in Brazilian!"
237 case 81 : Printlog "- No Thesaurus in Japanese!"
239 case 82 : Printlog "- No Thesaurus in Korean!"
241 case 86 : Printlog "- No Thesaurus in Chinese (simplified)!"
243 case 88 : Printlog "- No Thesaurus in Chinese (traditional)!"
245 case 03, 30, 35, 36, 37, 42, 47, 51, 90
246 Printlog "- No Thesaurus available !"
250 printlog " Open document where the formatting is set to the language we wish to test."
251 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
252 if ( not hFileExists ( TheFile ) ) then
253 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
256 call hFileOpen( TheFile )
257 Call sMakeReadOnlyDocumentEditable
259 printlog " Insert some faulty text"
261 case 01 : Call wTypeKeys ("This is a spellchecktestttttt<Home>")
262 case 33 : Call wTypeKeys ("Je Suiss la Penneeee<Home>")
263 case 34 : Call wTypeKeys ("Habla Espanollll<Home>")
264 case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
265 case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
266 case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
267 case 07 : Printlog "- No Thesaurus in Russian!"
269 case 48 : Printlog "- No Thesaurus in Polish!"
271 case 55 : Printlog "- No Thesaurus in Brazilian!"
273 case 81 : Printlog "- No Thesaurus in Japanese!"
275 case 82 : Printlog "- No Thesaurus in Korean!"
277 case 86 : Printlog "- No Thesaurus in Chinese (simplified)!"
279 case 88 : Printlog "- No Thesaurus in Chinese (traditional)!"
281 case 03, 30, 35, 36, 37, 42, 47, 51, 90
282 Printlog "- No Thesaurus available !"
287 ToolsLanguageThesaurus
289 if Active.Exists then
291 Warnlog "Dialog 'Thesaurus' not up!"
297 DialogTest ( Thesaurus )
298 printlog " In 'Thesaurus' dialog click 'Language'"
300 Kontext "SpracheAuswaehlen"
301 DialogTest ( SpracheAuswaehlen )
302 printlog " Close 'Language' dialog"
303 SpracheAuswaehlen.Cancel
305 printlog " Close 'Thesaurus' dialog"
307 PrintLog "Close active documents"
308 Do Until GetDocumentCount = 0
313 ' -------------------------------------------
315 testcase tToolsHyphenation
316 Dim DieDatei as string
317 Dim LingFile as string
319 PrintLog "- Tools / Hyphenation"
320 ' As long as OOo has no modules for that, disabled
322 printlog "No hyphenation in OOo"
326 if gBuild < 9239 then
327 QAErrorlog "Hyphenation dialog freezes office!"
332 case 1,01 : LingFile = "01-44-hyph.dat"
333 DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\001.odt" )
334 case 7,07 : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\007.odt" )
335 case 3,03 : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\003.odt" )
336 case 81 : Printlog "- No Hyphenation in Japanese!"
338 case 82 : Printlog "- No Hyphenation in Korean!"
340 case 86 : Printlog "- No Hyphenation in Chinese (simplified)!"
342 case 88 : Printlog "- No Hyphenation in Chinese (traditional)!"
344 case else : DieDatei = ConvertPath( gTesttoolpath + "writer\required\input\linguistik\0" + trim$(str$(iSprache)) + ".odt" )
345 LingFile = str$(iSprache) + "-hyph.dat"
348 if ( not hFileExists( DieDatei ) ) then
349 Warnlog "No defined Errortext for language: " + isprache + "! Exit!"
353 Select Case gApplication
355 hFileOpen( DieDatei )
357 Case "MASTERDOCUMENT"
358 if wInsertDocumentinMasterDoc(DieDatei) = False then
359 Warnlog "Loading document did not work!"
363 printlog " Open new document"
364 hUseAsyncSlot( "EditPaste" )
368 printlog "- No Hyphenation in WriterWeb!"
372 Call sMakeReadOnlyDocumentEditable
373 printlog " Insert file 'writer\required\input\linguistik\0 + [OfficeLanguage] + '.odt'"
375 Call wTypeKeys ("<Mod1 Home>")
377 hUseAsyncSlot( "ToolsLanguageHyphenate" )
378 printlog " Tools / Hyphenate"
384 if ( Active.Exists( 1 ) )then
385 if Active.GetRT = 304 then
387 ' Force pagesize change to bringup Hyphenation-dialog
388 hUseAsyncSlot( "FormatPageWriter" )
390 active.SetPage TabSeite
395 hUseAsyncSlot( "ToolsLanguageHyphenate" )
399 Kontext "Silbentrennung"
400 printlog " Close upcoming 'Hyphenation' dialog"
401 if Silbentrennung.Exists then
402 Call DialogTest ( Silbentrennung )
403 Silbentrennung.Cancel
405 Warnlog "Dialog 'Hyphenation' not up!"
407 if Active.Exists then
415 PrintLog "Close active documents"
416 Do Until GetDocumentCount = 0
421 ' -------------------------------------------
423 testcase tToolsWordCount
424 Printlog "- Tools / Word Count"
425 printlog " New Text document"
427 printlog " Tools / Word Count"
429 printlog " If if dialog has been opened"
431 if ( WordCount.Exists( 1 ) ) then
432 Call DialogTest ( WordCount )
433 printlog " Close dialog 'WordCount'"
436 Warnlog "Dialog 'WordCount' has not been opened!"
438 printlog " Close Text document"
442 ' -------------------------------------------
444 testcase tToolsAutocorrectAutoformat
445 PrintLog "- Tools / Autocorrect / Autoformat"
449 printlog " Open new document"
451 printlog " Tools / Autocorrect/Autoformat"
454 if Active.Exists then
455 if Active.GetRT = 304 then
456 Warnlog Active.Gettext
461 printlog " Step through all tabpages"
463 active.SetPage TabErsetzung
465 if Active.Exists then
466 if Active.GetRT = 304 then
467 Warnlog Active.Gettext
471 Kontext "TabErsetzung"
472 Call DialogTest ( TabErsetzung )
475 active.SetPage TabAusnahmen
477 if Active.Exists then
478 if Active.GetRT = 304 then
479 Warnlog Active.Gettext
483 Kontext "TabAusnahmen"
484 Call DialogTest ( TabAusnahmen )
487 active.SetPage TabOptionenAutokorrektur
488 Kontext "TabOptionenAutokorrektur"
489 Call DialogTest ( TabOptionenAutokorrektur )
490 printlog " Step through all options in list"
491 printlog " Tabpage Options: With entry 11 button 'Edit' should be enabled"
492 Einstellungen.TypeKeys "<Down>",11
494 if Bearbeiten.IsEnabled then
496 Kontext "Sonderzeichen"
497 DialogTest (Sonderzeichen)
500 Warnlog "- Button 'Edit' on Entry 11 disabled!"
503 Kontext "TabOptionenAutokorrektur"
504 printlog " Tabpage Options: With entry 17 button 'Edit' should be enabled"
505 Einstellungen.TypeKeys "<Down>",6
507 if Bearbeiten.IsEnabled then
509 Kontext "Sonderzeichen"
510 DialogTest (Sonderzeichen)
513 Warnlog "- Button 'Edit' on Entry 16 disabled!"
516 Kontext "TabOptionenAutokorrektur"
517 printlog " Tabpage Options: With entry 19 button 'Edit' should be enabled"
518 Einstellungen.TypeKeys "<Down>",2
520 if Bearbeiten.IsEnabled then
522 Kontext "Zusammenfassen"
523 DialogTest (Zusammenfassen)
524 Zusammenfassen.Cancel
525 Kontext "TabOptionenAutokorrektur"
527 Warnlog "- Button 'Edit' on Entry 18 disabled!"
531 active.SetPage TabTypografisch
532 Kontext "TabTypografisch"
533 EinfachWortAnfang.Click
534 Kontext "Sonderzeichen"
535 Call DialogTest ( Sonderzeichen, 1 )
538 Kontext "TabTypografisch"
539 EinfachWortEnde.Click
540 Kontext "Sonderzeichen"
541 Call DialogTest ( Sonderzeichen, 2 )
544 Kontext "TabTypografisch"
545 EinfachStandard.Click
547 Kontext "TabTypografisch"
548 DoppeltWortAnfang.Click
549 Kontext "Sonderzeichen"
550 Call DialogTest ( Sonderzeichen, 3 )
553 Kontext "TabTypografisch"
554 DoppeltWortEnde.Click
555 Kontext "Sonderzeichen"
556 Call DialogTest ( Sonderzeichen, 4 )
559 Kontext "TabTypografisch"
560 DoppeltStandard.Click
563 Active.Setpage TabWortergaenzung
564 Kontext "TabWortergaenzung"
565 Call DialogTest ( TabWortergaenzung )
566 printlog " Close Autocorrect dialogue"
567 TabWortergaenzung.Cancel
569 printlog " Close active document"
573 ' -------------------------------------------
575 testcase tToolsOutlineNumbering
576 PrintLog "- Tools / Outline Numbering"
579 printlog " Open new document"
580 ToolsOutlineNumbering
581 printlog " Tools / Outline Numbering"
583 Active.SetPage TabKapitelnumerierung
584 Kontext "TabKapitelnumerierung"
585 Call DialogTest ( TabKapitelnumerierung )
588 Active.SetPage TabPositionKapitelnumerierung
589 Call DialogTest ( TabPositionKapitelnumerierung )
590 printlog " Step through tabpages and close dialog"
592 TabPositionKapitelnumerierung.Cancel
593 printlog " Close active document"
597 ' -------------------------------------------
599 testcase tToolsLineNumbering
600 PrintLog "- Tools / Line Numbering"
603 printlog " Open new document"
605 printlog " Tools / Line Numbering"
606 Kontext "TabZeilennumerierung"
607 printlog " Check checkbox 'Show numbering'"
609 Call DialogTest ( TabZeilennumerierung )
610 printlog " Close dialog"
611 TabZeilennumerierung.Cancel
612 printlog " Close active document"
616 '-----------------------------------------------------------
618 testcase tToolsFootnotes
619 PrintLog "- Tools / Footnotes"
622 printlog " Open new document"
624 printlog " Tools / Footnotes"
626 Active.Setpage TabFussnoten
627 Kontext "TabFussnoten"
628 DialogTest ( TabFussnoten )
629 printlog " Step through all tabpages"
631 Active.SetPage TabEndnoten
632 Kontext "TabEndnoten"
633 DialogTest ( TabEndnoten )
634 printlog " Close dialog"
636 printlog " Close active document"
640 ' -------------------------------------------
642 testcase tToolsGallery
645 printlog "- Tools / Gallery"
647 printlog " Open new document"
649 if Not Gallery.Exists then ToolsGallery
650 printlog " Tools / Gallery"
653 printlog " Gallery has to be opened"
654 if Not Gallery.Exists then
655 Warnlog "Gallery has not been opened! No test"
658 printlog " Step through all themes"
659 printlog "- Step through all Themes"
660 For i = 1 to Gallerys.GetItemCount
664 printlog "- New theme"
669 printlog " Close gallery with Tools / Gallery"
671 if Gallery.Exists then Warnlog "Gallery has not been closed!"
673 printlog " Close active document"
677 ' -------------------------------------------
679 testcase tToolsMailMergeWizard
682 PrintLog "- Tools / Mail Merge"
683 if gApplication = "HTML" then goto endsub
686 printlog " Open new document"
689 printlog " Tools / Mail Merge Wizard"
690 Kontext "MailMergeWizard"
691 if ( MailMergeWizard.Exists( 5 ) ) then
692 printlog( "Dialog <MailmergeWizard> is available" )
694 Warnlog( "FATAL: Dialog <MailmergeWizard> not available" )
699 Call DialogTest ( MailMergeWizard )
700 Kontext "TabMailMergeSourceDocument"
701 Call DialogTest ( TabMailMergeSourceDocument )
703 printlog " Click document 'Browse' button"
707 if ( OeffnenDlg.Exists( 1 ) ) then
710 Warnlog "Filedialog not up on document 'Browse' button"
713 Kontext "TabMailMergeSourceDocument"
714 printlog " Click template 'Browse' button"
718 if ( Neu.exists( 1 ) ) then
719 Call DialogTest ( Neu )
722 warnlog( "Dialog <Neu> is not available" )
725 Kontext "TabMailMergeSourceDocument"
726 printlog " Check 'Use the current document' radio button"
727 UseTheCurrentDocument.Check
729 printlog " Click 'Next' button"
730 Kontext "MailMergeWizard"
733 Kontext "TabMailMergeDocumentType"
734 Call DialogTest ( TabMailMergeDocumentType )
736 printlog " Click 'Next' button"
737 Kontext "MailMergeWizard"
740 Kontext "TabMailMergeAddressBlock"
741 Call DialogTest ( TabMailMergeAddressBlock )
743 printlog " Click 'Select Address List'"
744 SelectAddressListButton.Click
747 if ( Active.Exists( 1 ) ) then
748 if Active.GetRT = 304 then
749 Warnlog Active.Gettext
754 Kontext "SelectAddressList"
755 if ( SelectAddressList.exists( 2 ) ) then
756 Call DialogTest ( SelectAddressList )
758 Warnlog "Problems selecting addresses"
759 Kontext "MailMergeWizard"
760 MailMergeWizard.Cancel
765 printlog " In 'Select address list' dialog click 'Add'"
769 if ( OeffnenDlg.Exists( 1 ) ) then
772 Warnlog "Filedialog not up on template 'Browse' button"
775 Kontext "SelectAddressList"
776 if ( SelectAddressList.exists( 1 ) ) then
777 printlog " In 'Select address list' dialog click 'Create'"
780 warnlog( "Dialog <SelectAddressList> is not available" )
783 Kontext "NewAddressList"
784 if ( NewAddressList.exists( 1 ) ) then
785 Call DialogTest ( NewAddressList )
786 printlog " In 'New address' dialog click 'Find' button"
789 warnlog( "Dialog <NewAddressList> is not available" )
793 if ( FindEntry.Exists( 1 ) ) then
794 Call DialogTest ( FindEntry )
797 Warnlog "Dialog 'Find entry' not up"
800 printlog " In 'New address' dialog click 'Customize' button"
801 Kontext "NewAddressList"
804 Kontext "CustomizeAddressList"
805 if ( CustomizeAddressList.Exists( 1 ) ) then
806 Call DialogTest ( CustomizeAddressList )
807 printlog " In 'Customize Addresss List' dialog select first entry in list"
808 AddressListElements.Select 1
809 printlog " Click 'add' button"
811 Kontext "RenameElement"
812 Call DialogTest ( RenameElement )
813 printlog " Close 'Add Element' dialog"
815 Kontext "CustomizeAddressList"
816 printlog " Click 'Rename' button"
818 Kontext "RenameElement"
819 Call DialogTest ( RenameElement )
822 Kontext "CustomizeAddressList"
823 CustomizeAddressList.Cancel
825 Warnlog "Dialog 'Customize Address List' is not up"
828 printlog " Close all open dialogs"
830 Kontext "NewAddressList"
831 if ( NewAddressList.exists( 1 ) ) then
832 NewAddressList.Cancel
834 warnlog( "Dialog <NewAddressList> is not available" )
837 Kontext "SelectAddressList"
838 if ( SelectAddressList.exists( 1 ) ) then
839 SelectAddressList.Cancel
841 warnlog( "Dialog <SelectAddressList> is not available" )
844 Kontext "MailMergeWizard"
845 if ( MailMergeWizard.exists( 1 ) ) then
846 MailMergeWizard.Cancel
848 warnlog( "Dialog <MailMergeWizard> is not available" )
851 printlog " Close active document"
855 ' -------------------------------------------
857 testcase tToolsTextInTables
858 PrintLog "- Tools / Text <-> Tables"
859 printlog " Open new document"
861 printlog " Insert some text and select it"
862 Call wTypeKeys ("Hallo dieser Text soll in eine Tabelle")
863 Call wTypeKeys ("<Shift Home>")
865 printlog " Tools / Text<->Table"
866 Kontext "TextInTabelleUmwandeln"
867 DialogTest ( TextInTabelleUmwandeln )
868 printlog " Close upcoming dialog"
869 TextInTabelleUmwandeln.Cancel
870 printlog " Close active document"
874 ' -------------------------------------------
878 PrintLog "- Tools / Sort"
881 printlog " Open new document"
884 Call wTypeKeys ("<Return>")
886 Call wTypeKeys ("<Mod1 A>")
889 Call DialogTest ( Sortieren )
891 printlog " Close active document"
895 ' -------------------------------------------
897 testcase tToolsCalculate
898 PrintLog "- Tools / Calculate"
901 printlog " Open new document"
902 Call wTypeKeys( "2+4" )
903 printlog " Insert text: 2+4"
905 printlog " Edit / Select All"
907 printlog " Tools / Calculate"
908 Call wTypeKeys ("<End> Das Ergebnis ist = ")
909 printlog " Paste result of calculation with Edit / Paste"
912 printlog " Close active document"
915 ' -------------------------------------------
917 testcase tToolsUpdate
918 PrintLog "- Tools / Update"
919 if gApplication = "HTML" then
920 printlog "Not in WriterWeb !"
923 printlog " Open new document"
926 printlog " - Update Indexes ( all, current )"
927 printlog " Add a text to document"
928 Call wTypeKeys ("Dieser Text ist zur Aktualisierung")
929 printlog " Insert / Indexes"
933 if ( Active.Exists( 2 ) ) then
934 if active.GetRT = 304 then
935 Warnlog Active.Gettext
941 Active.Setpage TabVerzeichnisseVerzeichnis
943 printlog " Close upcoming Index dialog"
944 Kontext "TabVerzeichnisseVerzeichnis"
945 TabVerzeichnisseVerzeichnis.OK
947 printlog " Tools / Update / All Indexes"
948 hUseAsyncSlot( "ToolsUpdateAllIndexes" )
950 printlog " Tools / Update / Current Index"
951 ToolsUpdateCurrentIndex
953 printlog " - Update Fields"
954 Call wTypeKeys ("<Up><Home><Tab>")
956 printlog " Insert / Fields / Author"
959 printlog " Insert / Fields / Time"
962 printlog " Tools / Update / Fields"
963 hUseAsyncSlot( "ToolsUpdateFields" )
965 printlog " - Update links"
966 printlog " Insert a graphic from file"
967 Call hGrafikVerknuepftEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
968 if ( hUseAsyncSlot( "ToolsUpdateLinks" ) = -1 ) then
969 Warnlog "Links can't be updated!"
972 printlog " - Update / Reformat Pages with Tools / Page formatting"
975 printlog " - update all with Tools / Update / Update All"
978 printlog " Close all active documents"
982 ' -------------------------------------------
984 testcase tToolsHangulHanjaConversion
985 Dim bAsianLanguage as Boolean
986 Dim sTestFile as String
988 if ( gApplication = "MASTERDOCUMENT" ) then
992 select case gApplication
993 case "HTML" : sTestFile = gTesttoolpath & "writer\required\input\hangul.html"
994 case "WRITER" : sTestFile = gTesttoolpath & "writer\required\input\hangul.sxw"
995 case default : goto endsub
998 PrintLog "- Tools / HangulHanjaConversion"
1000 printlog " Enable 'Asian Language support' ON"
1001 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
1003 printlog " Open the test file"
1004 hFileOpen (sTestFile)
1005 Call sMakeReadOnlyDocumentEditable
1006 Call wTypeKeys("<MOD1 Home>")
1008 printlog " Tools / HangulHanjaConversion"
1010 ToolsLanguageHangulHanjaConversion
1012 Warnlog "- Format / HangulHanjaConversion is disabled or hidden!"
1013 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1018 Kontext "HangulHanjaConversion"
1019 if HangulHanjaConversion.Exists then
1020 Call DialogTest ( HangulHanjaConversion )
1022 Warnlog "- Format / HangulHanjaConversion doesn't work. Dialog is not up"
1023 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1028 printlog " Click button 'Options'"
1031 Kontext "HangulHanjaOptions"
1032 Call DialogTest ( HangulHanjaOptions )
1034 Warnlog "- Something is wrong in the button 'Options' !"
1040 Kontext "HangulHanjaNewDictionary"
1041 Call DialogTest ( HangulHanjaNewDictionary )
1042 HangulHanjaNewDictionary.Close
1044 Kontext "HangulHanjaOptions"
1045 HangulHanjaOptions.Cancel
1047 Kontext "HangulHanjaConversion"
1048 printlog " Close HangulHanja dialog"
1049 HangulHanjaConversion.Close
1051 printlog " Set the 'Asian Language support' to default"
1052 if bAsianLanguage = FALSE then
1053 Call ActiveDeactivateAsianSupport(FALSE)
1056 printlog " Close all active documents"
1057 Do Until GetDocumentCount = 0
1062 ' -------------------------------------------
1064 testcase tToolsChineseTranslation
1066 Dim bAsianLanguage as Boolean
1068 PrintLog "- Tools / Language / Chinese Translation"
1070 printlog " Open a new document"
1073 printlog " Enable 'Asian Language support' ON"
1074 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
1076 printlog " Tools / Language / Chinese Translation"
1078 ToolsLanguageChineseTranslation
1080 Warnlog "- Tools/language / Chinese Translation is disabled or hidden!"
1085 Kontext "ChineseTranslation"
1086 if ChineseTranslation.Exists then
1087 Call DialogTest ( ChineseTranslation )
1089 Warnlog "#i41364#Tools-> Language -> Chinese Translation does not work!"
1094 printlog " Press 'Edit Terms' button , a new dialog should appear"
1098 Warnlog "- Something is wrong in the button 'Edit Terms' !"
1099 Kontext "ChineseTranslation"
1100 ChineseTranslation.Cancel
1105 Kontext "ChineseDictionary"
1106 if ChineseDictionary.Exists then
1107 Call DialogTest ( ChineseDictionary )
1109 Warnlog "Button 'Edit Terms' does not bring up the dialog!"
1110 Kontext "ChineseTranslation"
1111 ChineseTranslation.Cancel
1115 ChineseDictionary.Cancel
1117 Kontext "ChineseTranslation"
1118 ChineseTranslation.Cancel
1120 printlog " Set the 'Asian Language support' to default"
1121 if bAsianLanguage = FALSE then
1122 Call ActiveDeactivateAsianSupport(FALSE)
1125 printlog " Close active document"
1129 ' -------------------------------------------
1131 testcase tHtmlDocToolsHangulHanjaConversion
1132 Dim bAsianLanguage as Boolean
1133 Dim sTestFile as String
1135 gApplication = "HTML"
1136 PrintLog "- Tools / HangulHanjaConversion"
1137 sTestFile = Convertpath (gTesttoolpath + "writer\required\input\hangul.html")
1139 printlog " Enable 'Asian Language support' ON"
1140 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
1142 printlog " Open the test file"
1143 hFileOpen (sTestFile)
1144 Call sMakeReadOnlyDocumentEditable
1145 Call wTypeKeys("<MOD1 Home>")
1147 printlog " Tools / HangulHanjaConversion"
1148 if ( hUseAsyncSlot( "ToolsLanguageHangulHanjaConversion" ) = -1 ) then
1149 Warnlog "- Format / HangulHanjaConversion is disabled or hidden!"
1150 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1155 Kontext "HangulHanjaConversion"
1156 if ( HangulHanjaConversion.Exists( 1 ) ) then
1157 Call DialogTest ( HangulHanjaConversion )
1159 Warnlog "- Format / HangulHanjaConversion doesn't work. Dialog is not up"
1160 bAsianLanguage = ActiveDeactivateAsianSupport(False)
1165 printlog " Click button 'Options'"
1168 Kontext "HangulHanjaOptions"
1169 Call DialogTest ( HangulHanjaOptions )
1171 Warnlog "- Something is wrong in the button 'Options' !"
1177 Kontext "HangulHanjaNewDictionary"
1178 Call DialogTest ( HangulHanjaNewDictionary )
1179 HangulHanjaNewDictionary.Close
1181 Kontext "HangulHanjaOptions"
1182 HangulHanjaOptions.Cancel
1184 Kontext "HangulHanjaConversion"
1185 printlog " Close HangulHanja dialog"
1186 HangulHanjaConversion.Close
1188 printlog " Set the 'Asian Language support' to default"
1189 if bAsianLanguage = FALSE then
1190 Call ActiveDeactivateAsianSupport(FALSE)
1193 PrintLog "Close active documents"
1194 Do Until GetDocumentCount = 0
1197 gApplication = "WRITER"
1200 ' -------------------------------------------
1202 testcase tMasterDocToolsHyphenation
1203 Dim sTestFile as string
1204 Dim LingFile as string
1206 gApplication = "MASTERDOCUMENT"
1207 PrintLog "- Tools / Hyphenation"
1209 ' As long as OOo has no modules for that, disabled
1211 printlog "No hyphenation in OOo"
1215 select case iSprache
1217 LingFile = "01-44-hyph.dat"
1218 sTestFile = gTesttoolpath + "writer\required\input\linguistik\001.odt"
1220 sTestFile = gTesttoolpath + "writer\required\input\linguistik\007.odt"
1222 sTestFile = gTesttoolpath + "writer\required\input\linguistik\003.odt"
1224 Printlog "- No Hyphenation in Japanese!"
1227 Printlog "- No Hyphenation in Korean!"
1230 Printlog "- No Hyphenation in Chinese (simplified)!"
1233 Printlog "- No Hyphenation in Chinese (traditional)!"
1236 sTestFile = gTesttoolpath + "writer\required\input\linguistik\0" + trim$(str$(iSprache)) + ".odt"
1237 LingFile = str$(iSprache) + "-hyph.dat"
1240 sTestFile = convertpath( sTestFile )
1241 if ( not hFileExists( sTestFile ) )then
1242 Warnlog "No defined Errortext for language: " + isprache + "! Exit!"
1246 if ( not wInsertDocumentinMasterDoc( sTestFile ) ) then
1247 Warnlog "Loading document did not work!"
1251 printlog " Open new document"
1252 hUseAsyncSlot( "EditPaste" )
1255 Call sMakeReadOnlyDocumentEditable
1256 printlog " Insert file 'writer\required\input\linguistik\0 + [OfficeLanguage] + '.odt'"
1258 Call wTypeKeys ("<Mod1 Home>")
1260 printlog " Tools / Hyphenate"
1261 hUseAsyncSlot( "ToolsLanguageHyphenate" )
1263 ' This is probably a workaround to make the hyphenation dialog work in any case.
1265 ' We really only know of three possible dialogs (in order of appearance):
1266 ' 1: Continue checking at the beginning of the document (Yes/No)
1267 ' 2: Hyphenation for language not installed (Ok)
1268 ' 3: Hyphenation completed (Ok)
1270 ' I have not changed the code, only beautified it a little but i feel the outcome of
1271 ' this test is somewhat random.
1273 if ( Active.exists( 1 ) ) then
1275 ' JSK: These messagboxes were originally handled silently.
1276 ' So i have no idea which of those is expected and which is not...
1277 printlog( "Messagebox: " & Active.getText() )
1279 printlog( "Trying to close messageboy with <YES>" )
1282 printlog( "<YES> failed... (Whatever that means)" )
1285 if ( Active.Exists() ) then
1286 printlog( "Messagebx: " & Active.getText() )
1287 if ( Active.GetRT() = 304 ) then
1289 ' Force pagesize change to bringup Hyphenation-dialog
1290 hUseAsyncSlot( "FormatPageWriter" )
1293 active.SetPage TabSeite
1298 hUseAsyncSlot( "ToolsLanguageHyphenate" )
1303 Kontext "Silbentrennung"
1304 printlog " Close upcoming 'Hyphenation' dialog"
1305 if ( Silbentrennung.Exists() ) then
1306 Call DialogTest ( Silbentrennung )
1307 Silbentrennung.Cancel
1309 Warnlog "Dialog 'Hyphenation' not up!"
1311 if ( Active.Exists() ) then
1319 printlog " Close active documents"
1321 gApplication = "WRITER"
1324 ' -------------------------------------------