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_spellcheck.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:20:07 $
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 : Spellcheck-Testing. Functional-Test.
38 '\***********************************************************************
42 Call tToolsSpellcheckWithShortcut
43 Call tToolsSpellcheckCorrect
44 Call tToolsSpellcheck1Mistake
45 Call tToolsSpellcheckForward
46 Call tToolsSpellcheckOnlyOneWord
47 Call tToolsSpellcheckAutomatic
48 Call tToolsSpellcheckChangeLanguageAttribute
50 Call tToolsSpellcheckButtonChange
51 Call tToolsSpellcheckButtonChangeAll
56 testcase tToolsSpellcheckWithShortcut
58 '/// Check if Spellcheck dialog comes up with shortcut 'F7'
59 printlog " Open document where the formatting is set to the language we wish to test."
60 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
61 if hFileExists ( TheFile ) <> TRUE then
62 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
66 call hFileOpen (TheFile,false)
67 Call sMakeReadOnlyDocumentEditable
69 printlog " Insert some faulty text"
71 case 01 : Call wTypeKeys ("This is a spellchecktestttttt<Home>")
72 case 33 : Call wTypeKeys ("Je Suiss la Penneeee<Home>")
73 case 34 : Call wTypeKeys ("Habla Espanollll<Home>")
74 case 39 : Call wTypeKeys ("Don Cara Mio, capitoliooo?<Home>")
75 case 49 : Call wTypeKeys ("Dies ist ein Rechtschreibtexxxxt<Home>")
76 case 46 : Call wTypeKeys ("Det här är en rättstavningstexxxxt<Home>")
77 case 07 : Printlog "- No Spellcheck in Russian!"
79 case 48 : Printlog "- No Spellcheck in Polish!"
81 case 55 : Printlog "- No Spellcheck in Brazilian!"
83 case 81 : Printlog "- No Spellcheck in Japanese!"
85 case 82 : Printlog "- No Spellcheck in Korean!"
87 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
89 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
91 case 03, 30, 35, 36, 37, 42, 47, 51, 90
92 Printlog "- No Spellcheck available !"
97 Call wTypeKeys "<HOME>" 'Setting cursor to beginning
98 Call wTypeKeys "<F7>" 'Calling spellchecker with shortcut
102 if Active.Exists(1) then 'checking if messagebox comes up
103 if Active.getRT = 304 then 'checking ressource type
106 printlog "No message Box!"
108 printlog "Message Box closed, Spellchecker came up"
110 Kontext "Spellcheck" 'checking if spellcheck dialog came up
111 if Spellcheck.Exists then
112 printlog "OK, Spellchecker comes up"
113 Spellcheck.Close 'closing spellchecker
115 Warnlog "#i35000#Spellchecker does not come up with shortcut 'F7'"
121 '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
123 testcase tToolsSpellcheckCorrect
124 Dim sHyphenationFile as String
125 Dim TheFile as String
128 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
129 if hFileExists ( TheFile ) <> TRUE then
130 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
134 Printlog "- Checking Dictionary-Files"
136 case 1 : sHyphenationFile = "01-44-hyph.dat"
137 case 81 : Printlog "- No Spellcheck in Japanese!"
139 case 82 : Printlog "- No Spellcheck in Korean!"
141 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
143 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
145 case else : sHyphenationFile = "" & iSprache & "-hyph.dat"
147 if gNetzInst = TRUE then
148 sHyphenationFile = Convertpath (gNetzOfficePath + "share\dict\" + trim$(sHyphenationFile))
150 sHyphenationFile = Convertpath (gOfficePath + "share\dict\" + trim$(sHyphenationFile))
153 PrintLog "- Tools / Spellcheck without text"
155 printlog " Open document where the formatting is set to the language we wish to test."
156 call hFileOpen (TheFile,false)
157 Call sMakeReadOnlyDocumentEditable
159 printlog " Insert some faulty text"
161 '/// Call Spellcheck in empty document ///
162 ToolsSpellcheckWriter
165 if NOT Active.Exists(1) then
166 Warnlog "No Finished message"
171 PrintLog "- Tools / Spellcheck with correct text"
172 '/// Call Spellcheck for correct text ///
174 case 01 : FFText = "This is a text without any error.<Return>"
175 case 03 : FFText = "Escreva os seus dados de utilizador correctamente e tome nota deles (guardar / imprimir).<Return>"
176 case 07 : FFText = "принятый Государственной Думой в первом чтении 16 ноября 1999 года.<Return>"
177 case 31 : FFText = "Dit werk is beschermd door de Auteurswet.<Return>"
178 case 33 : FFText = "Il nous faut donc un de temps pour examiner avec soin tous les dossiers.<Return>"
179 case 34 : FFText = "Este archivo contiene información importante sobre el programa.<Return>"
180 case 36 : FFText = "Boszniai amerikai kontingens háromnegyedesek – mintegy négyezer katona – magyarországi telepítése egy éven belül megtörténhet.<Return>"
181 case 39 : FFText = "La ringraziamo per l'interesse mostrato a collaborare con la firma.<Return>"
182 case 45 : FFText = "Danmark ikke er sikret maksimal indflydelse på den fremtidige europæiske udlændingepolitik.<Return>"
183 case 46 : FFText = "Den här filen innehåller viktig programinformation.<Return>"
184 case 48 : FFText = "Nie wolno w zadnim wypadku przerywa uruchomionego serwisu !<Return>"
185 case 49 : FFText = "Dies ist ein Text ohne Fehler.<Return>"
186 case 55 : FFText = "Ele ouviu passos silenciosos atrás dele. Isso não estava certo.<Return>"
187 case else : QAErrorLog " - The language " + iSprache +" has no defined language text. No Test !"
191 Call wTypeKeys FFText
193 ToolsSpellcheckWriter
200 Warnlog "No message to jump to start"
208 if Spellcheck.Exists then
209 Warnlog "With correct text the Spellcheck dialog appears ( maybe wrong language selected )"
214 '/// Close document ///
218 ' *******************************************************************
220 testcase tToolsSpellcheck1Mistake
221 Dim sWordToBeChecked as string
222 Dim sLanguageName as string
224 Dim sErrorSampleText as string
225 Dim TheFile as String
227 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
228 if hFileExists ( TheFile ) <> TRUE then
229 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
233 PrintLog "- Tools / Spellcheck with a defined mistake"
235 case 01 : sErrorSampleText = "Thatts not a trick, it" ' 's a Sony." (removing this last part because of different apostrophes in StarSuite)
236 sWordToBeChecked = "Thatts"
237 sLanguageName = "English (USA)"
238 case 03 : sErrorSampleText = "Escrive os seus dados de utilizador correctamente e tome nota deles."
239 sWordToBeChecked = "Escrive"
240 sLanguageName = "Português"
241 case 07 : sErrorSampleText = "Военная технического сaтрудничества, проблему задолженности и вопросы региональных связей."
242 sWordToBeChecked = "сaтрудничества"
243 sLanguageName = "Русский"
244 case 31 : sErrorSampleText = "Wijek danken u voor uw interesse in het samenwerken met Sun Microsystems."
245 sWordToBeChecked = "Wijek"
246 sLanguageName = "Nederlands (NL)"
247 case 33 : sErrorSampleText = "Ilk nous faut donc un de temps pour examiner avec soin"
248 sWordToBeChecked = "Ilk"
249 sLanguageName = "Français (France)"
250 case 34 : sErrorSampleText = "Este archivo contiene información importnte sobre el programa."
251 sWordToBeChecked = "importnte"
252 sLanguageName = "Español (España)"
253 case 36 : sErrorSampleText = "Boszniai amerikai kontingens háromnegyedének – mintegy négyezer katona – magyarországi telepítése egy éven belül megtörténhet."
254 sWordToBeChecked = "háromnegyedének"
255 sLanguageName = "Magyar"
256 case 39 : sErrorSampleText = "Lab ringraziamo per l'interesse"
257 sWordToBeChecked = "Lab"
258 sLanguageName = "Italiano (Italia)"
259 case 45 : sErrorSampleText = "Igke er sikret maksimal indflydelse på den fremtidige europæiske udlændingepolitik."
260 sWordToBeChecked = "Igke"
261 sLanguageName = "Dansk"
262 case 46 : sErrorSampleText = "Dsän här filen innehåller viktig programinformation."
263 sWordToBeChecked = "Dsän"
264 sLanguageName = "svenska (Sverige)"
265 case 48 : sErrorSampleText = "walno w zadnim wypadku przerywa uruchomionego serwisu !"
266 sWordToBeChecked = "Walno"
267 sLanguageName = "Polski"
268 case 49 : sErrorSampleText = "Diees ist ein Fehler."
269 sWordToBeChecked = "Diees"
270 sLanguageName = "Deutsch (Deutschland)"
271 case 55 : sErrorSampleText = "Esta poderia ser a respista para suas preces?"
272 sWordToBeChecked = "respista"
273 sLanguageName = "Português (Brasil)"
274 case 81 : Printlog "- No Spellcheck in Japanese!"
276 case 82 : Printlog "- No Spellcheck in Korean!"
278 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
280 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
282 case else : QAErrorLog "The language " + wSysLanguage +" has no defined Errortext. No test"
286 printlog " Open document where the formatting is set to the language we wish to test."
287 call hFileOpen (TheFile,false)
288 Call sMakeReadOnlyDocumentEditable
290 '/// Insert a sentence with one definded mistake and execute spellcheck ///
291 Call wTypeKeys sErrorSampleText
292 Call wTypeKeys "<Return><Up>"
294 ToolsSpellcheckWriter
296 if Active.Exists then
297 if Active.GetRT = 304 then
301 Warnlog Active.Gettext
308 if Not Spellcheck.Exists then
309 Warnlog "Spellchecker is not up !"
313 printlog "Current selected dictionary language is: " & DictionaryLanguage.GetSelText
314 ' Dictionary Language is language dependend. Function to be created
315 printlog " - check language"
316 'if DictionaryLanguage.GetSelText <> gLanguage then Warnlog "Dictionary language " + DictionaryLanguage.GetSelText +" selected"
317 printlog " - replace wrong word with a suggestion"
318 '/// replace wrong word with a suggestion ///
320 if trim$(NotInDictionary.GetText) <> trim(sErrorSampleText) then
321 warnlog " " & sErrorSampleText & " has not been detected as mistake. Detected mistake is:" & NotInDictionary.GetText
324 if Suggestions.GetItemCount > 0 then
325 if Suggestions.IsEnabled then
327 sDummy = Suggestions.GetItemText (2)
330 sDummy = Suggestions.GetItemText (1)
333 ' Next check does not work because if word is selected it will only be highlited!!"
334 ' if Not NotInDictionary.GetText <> sErrorSampleText then Warnlog "Text in preview has not been replaced with the suggestion"
337 QAErrorLog "No suggestions made from spellchecker"
340 QAErrorLog "Please choose another word to check suggestions, because no suggestion found!"
343 if Active.Exists then
347 Warnlog Active.Gettext
353 if Spellcheck.Exists then SpellcheckClose.Click
355 Call wTypeKeys "<Up><Home>"
356 Call wTypeKeys "<Shift End>"
359 if GetClipboardText = sErrorSampleText then Warnlog "Replaced text in document is wrong. Not "+ sErrorSampleText + " but " + GetClipboardText
364 ' *******************************************************************
366 testcase tToolsSpellcheckForward
368 Dim sWordToBeAdded as string
369 Dim InsFile as string
370 Dim Add_Word as string
371 Dim sDictionary as string
373 PrintLog "- Tools / Spellcheck / check forward"
374 '/// Open specified document depending on language to check spellcheck ///
375 '/// document has 4 defined wrong words ///
376 InsFile = wGetSpellcheckDocumentName(1)
379 Printlog "- No Spellcheck for this language available!"
382 QAErrorLog "The language " + iSprache +" has no defined Errortext. No test!" 'iSystemSprache
386 if gApplication = "MASTERDOCUMENT" then
387 if wInsertDocumentinMasterDoc(InsFile) = False then goto endsub
390 Call hFileOpen(InsFile)
391 Call sMakeReadOnlyDocumentEditable
393 '/// point cursor to beginning of document and execute spellcheck ///
394 Call wTypeKeys "<Mod1 Home>"
397 case 01 : sDummy = "exprass" : sWordToBeAdded = "pablischer"
398 case 07 : sDummy = "решаaт" : sWordToBeAdded = "кaнкретных"
399 case 03 : sDummy = "quante" : sWordToBeAdded = "cempas"
400 case 31 : sDummy = "haaietanden" : sWordToBeAdded = "widerzijdse"
401 case 33 : sDummy = "votrex" : sWordToBeAdded = "recontacterons"
402 case 34 : sDummy = "Asegúree" : sWordToBeAdded = "diretorio"
403 case 36 : sDummy = "hétozres" : sWordToBeAdded = "jelentos"
404 case 39 : sDummy = "meczanici" : sWordToBeAdded = "anniche"
405 case 45 : sDummy = "grend" : sWordToBeAdded = "lando"
406 case 46 : sDummy = "handbroken" : sWordToBeAdded = "viktikt"
407 case 48 : sDummy = "znajdujacej" : sWordToBeAdded = "usuniete"
408 case 49 : sDummy = "reichtt" : sWordToBeAdded = "viierter"
409 case 55 : sDummy = "horat" : sWordToBeAdded = "dpa"
413 ToolsSpellcheckWriter
416 Printlog " - Replace all (" + NotInDictionary.Gettext + ") ...."
417 '/// Replace first found word with 1 suggestion in list ///
418 if Suggestions.IsEnabled then
420 Printlog " - .... with (" + NotInDictionary.Gettext + ")"
425 Warnlog "Button 'change all' is not accessible!"
427 '/// Select 'Always replace' ///
430 QAErrorLog "No suggestions made from spellchecker!=>Choose 'Ignore All'"
431 if IgnoreAll.IsEnabled then IgnoreAll.Click
434 Printlog " - Ignore All (" + NotInDictionary.Gettext + ")"
435 '/// For second wrong word select 'Ignore all' ///
440 Warnlog "Button 'Ignore all' is not accessible"
444 Printlog " - Ignore (" + NotInDictionary.Gettext + ")"
445 '/// For 3rd wrong word select 'Ignore' ///
450 ' Warnlog "Button 'Ignore once' is not accessible"
455 if Active.Exists(3) then
456 if Active.GetRT = 304 then
457 Warnlog "Spellcheck has ended! Not reproducable by hand !"
461 Add_Word = trim$(NotInDictionary.Gettext)
462 Printlog " - Add (" + sDummy + ")"
463 '/// Add 4th word to dictionary ///
464 if AddToDictionary.IsEnabled then
465 AddToDictionary.Click
467 '/// remember selected dictionary
468 sDictionary = MenuGetitemText(1)
469 Call hMenuSelectNr(1)
472 Warnlog "Unable to add word to dictionary->button is disabled!"
477 if Active.Exists then
478 If Active.GetRT = 304 then
484 if Spellcheck.Exists then Spellcheck.Close
485 Call wTypeKeys "<Home>"
487 Printlog " - recheck: One mistake has to be found 3 times"
489 '/// Recheck: One mistake has to be found 3 times ///
490 ToolsSpellcheckWriter
493 if Active.Exists then
494 if Active.GetRT = 304 then
499 Warnlog Active.Gettext
504 if Spellcheck.Exists then
505 if Instr(NotInDictionary.GetText, sDummy) = 0 then
506 Warnlog "Jumped to wrong mistake! Not " & sDummy & " but " & Suggestions.GetSelText
511 Warnlog "Button 'Ignore all' is not accessible"
517 if Active.Exists(2) then
521 if Spellcheck.Exists then Spellcheck.Close
526 Printlog "- Deleting the Ignore list"
527 '/// Delete entrys in Ignorelist ///
528 Call wIgnorierenListeLoeschen
530 Printlog " - Delete added word in dictionary"
531 '/// Delete added word in dictionary ///
532 Call WortAusWoerterbuchLoeschen ( sDummy )
534 '/// Close document ///
538 ' *******************************************************************
540 testcase tToolsSpellcheckOnlyOneWord
541 Dim sWordToBeChecked as string
542 Dim InsFile as string
543 Dim ReplacedWith as String
546 '/// Open specified document depending on language to check spellcheck ///
547 '/// document has 1 defined wrong word ///
548 PrintLog "- Tools / Spellchecking / Check only one word"
549 InsFile = wGetSpellcheckDocumentName(2)
552 Printlog "- No Spellcheck for this language available!"
555 QAErrorLog "The language " + iSprache +" has no defined Errortext. No test!"
559 if gApplication = "MASTERDOCUMENT" then
560 if wInsertDocumentinMasterDoc(InsFile) = False then goto endsub
563 Call hFileOpen(InsFile)
564 Call sMakeReadOnlyDocumentEditable
566 Call wTypeKeys "<Mod1 Home>"
569 case 01 : sWordToBeChecked = "excetionally" ' this word is wrong
570 case 07 : sWordToBeChecked = "Кaнституции"
571 case 03 : sWordToBeChecked = "semstre" ' this word is wrong
572 case 31 : sWordToBeChecked = "lidstartesn" ' this word is wrong
573 case 33 : sWordToBeChecked = "heues" ' this word is wrong
574 case 34 : sWordToBeChecked = "vacunaión" ' this word is wrong
575 case 36 : sWordToBeChecked = "fekvo" ' this word is wrong
576 case 39 : sWordToBeChecked = "brasilianir" ' this word is wrong
577 case 45 : sWordToBeChecked = "Amserdam" ' this word is wrong
578 case 46 : sWordToBeChecked = "avrttades" ' this word is wrong
579 case 48 : sWordToBeChecked = "stosowanei" ' this word is wrong
580 case 49 : sWordToBeChecked = "georaphischen" ' this word is wrong
581 case 55 : sWordToBeChecked = "Veigo" ' this word is wrong
585 Kontext "FindAndReplace"
590 if SimilaritySearch.IsVisible = False then More.Click
591 if SimilaritySearch.IsEnabled then SimilaritySearch.Uncheck
592 if SearchForStyles.IsEnabled then SearchForStyles.Uncheck
593 if RegularExpressions.IsEnabled then RegularExpressions.Uncheck
594 if NoFormat.IsEnabled then NoFormat.Click
595 if CurrentSelectionOnly.IsEnabled then CurrentSelectionOnly.Uncheck
596 WholeWordsOnly.Uncheck
599 RegularExpressions.Check
601 SearchFor.Settext sWordToBeChecked
604 if Active.Exists then
605 if Active.getRT = 304 then
606 Warnlog Active.Gettext
615 Kontext "FindAndReplace"
616 if FindAndReplace.Exists then FindAndReplace.Close
618 ToolsSpellcheckWriter
620 if Active.Exists then
621 if Active.GetRT = 304 then
622 Warnlog "Spellcheck doesn't work correctly:" & Active.Gettext
634 Printlog " - Replace all"
635 if Suggestions.GetItemCount > 0 then
636 if Suggestions.IsEnabled then
639 Suggestions.TypeKeys "<Down><Up>"
640 ReplacedWith = Suggestions.GetSelText
642 if Change.IsEnabled then Change.Click
645 QAErrorLog "No suggestions made from spellchecker!"
651 Warnlog "No suggestion for word: " & sWordToBeChecked & " found. Test stops"
658 if Active.Exists then
659 if Active.GetRT = 304 then
664 Warnlog Active.Gettext
670 if Spellcheck.Exists then SpellcheckClose.Click
672 Call wTypeKeys "<Mod1 Shift Left>"
675 if GetClipboardtext = sWordToBeChecked then
676 Warnlog "#i40498#Spellchecker does not commit changes correctly (" & GetClipboardtext & " found )"
681 Warnlog "- Didn't found the word to check! No Spellchecking for one word!"
686 '/// Execute spellcheck again ///
688 ToolsSpellcheckWriter
690 if Active.Exists then
691 if Active.GetRT = 304 then
695 if Active.Exists then
696 if Active.GetRT = 304 then
698 Warnlog "#i40480#Spellchecker finishes though wrong words in documents"
708 if Spellcheck.Exists then
709 Warnlog "Probably the replaced word found wrong again!"
715 if Spellcheck.Exists then Spellcheck.Close
717 '/// Close document ///
721 ' *******************************************************************
723 testcase tToolsSpellcheckAutomatic
724 Dim iError1 as integer
725 Dim iError2 as integer
726 Dim sError1 as string
727 Dim sError2 as string
729 Dim sNumberOfSuggestions as string
730 Dim sReplaceWithWord as string
731 Dim sDefaultFormat as string
732 Dim TheFile as String
734 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
735 if hFileExists ( TheFile ) <> TRUE then
736 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
740 PrintLog "- Tools / Spellcheck / AutoSpellcheck"
741 printlog " Open document where the formatting is set to the language we wish to test."
742 call hFileOpen (TheFile,false)
743 Call sMakeReadOnlyDocumentEditable
745 '/// Enable Auto-Spellcheck in options
746 Call wEnableAutoSpellcheck ( true )
748 '/// Check Auto-Spellcheck and insert a sentence with 2 mistakes ///
749 printlog " - write text"
751 case 01 : wTypeKeys "Hello thiis here are too errorrs "
752 iError1 = 1 : iError2 = 4
753 sError1 = "thiis" : sError1 = "errorrs"
754 sDefaultFormat = "Standard"
755 case 03 : wTypeKeys "Aqui poderá elimitnar componentes já instalados ou instalar novos compotentes numa "
756 iError1 = 2 : iError2 = 7
757 sError1 = "elimitnar" : sError1 = "compotentes"
758 sDefaultFormat = "Padrão"
759 case 31 : wTypeKeys "Betaling binnern 14 dagen rekeningsdatum met 2% kortng, binnen 30 dagen nettor "
760 iError1 = 1 : iError2 = 7
761 sError1 = "binnern" : sError1 = "rekeningsdatum"
762 sDefaultFormat = "Standaard"
763 case 33 : wTypeKeys "Je vious remercie d'accuser réception dex ce courrier "
764 iError1 = 1 : iError2 = 4
765 sError1 = "vious" : sError1 = "dex"
766 sDefaultFormat = "Standard"
767 case 34 : wTypeKeys "Este archvo contiene información importnte sobre el programa."
768 iError1 = 1 : iError2 = 3
769 sError1 = "archvo" : sError1 = "importnte"
770 sDefaultFormat = "Estándar"
771 case 36 : wTypeKeys "A hétezres koszovói amerikai kontingens jelentos részét is a magyarországi bázison helyezi majd el."
772 iError1 = 1 : iError2 = 4
773 sError1 = "hétezres" : sError1 = "jelentos"
774 sDefaultFormat = "Alapértelmezett"
775 case 39 : wTypeKeys "La sfumaturar è statsi modificata senza salvare "
776 iError1 = 1 : iError2 = 2
777 sError1 = "sfumaturar" : sError1 = "statsi"
778 sDefaultFormat = "Standard"
779 case 45 : wTypeKeys "Han advarade både mod at kalde traktüten et fredens projekt "
780 iError1 = 1 : iError2 = 5
781 sError1 = "advarade" : sError1 = "traktüten"
782 sDefaultFormat = "Standard"
783 case 46 : wTypeKeys "Den här fiten innehåller viktit programinformation "
784 iError1 = 2 : iError2 = 2
785 sError1 = "fiten" : sError1 = "viktit"
786 sDefaultFormat = "Standard"
787 case 48 : wTypeKeys "Nie wolno w zadim wypadku przerywa uruchomiongo serwisu "
788 iError1 = 3 : iError2 = 3
789 sError1 = "zadim" : sError1 = "uruchomiongo"
790 sDefaultFormat = "Standard"
791 case 49 : wTypeKeys "Hallo hiaer sind swei Fehler "
792 iError1 = 1 : iError2 = 2
793 sError1 = "hiaer" : sError1 = "swei"
794 sDefaultFormat = "Standard"
795 case 55 : wTypeKeys "Aqui poderá elimitnar componentes já instalados ou instalar novos compotentes numa "
796 iError1 = 2 : iError2 = 7
797 sError1 = "elimitnar" : sError1 = "compotentes"
798 sDefaultFormat = "Padrão"
799 case 81 : Printlog "- No Spellcheck in Japanese!"
802 case 82 : Printlog "- No Spellcheck in Korean!"
805 case 86 : Printlog "- No Spellcheck in Chinese (simplified)!"
808 case 88 : Printlog "- No Spellcheck in Chinese (traditional)!"
811 case else : QAErrorlog "The language " + iSprache +" has no defined errortext. No Test!"
816 Call wTypeKeys "<Space><Return>"
818 printlog " - relieve mistake"
819 Call wTypeKeys "<Up><Home>"
820 Call wTypeKeys "<Mod1 Right>", iError1
821 Call wTypeKeys "<Right>" ' Cursor in fehlerhaftes NotInDictionary stellen
823 '/// Open contextmenu in first wrong word ///
824 Call wTypeKeys "<Shift F10>"
825 sReplaceWithWord=hMenuItemGetText (2)
826 if sReplaceWithWord<>sDefaultFormat then
827 sNumberOfSuggestions=MenuGetItemCount - 6
828 '/// Check if there is a suggestion and replace word ///
829 if sNumberOfSuggestions <=0 then
830 Warnlog "- No suggestions in Context menu for the first wrong word!"
832 printlog "- Context menu has " + sNumberOfSuggestions + " suggestions to the 1. wrong word!"
833 Call hMenuSelectNr (2)
834 Call wTypeKeys "<Shift Mod1 Left>"
837 if GetClipboardtext<> sReplaceWithWord then
838 Warnlog "- 1. wrong Word has not been replaced with " + sReplaceWithWord + " but "+ GetClipBoardtext
840 printlog "- 1. wrong word has been replaced with the 1. entry in context menu!"
846 Warnlog "- AutoSpellcheck doesn't work , wrong Context menu! (1.Word)"
849 Call wTypeKeys "<Mod1 Right>", iError2
851 Call wTypeKeys "<Right>" ' Cursor in fehlerhaftes NotInDictionary stellen
853 Call wTypeKeys "<Shift F10>"
855 sReplaceWithWord=hMenuItemGetText (2)
856 if sReplaceWithWord<>sDefaultFormat then
857 sNumberOfSuggestions=MenuGetItemCount - 6
858 if sNumberOfSuggestions <=0 then
859 Warnlog "- No suggestions in Contextmenu for 2. wrong Word !"
861 printlog "- Context menu has " + sNumberOfSuggestions + " suggestions for the 2. wrong word!"
862 Call hMenuSelectNr (2)
863 Call wTypeKeys "<Shift Mod1 Left>"
866 if GetClipboardtext<> sReplaceWithWord then
867 Warnlog "- 2. wrong word has not been replaced with " + sReplaceWithWord + " but "+ GetClipBoardtext
869 printlog "- 2. mistake has been replaced with the 1. entry in context menu!"
875 Warnlog "- AutoSpellcheck doesn't work, wrong Context menu (2.Word)!"
878 Call wTypeKeys "<Home>"
879 Call wTypeKeys "<F7>"
882 if Active.Exists then
883 if Active.GetRT = 304 then
893 if Spellcheck.Exists then
894 QAErrorlog "- Spellchecking dialog is still open. Not all words have been replaced!"
900 if Active.Exists then Active.ok
902 '/// Close document ///
906 '------------------------------------------------------------------------------------------------------------------------------------------------------------------
908 testcase tToolsSpellcheckChangeLanguageAttribute
910 Dim sWordToBeChecked as string
911 Dim InsFile as string
913 Dim ReplacedWith as string
914 Dim PriorLanguage as string
915 Dim CurrentLanguage as string
917 '/// Open specified document depending on language to check spellcheck ///
918 '/// document has 1 defined wrong word ///
919 PrintLog "- Tools / Spellchecking / Check only one word"
920 InsFile = wGetSpellcheckDocumentName(2)
923 Printlog "- No Spellcheck for this language available!"
926 QAErrorLog "The language " + iSprache +" has no defined Errortext. No test!" 'iSystemSprache
930 if gApplication = "MASTERDOCUMENT" then
931 if wInsertDocumentinMasterDoc(InsFile) = False then goto endsub
934 Call hFileOpen(InsFile)
935 Call sMakeReadOnlyDocumentEditable
937 Call wTypeKeys "<Mod1 Home>"
940 case 01 : sWordToBeChecked = "excetionally" ' this word is wrong
941 case 03 : sWordToBeChecked = "semstre" ' this word is wrong
942 case 07 : sWordToBeChecked = "военно"
943 case 31 : sWordToBeChecked = "lidstartesn" ' this word is wrong
944 case 33 : sWordToBeChecked = "heues" ' this word is wrong
945 case 34 : sWordToBeChecked = "vacunaión" ' this word is wrong
946 case 36 : sWordToBeChecked = "jelentos"
947 case 39 : sWordToBeChecked = "brasilianir" ' this word is wrong
948 case 45 : sWordToBeChecked = "Amserdam" ' this word is wrong
949 case 46 : sWordToBeChecked = "avrttades" ' this word is wrong
950 case 48 : sWordToBeChecked = "stosowanei" ' this word is wrong
951 case 49 : sWordToBeChecked = "georaphischen" ' this word is wrong
952 case 55 : sWordToBeChecked = "Veigo" ' this word is wrong
956 Kontext "FindAndReplace"
961 if SimilaritySearch.IsVisible = False then More.Click
962 if SimilaritySearch.IsEnabled then SimilaritySearch.Uncheck
963 if SearchForStyles.IsEnabled then SearchForStyles.Uncheck
964 if RegularExpressions.IsEnabled then RegularExpressions.Uncheck
965 if NoFormat.IsEnabled then NoFormat.Click
966 if CurrentSelectionOnly.IsEnabled then CurrentSelectionOnly.Uncheck
967 WholeWordsOnly.Uncheck
970 RegularExpressions.Check
972 SearchFor.Settext sWordToBeChecked
975 if Active.Exists then
976 if Active.GetRT = 304 then
977 Warnlog "- Didn't found the word to check! No Spellchecking for one word!"
979 Kontext "FindAndReplace"
980 FindAndReplace.Cancel
985 Kontext "FindAndReplace"
986 if FindAndReplace.Exists then FindAndReplace.Cancel
989 '/// Execute spellcheck: change language Attributes
991 ToolsSpellcheckWriter
994 if Not Spellcheck.Exists then
996 If Active.Exists then
997 If Active.GetRT = 304 then
998 Warnlog Active.Gettext
999 Warnlog "- Probably didn't found the word to check! No Spellchecking for one word!"
1003 ToolsSpellcheckWriter
1004 Kontext "Spellcheck"
1006 '/// Replace found word with suggestion from list
1007 if Spellcheck.Exists then
1008 PriorLanguage = DictionaryLanguage.GetSelText
1009 printlog "- remember selected language: " & PriorLanguage
1010 for i = 1 to DictionaryLanguage.GetItemCount
1011 DictionaryLanguage.Select i
1012 if Suggestions.GetItemCount > 0 then
1013 CurrentLanguage = DictionaryLanguage.GetSelText
1014 if Suggestions.IsEnabled and CurrentLanguage <> PriorLanguage then
1015 printlog "- replace with language: " & CurrentLanguage
1016 Suggestions.Select 1
1017 ReplacedWith = Suggestions.GetSelText
1018 printlog "- replace with word: " & ReplacedWith
1019 i = DictionaryLanguage.GetItemCount + 1
1023 '/// Close spellcheck dialog and check if properties have been set
1024 if ReplacedWith > "" then
1027 if Active.Exists then
1028 if Active.GetRT = 304 then
1035 ' Finished message ?
1037 if Active.Exists then
1038 if Active.GetRT = 304 then
1046 Kontext "Spellcheck"
1047 if Spellcheck.Exists then
1048 SpellcheckClose.Click
1051 Call wTypeKeys "<Mod1 Home>"
1052 printlog "- find replaced word"
1054 EditSearchAndReplace
1055 Kontext "FindAndReplace"
1057 SearchFor.Settext ""
1061 SearchFor.Settext ReplacedWith
1064 if Active.Exists then
1065 if Active.GetRT = 304 then
1066 Warnlog "- Didn't found the replaced word !"
1068 Kontext "FindAndReplace"
1069 FindAndReplace.Cancel
1074 Kontext "FindAndReplace"
1075 if FindAndReplace.Exists then FindAndReplace.Cancel
1079 Active.Setpage TabFont
1082 if Language.GetSelText <> CurrentLanguage then
1083 if Language.GetSelText = PriorLanguage then
1084 Warnlog "Language Attributes has not been set to" & CurrentLanguage
1086 Warnlog "Language Attributes has not been set to " & CurrentLanguage & " but " & Language.GetSelText
1090 if LanguageWest.GetSelText <> CurrentLanguage then
1091 if LanguageWest.GetSelText = PriorLanguage then
1092 Warnlog "Language Attributes has not been set to" & CurrentLanguage
1094 Warnlog "Language Attributes has not been set to " & CurrentLanguage & " but " & LanguageWest.GetSelText
1100 QAErrorlog "No suggestions found! Maybe wrong word should be changed to run more deeper testing"
1103 Warnlog "Spellcheck dialog is not up !"
1105 '/// Close document ///
1109 ' *******************************************************************
1111 testcase tToolsSpellcheckButtonChange
1112 Dim InsFile as string
1114 '/// Open specified document depending on language to check spellcheck ///
1115 '/// document has 1 defined wrong word ///
1116 PrintLog "- Tools / Spellchecking / Check button 'change'"
1117 InsFile = wGetSpellcheckDocumentName(2)
1120 Printlog "- No Spellcheck for this language available!"
1123 QAErrorLog "The language " + iSprache +" has no defined Errortext. No test!" 'iSystemSprache
1127 if gApplication = "MASTERDOCUMENT" then
1128 if wInsertDocumentinMasterDoc(InsFile) = False then goto endsub
1131 Call hFileOpen(InsFile)
1132 Call sMakeReadOnlyDocumentEditable
1134 Call wTypeKeys "<Mod1 Home>"
1136 '/// invoke the spellchecker
1137 ToolsSpellcheckWriter
1138 '/// Check if button change if disabled if
1139 '/// 1. No suggestion has been given from spellchecker
1140 '/// 2. The button 'change' should be enabled if found mistake has been changed!"
1142 if Active.Exists then
1143 if Active.GetRT = 304 then
1146 Warnlog "No mistake found in sample document -> Bug!"
1150 Kontext "Spellcheck"
1151 if Spellcheck.Exists then
1152 for i = 1 to DictionaryLanguage.GetItemCount
1153 DictionaryLanguage.Select i
1154 if Suggestions.GetItemCount = 0 then
1155 if Change.IsEnabled = true then
1156 Warnlog "Button 'Change' is enabled though no sugggestion is given"
1158 NotInDictionary.TypeKeys "Enable me"
1160 if Not Change.IsEnabled = true then
1161 Warnlog "Button 'Change' is disabled though text has been changed"
1169 Kontext "Spellcheck"
1170 if Spellcheck.Exists then SpellcheckClose.Click
1176 ' *******************************************************************
1178 testcase tToolsSpellcheckButtonChangeAll
1179 Dim InsFile as string
1181 '/// Open specified document depending on language to check spellcheck ///
1182 '/// document has 1 defined wrong word ///
1183 PrintLog "- Tools / Spellchecking / Check button 'change all'"
1184 InsFile = wGetSpellcheckDocumentName(2)
1187 Printlog "- No Spellcheck for this language available!"
1190 QAErrorLog "The language " + iSprache +" has no defined Errortext. No test!" 'iSystemSprache
1194 if gApplication = "MASTERDOCUMENT" then
1195 if wInsertDocumentinMasterDoc(InsFile) = False then goto endsub
1198 Call hFileOpen(InsFile)
1199 Call sMakeReadOnlyDocumentEditable
1201 Call wTypeKeys "<Mod1 Home>"
1203 '/// invoke the spellchecker
1204 ToolsSpellcheckWriter
1205 '/// Check if button 'change all' disabled if found mistake has been changed!"
1207 if Active.Exists then
1208 if Active.GetRT = 304 then
1211 Warnlog "No mistake found in sample document -> Bug!"
1215 Kontext "Spellcheck"
1216 if ChangeAll.IsEnabled then
1217 NotInDictionary.TypeKeys "Disable me"
1219 if ChangeAll.IsEnabled = true then
1220 Warnlog "Button 'Change all' is disabled though text has been changed"
1223 Warnlog "Button 'Change all' should be enabled"
1225 SpellcheckClose.Click
1233 ' *******************************************************************
1235 testcase tToolsThesaurus
1236 Dim sWordInitial as string
1237 Dim sLanguageToBeSelected as string
1238 Dim sWordToBeFound as string
1239 Dim sWordReplacedWith as string
1241 Dim TheFile as String
1243 PrintLog "- Tools / Thesaurus"
1245 printlog " Open document where the formatting is set to the language we wish to test."
1246 TheFile = Convertpath (gTesttoolpath + "writer\optional\input\spellcheck\spellcheck_" + iSprache + ".odt")
1247 if hFileExists ( TheFile ) <> TRUE then
1248 Warnlog "Found no Document for the language you're testing in, Please inform the Test-Developer."
1252 select case iSprache
1253 case 01 : sWordInitial = "Morning"
1254 case 03 : sWordInitial = "Confirmam"
1255 case 07 : Printlog "- No Thesaurus in Russian!"
1257 case 31 : sWordInitial = "Hulp"
1258 case 33 : sWordInitial = "Payer"
1259 case 34 : sWordInitial = "Suficiente"
1260 case 36 : Printlog "- No Thesaurus in Hungarian!"
1262 case 39 : sWordInitial = "Lingua"
1263 case 45 : sWordInitial = "Først"
1264 case 46 : sWordInitial = "Däng"
1265 case 48 : sWordInitial = "wypowiedź"
1266 case 49 : sWordInitial = "Mann"
1267 case 55 : Printlog "- No Thesaurus in Portuguese (Brazil) !"
1269 case 81 : Printlog "- No Thesaurus in Japanese!"
1271 case 82 : Printlog "- No Thesaurus in Korean!"
1273 case 86 : Printlog "- No Thesaurus in Chinese (simplified)!"
1275 case 88 : Printlog "- No Thesaurus in Chinese (traditional)!"
1277 case 30, 35, 36, 37, 42, 47, 48, 51, 90
1278 Printlog "- No Thesaurus available !"
1280 case else : QAErrorlog "The language " + iSprache + " has no defined errortext. No Test!"
1284 printlog "Open new preformatted-writerdocument"
1285 call hFileOpen (TheFile,false)
1286 Call sMakeReadOnlyDocumentEditable
1288 printlog "- Thesaurus without a word"
1289 '/// Call Thesaurus without a written word ///
1290 ToolsLanguageThesaurus
1292 if Ersetzen.GetText <> "" then Warnlog "- Though no word has been selected there is a replacetext in the textfield!"
1293 printlog "- enter one word and search"
1294 Ersetzen.SetText sWordInitial
1297 if Active.Exists then
1298 Warnlog Active.Gettext
1302 if Bedeutung.GetSelText(1) = "" then Warnlog "No meaning text"
1303 if Ersetzen.Gettext = "" then Ersetzen.SetText = sWordInitial
1304 sWordToBeFound = Ersetzen.GetText
1306 Call wTypeKeys "<Home><Shift End>"
1309 if iSprache = 1 then
1310 if GetClipboardText <> sWordToBeFound then Warnlog "Wrong word has been replaced, not => " + sWordInitial + " but => " + GetClipboardText
1312 if LCase (GetClipboardText) <> LCase (sWordToBeFound) then Warnlog "Wrong word has been replaced, not => " + sWordToBeFound + " but => " + GetClipboardText
1317 printlog " Open new preformatted-document where the formatting is set to the language we wish to test."
1318 call hFileOpen (TheFile,false)
1319 Call sMakeReadOnlyDocumentEditable
1321 printlog "- check the language"
1322 Call wTypeKeys sWordInitial + "<Home>"
1323 '/// Check language in Thesaurus ///
1324 ToolsLanguageThesaurus
1328 Kontext "SpracheAuswaehlen"
1329 select case iSprache ' iSystemSprache
1330 case 01 : sLanguageToBeSelected = "English (USA)"
1331 case 07 : sLanguageToBeSelected = "Русский"
1332 case 03 : sLanguageToBeSelected = "Português"
1333 case 31 : sLanguageToBeSelected = "Nederlands (NL)"
1334 case 33 : sLanguageToBeSelected = "Français (France)"
1335 case 34 : sLanguageToBeSelected = "Español (España)"
1336 case 36 : sLanguageToBeSelected = "Madyar"
1337 case 39 : sLanguageToBeSelected = "Italiano (Italia)"
1338 case 45 : sLanguageToBeSelected = "Dansk"
1339 case 46 : sLanguageToBeSelected = "svenska (Sverige)"
1340 case 48 : sLanguageToBeSelected = "Polski"
1341 case 49 : sLanguageToBeSelected = "Deutsch (Deutschland)"
1343 SpracheAuswaehlen.OK
1347 printlog "- Search for a Synonym"
1348 '/// Search for a synonym ///
1351 sWordToBeFound = Synonym.GetSelText
1352 if Ersetzen.GetText <> sWordToBeFound then Warnlog "Synonym has not been taken over"
1355 if Wort.GetSelText <> sWordToBeFound then Warnlog "Synonym has not been added to the word listand activated"
1357 printlog "- Search for a meaning"
1358 '/// Search for a meaning ///
1365 if Active.Exists then
1366 printlog "- " + Active.Gettext
1369 else ' Nur wenn Wort auch enthalten ist
1372 if Bedeutung.GetSeltext <> "" then i = 101
1375 sWordToBeFound = Bedeutung.GetSelText
1376 if Instr ( Ersetzen.GetText, sWordToBeFound ) <> 0 then
1377 Warnlog "Meaning has not been overtaken"
1381 printlog "- Replace unchecked ( Cursor in front of words 1. character )"
1382 '/// replace unchecked ///
1383 sWordReplacedWith = Ersetzen.GetText
1385 Call wTypeKeys "<Shift Home>"
1388 if GetClipboardText <> sWordReplacedWith then Warnlog "Text has not been correctly replaced, not => " + sWordReplacedWith + " but => " + GetClipboardText
1390 Call wTypeKeys "<End><Shift Home><Delete>" + sWordInitial
1391 Call wTypeKeys "<Home><Right><Right>"
1393 printlog "- Replace unchecked ( Cursor in word )"
1394 ToolsLanguageThesaurus
1397 if Synonym.GetItemCount >0 then
1399 sWordReplacedWith = Ersetzen.GetText
1401 Call wTypeKeys "<Home><Shift End>"
1404 if GetClipboardText <> sWordReplacedWith then Warnlog "Text has not been correctly replaced, not => " + sWordReplacedWith + " but => " + GetClipboardText
1406 Warnlog "- No Synonym when cursor is in word!"
1410 Call wTypeKeys "<End><Shift Home><Delete>"
1411 Call wTypeKeys sWordInitial + "<End><Left>"
1413 printlog "- Replace unchecked ( Cursor at words end )"
1414 ToolsLanguageThesaurus
1416 if Synonym.GetItemCount >0 then
1418 sWordReplacedWith = Ersetzen.GetText
1420 Call wTypeKeys "<Home><Shift End>"
1423 if GetClipboardText <> sWordReplacedWith then Warnlog "Text has not been correctly replaced, not => " + sWordReplacedWith + " but => " + Trim$(GetClipboardText)
1425 Warnlog "- No sysnonym when cursor pointed to words end!"
1429 Call wTypeKeys "<End><Shift Home><Delete>"
1430 Call wTypeKeys sWordInitial + "<End><Left><Shift Mod1 Left>"
1432 printlog "- Replace checked ( back to front )"
1433 '/// replace checked ///
1434 ToolsLanguageThesaurus
1436 if Synonym.GetItemCount >0 then
1438 sWordReplacedWith = Ersetzen.GetText
1440 Call wTypeKeys "<Home><Shift End><Shift Left>"
1443 if GetClipboardText <> sWordReplacedWith then Warnlog "Text has not been correctly replaced, not => " + sWordReplacedWith + " but => " + GetClipboardText
1447 if Active.Exists then
1454 Call wTypeKeys "<End><Shift Home><Delete>"
1455 Call wTypeKeys sWordInitial + "<Home><Shift End>"
1456 printlog "- Replace checked ( front to back )"
1457 ToolsLanguageThesaurus
1459 if Synonym.GetItemCount >0 then
1461 sWordReplacedWith = Ersetzen.GetText
1463 Call wTypeKeys "<Home><Shift End>"
1466 if GetClipboardText <> sWordReplacedWith then Warnlog "Text has not been correctly replaced, not => " + sWordReplacedWith + " but => " + GetClipboardText
1468 Warnlog "- No sysnonym when word is marked!"
1472 Call wTypeKeys "<End><Shift Home><Delete>"
1473 Call wTypeKeys sWordInitial + "<Home><Right><Shift Right><Shift Right>"
1475 printlog "- Part of Replace checked ( back to front ) - no checking anymore"
1476 ToolsLanguageThesaurus
1479 '/// Close thesaurus and writerdocument ///