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: g_spellcheck.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:43:10 $
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 : wolfram.garten@sun.com
36 '* short description :
38 '*******************************************************************
40 ' #1 tiToolsSpellcheckCorrect
41 ' #1 tiToolsSpellcheckError
42 ' #1 tiToolsSpellcheckCheck
43 ' #1 tToolsSpellcheckAutoSpellcheck
45 '\*******************************************************************
46 testcase tiToolsSpellcheckCorrect
48 qaerrorlog "This test is not adapted for polish, 48."
52 Dim DieDatei as String
53 dim lFiles(100) as string
58 Printlog "- Checking Dictionary-Files" ' borrowed from w_106.inc
60 case 01 : DieDatei = "01-44-hyph.dat"
61 case else : DieDatei = "" & iSprache & "-hyph.dat"
63 DieDatei = Convertpath(gNetzOfficePath + "share\dict\" + DieDatei)
64 if gPlatGroup <> "unx" then
65 if (Dir(DieDatei) = "") then
67 printlog "Dictionary not found : " + DieDatei + ", but is AsianLan, so OK :-)"
70 printlog "Dictionary not found : " + DieDatei
72 warnlog "Dictionary not found : " + DieDatei
76 Printlog " Dictionary has been installed : " + DieDatei
79 iFiles = GetFileList (Convertpath (gNetzOfficePath + "share\dict\"), "*.dat" ,lFiles())
81 printlog " " + i + ": " + DateiExtract(lFiles(i))
88 if Active.Exists(5) then
90 printlog "Message: Finished: Want to continue at the beginning? '" + active.gettext + "'"
93 Warnlog "The Active-dialoge didn't have a No-button, tries with OK instead."
97 Warnlog "No 'Spellcheck finished, do you wish to continue?' message appeared"
101 PrintLog "- Spellcheck with correct text"
103 case 01 : hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20)
104 case 33 : hTextrahmenErstellen ("Il nous faut donc un de temps pour examiner avec soin tous les dossiers.<Return>",10,10,70,20)
105 case 34 : hTextrahmenErstellen ("Este es un chico muy importante.",10,10,50,20)
106 case 36 : hTextrahmenErstellen ("akit a b�r�s�g vagy a szab�lys�rt�si hat�s�g a eltiltott",10,10,70,20)
107 case 39 : hTextrahmenErstellen ("La ringraziamo per l'interesse mostrato a collaborare con la firma.<Return>",10,10,70,20)
108 case 46 : hTextrahmenErstellen ("Det varierar vad som behandlas och ur vilket perspektiv.<Return>",10,10,50,20)
109 case 49 : hTextrahmenErstellen ("Dies ist ein Text ohne Fehler.<Return>",10,10,50,20)
110 case 55 : hTextrahmenErstellen ("Esta poderia ser a resposta para suas preces?<Return>",10,10,50,20)
113 printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-) will use english instaed"
114 ' there was smth wrong, try to find out :
116 if active.exists then
117 printlog "ERROR: active: '"+active.gettext+"'"
120 hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20)
122 Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here"
123 hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20)
129 if active.exists(5) then
130 printlog "Message: spellchecking has finished?: '" + active.gettext + "'"
133 errorLog "Spellcheck started :"
135 if Spellcheck.exists then
136 errorlog " - spellcheck came up and will be closed now"
139 printlog "spellcheck didn't come up"
144 endcase 'tiToolsSpellcheckCorrect
146 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
147 testcase tiToolsSpellcheckError
148 if iSprache = 48 then
149 qaerrorlog "This test is not adapted for polish, 48."
158 printlog "New document"
160 printlog "Selecting language case: " & iSprache
162 case 01 : FehlerText$ = "Thatt is a failure test." : Fehler$ = "Thatt" : Sprachenname$ = "English (US)"
163 case 34 : FehlerText$ = "Ezte es un chico muy importante." : Fehler$ = "Ezte" : Sprachenname$ = "Niederlaendisch"
164 case 33 : FehlerText$ = "Ler nous faut donc un de temps pour examiner." : Fehler$ = "Ler" : Sprachenname$ = "Franzoesisch"
165 case 36 : FehlerText$ = "Boszniai americkai kontingens háromnegyedesek – mintegy négyezer katona – magyarországi telepítése egy éven belül megtörténhet" : Fehler$ = "tellepítésel" : Sprachenname$ = "Ungarisch"
166 case 39 : FehlerText$ = "Ringrarziamo per l'interessa mostrato a collaborare con la firma." : Fehler$ = "Ringrarziamo" : Sprachenname$ = "Italienisch"
167 case 46 : FehlerText$ = "Detd varierar vad som behandlas och ur vilket perspektiv." : Fehler$ = "Detd" : Sprachenname$ = "Schwedisch"
168 case 49 : FehlerText$ = "Diees ist ein Fehler." : Fehler$ = "Diees" : Sprachenname$ = "Deutsch"
169 case 55 : FehlerText$ = "Eesta poderia ser a resposta para suas preces?": Fehler$ = "Eesta" : Sprachenname$ = "Portugiesisch"
172 printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-) using english"
173 FehlerText$ = "Thatt is a failure test."
175 Sprachenname$ = "English (US)"
176 call hSetSpellHypLanguage
178 Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here"
181 printlog "Error Text taken for testing is: " & FehlerText$
184 printlog "Delete ignore word list"
185 if (not wIgnorierenlisteLoeschen) then
186 qaErrorLog "Can't get into Dictionary lists"
189 printlog "Setting doc language to english"
191 Kontext "ExtrasOptionenDlg"
192 hToolsOptions("LANGUAGESETTINGS","Languages")
194 Kontext "ExtrasOptionenDlg"
196 printlog "Create 1 textbox with 1 spelling error (test replace always)"
197 hTextrahmenErstellen (FehlerText$,30,30,90,40)
200 printlog "Call 'Tools->Spellcheck->Check'"
202 printlog "Spellcheck dialog has to come up, wrong word is selected."
204 if Spellcheck.Exists then
205 printlog "There has to be at least ONE suggestion."
206 if (Suggestions.GetItemCount < 1) then
207 printlog "If no suggestion avilable:"
208 warnlog " - no suggestion for the language: "+DictionaryLanguage.GetSelIndex+" '"+DictionaryLanguage.GetSelText+"' , press check button..."
209 printlog "+ press button 'Check word'"
211 if (Suggestions.GetItemCount < 1) then
212 warnlog " STILL no suggestions :-( errors will follow "
214 printlog " - now suggestion for the language: "+DictionaryLanguage.GetSelIndex+" '"+DictionaryLanguage.GetSelText+"'" + Suggestions.GetItemCount
217 Dummy$=Suggestions.GetItemText (1)
218 printlog "Select first spellcheck suggestion (click it!)."
219 Suggestions.Select (1)
220 printlog "Check if textfield 'word' has changed to selected word."
221 if (Suggestions.GetSelText <> Dummy$) Then
222 Warnlog "Suggestion not used"
224 Printlog "Suggestion is used"
228 printlog "click button 'Always replace'"
230 printlog "spellcheck dialog has to disappear and"
231 printlog "There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'"
233 if Active.Exists(5) then
234 Printlog "Message: Spellchecking has finished?: '" + active.gettext + "'"
237 Printlog "'Change All' seems to have worked correctly."
241 if active.exists(5) then
242 Printlog "Spellcheck dialog closed'" + active.gettext + "'"
245 Printlog "Spellcheck dialog closed'"
249 Warnlog " Error not recognized by the Spellchecker"
250 if active.exists(5) then
252 printlog "Message: spellchecking has finished?: '" + active.gettext + "'"
257 printlog "delete textbox"
262 printlog "Create same textbox again (test IGNORE function)."
263 Printlog "Check function Ignore"
264 hTextrahmenErstellen (FehlerText$,30,30,80,40)
265 printlog "All 'Tools->Spellcheck->Check'."
267 'printlog "Setting Text to english"
273 'Messagebox.SetPage TabFont
280 printlog "press button 'Ignore'"
282 printlog "spellcheck dialog has to disappear and "
283 printlog " There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'."
285 if Active.Exists(5) Then
286 Printlog " Spellcheck ended because of only 1 defined error. And Ignore worked.'" + active.gettext + "'"
289 Printlog " 'Ignore Once' seems to work correctly."
293 if active.exists(5) then
294 Printlog " Spellcheck dialog closed'" + active.gettext + "'"
297 Printlog " Spellcheck dialog closed'"
301 printlog "Call 'Tools->Spellcheck->Check."
304 if Spellcheck.Exists Then
305 Printlog " Ignore worked"
308 if active.exists(5) then
309 Printlog " " + active.gettext + "'"
312 Printlog " Spellcheck dialog closed'"
315 Warnlog " Spellcheck ended even we only ignored the error"
318 printlog "delete textbox."
323 printlog "create same textbox again (test ALWAYS IGNORE function)."
324 hTextrahmenErstellen (FehlerText$,30,30,60,40)
326 'printlog "Setting Text to english"
332 'Messagebox.SetPage TabFont
337 printlog "Call 'Tools->Spellcheck->Check'."
340 printlog "click button 'Always Ignore."
342 printlog "spellcheck dialog has to disappear and"
343 printlog "There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'."
345 if active.exists(5) then
346 Printlog " Spellcheck ended because of only 1 defined error. And Ignore worked.'" + active.gettext + "'"
349 Printlog " 'Ignore All' seems to work."
353 if active.exists(5) then
354 Printlog " Spellcheck dialog closed'" + active.gettext + "'"
357 Printlog " Spellcheck dialog closed'"
361 Printlog "- Delete ignore list"
363 printlog "Delete ignore word list."
364 if (not wIgnorierenlisteLoeschen) then
365 qaErrorLog "Can't get into Dictionary lists"
369 endcase 'tiToolsSpellcheckError
371 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
372 testcase tiToolsSpellcheckCheck
373 if iSprache = 48 then
374 qaerrorlog "This test is not adapted for polish, 48."
378 Dim sWord(2) as string
382 Dim AlleBuecher as integer
384 Dim sWordOne as string
385 Dim sWordTwo as string
386 Dim iBooks as integer
387 Dim bWordFound(2) as boolean
388 Dim iSuggestions as integer
389 Dim iWord(2) as integer
390 Dim bFound as boolean
392 Select Case Ucase(gApplication)
393 case "DRAW" : sExt = ".odg"
394 case "IMPRESS" : sExt = ".odp"
397 printlog "Load prepared document containing 4 errors : graphics\\required\\input\\recht_" & iSprache & sExt
398 if (not bAsianLan) then
399 printlog "Check if the document is writable."
400 Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt)
402 Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_1"+sExt)
404 if fIsDocumentWritable = false then
405 printlog "Make the document writable and check if it's succesfull."
406 if fMakeDocumentWritable = false then
407 warnlog "The document can't be make writeable. Test stopped."
411 select case iSprache ' sWord(1)=red : sWord(2)=turquoise
412 case 01 : sWord(1) = "documente" : sWord(2) = "expriss"
413 case 33 : sWord(1) = "intercu" : sWord(2) = "Lees"
414 case 34 : sWord(1) = "afekto" : sWord(2) = "fratternal"
415 case 36 : sWord(1) = "szeerint" : sWord(2) = "tervvezi"
416 case 39 : sWord(1) = "Millano" : sWord(2) = "tarrget"
417 case 46 : sWord(1) = "desa" : sWord(2) = "occh"
418 case 49 : sWord(1) = "Texxt" : sWord(2) = "reichtt"
419 case 55 : sWord(1) = "esktava" : sWord(2) = "noitee"
422 sWord(1) = "documente" : sWord(2) = "expriss"
424 Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create the file"
429 Printlog "Delete all added words from dictionaries."
430 printlog "Call Tools->Options."
432 printlog "Select in category 'Languagesettings' entry 'Writing Aids.'"
433 hToolsOptions ("LANGUAGESETTINGS","WRITINGAIDS")
435 Kontext "WRITINGAIDS"
437 printlog "Click on button 'edit' in section 'User-defined dictionaries.'"
438 if (fGetIntoDictionary) then
442 Kontext "BenutzerwoerterbuchBearbeiten"
444 printlog "Check every book, if it contains the words that will be added in this test."
445 iBooks = Buch.getItemCount
446 bWordFound(1) = false
447 bWordFound(2) = false
450 printlog "Items in Booklist: " & WordList.getItemCount
452 Wort.setText sWord(j)
454 if ((not neu.isEnabled) and Loeschen.isEnabled) then
455 printlog "If it contains the word, press button 'delete'."
458 printlog "Added word WAS in dictionary: '" + Buch.getSelText + "' - '" + sWord(j) + "'"
462 if (bWordFound(1) OR bWordFound(2))then
463 qaErrorLog "Word was found in dictionary - check why it was there. '" + sWord(1) + "': " + bWordFound(1) + " '" + sWord(2) + "': " + bWordFound(2)
465 printlog "Close dialog 'Edit Custom Dictionary.'"
466 BenutzerwoerterbuchBearbeiten.Close
468 Kontext "ExtrasOptionenDlg"
469 printlog "Press button 'OK' on dialog 'Writing Aids'."
471 printlog "Call dialog again and delete all remaining words from dictionary 'IgnoreAllList'."
472 if (not wIgnorierenlisteLoeschen) then
473 qaErrorLog "Can't get into Dictionary lists"
477 printlog "Test if spellcheck dialog comes up and check/set direction of spellcheck."
478 printlog "Call 'Tools->Spellcheck->Check'."
482 printlog "If no dictionary for the language is available, a messagebox comes up:"
483 printlog ". . . 'Error executing the spellcheck.: Language is not supported by spellchecker funtion."
485 if active.exists(5) then
486 warnlog "$Language is not supported by spellchecker funtion: '" + active.gettext + "'"
488 printlog ". . . exiting testcase."
492 printlog "Save the current Dictionary Language."
493 s = DictionaryLanguage.GetSelIndex
494 for i= 1 to DictionaryLanguage.GetItemCount
495 DictionaryLanguage.Select i
497 printlog "Dictionary language is: # "+i+": "+DictionaryLanguage.GetSelText
501 DictionaryLanguage.Select s
502 printlog "Close dialog 'Spellcheck'."
505 if active.exists(5) then
506 Warnlog " Should not be any message here: " + active.gettext + "'"
509 printlog "Spellcheck ended, dialog closed"
511 printlog "Select all."
513 printlog "Check presupposition: 12 Words have to be complained about."
514 printlog "All 'Tools->Spellcheck->Check'."
518 printlog "Click button 'Ignore' 12 times."
524 if active.exists(5) then
525 warnlog "Presupposition not met: there are less than 12 errors in the document! " + i
527 printlog "If errors < 12 -> exiting testcase."
533 printlog "Spellcheck dialog has to disapear and messagebox with OK has to come up."
535 if active.exists(5) then
536 printlog "Active dialog said: " + active.gettext + "'"
540 if Spellcheck.Exists(5) then
541 warnlog "Presupposition not met: there are more than 12 errors in the document!"
544 if active.exists(5) then
547 printlog "bug fixed #111972# "
549 printlog "If errors > 12 -> exiting testcase."
553 if active.exists(5) then
554 warnlog "There was a Message where none was supposed to be: '" + active.gettext + "'"
557 printlog "Presupposition met: there are 12 errors in the document!"
560 printlog "Perform the test now:"
561 printlog "Call 'Tools->Spellcheck->Check'"
565 Printlog "----------------------------------------------------------------------------"
566 Printlog "1st Test: - Ignore now"
567 printlog "1st error: ignore : 1st pink word in 1st Paragraph."
568 printlog "Backwards: last green word in 3rd Paragraph."
569 sWordOne = Suggestions.GetSelText
570 printlog "********* Suggestion word found: '" + sWordOne + "'"
571 printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText '+" ; dictionary: "+woerterbuch.getSelText
572 if (Suggestions.GetItemCount > 0) then
573 printlog "----- "+i+": "+Suggestions.GetSelText (1)
575 printlog "Click button 'Ignore'."
579 Printlog "----------------------------------------------------------------------------"
580 Printlog "2nd Test: - Add"
581 printlog "2nd error: add : 1st red word in 1st Paragraph -> hasn't to show up anymore from now on."
582 printlog "Backwards: last turquoise word in 3rd Paragraph -> hasn't to show up anymore from now on."
583 printlog "Check if word in textfield 'Word' changed."
584 printlog "(Check if it is the expected next error - you have to look into the source code for the right word!)."
585 sWordTwo = Suggestions.GetSelText
586 if (sWordOne = sWordTwo) then
587 warnlog "Ignore didn't work? Spellcheck didn't go on"
589 if (sWord(iWord(1)) <> sWordTwo) then
590 Printlog "The errornous word '" + sWord(iWord(1)) + "' would be replaced with: '" + sWordTwo + "'"
592 printlog "********* word found: '" + sWordTwo + "'"
593 printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+woerterbuch.getSelText
594 if (Suggestions.GetItemCount > 0) then
595 printlog "----- "+i+": "+Suggestions.GetSelText (1)
598 printlog "Click button 'Add' on dialog '"
599 AddToDictionary.Click
601 printlog "The menu has: " + MenuGetItemCount + " entries."
602 hMenuSelectNr(1) 'Default
604 if Active.Exists(5) Then
605 Warnlog " - Word could not be added to dictionary: '" + active.getText + "'"
609 printlog "Check in options, if word exists in word list."
610 printlog "Click button 'Options' on dialog 'Spellcheck'."
612 SpellcheckOptions.Click
613 Kontext "TabLinguistik"
614 printlog "Click button 'Edit ...' on dialog 'Writing Aids' in section 'User-defined dictionaries'."
615 if TabLinguistik.exists(5) then
617 if (fGetIntoDictionary) then
624 Kontext "BenutzerwoerterbuchBearbeiten"
625 printlog "Check every book, if it contains the added word."
626 if not BenutzerwoerterbuchBearbeiten.exists(5) then
630 iBooks = Buch.getItemCount
631 bWordFound(1) = false
634 printlog "Book number selected: " & i
635 Wort.setText sWord(iWord(1))
637 if ((not neu.isEnabled) and Loeschen.isEnabled) then
639 printlog "Added word is in dictionary: '" + Buch.getSelText + "'"
642 if (not bWordFound(1)) then
643 warnlog "Word was not added to dictionary"
645 printlog "Cancel dialog 'Edit Custom Dictionary'."
646 BenutzerwoerterbuchBearbeiten.Close
647 Kontext "TabLinguistik"
648 printlog "Cancel dialog 'Writing Aids'."
652 Printlog "----------------------------------------------------------------------------"
653 Printlog " 3rd Test: - Always Ignore"
654 printlog "3rd error: always ignore : 1st turquoise word in 1st Paragraph -> hasn't to show up anymore from now on."
655 printlog "Check if word in textfield 'Word' changed."
656 printlog "(check if it is the expected next error - you have to look into the source code for the right word!)"
658 sWordTwo = Suggestions.GetSelText 'wort.getText
659 if (sWordOne = sWordTwo) then
660 warnlog "Add didn't work? Spellcheck didn't go on."
662 if (sWord(iWord(2)) <> sWordTwo) then
663 Printlog "The erroneous word '" + sWord(iWord(2)) + "' would be replaced with: '" + sWordTwo + "'"
665 warnlog "ERROR: SAME WORD in the dictionary as in the text??? Must be wrong."
667 printlog "********* word found: '" + sWordTwo + "'"
668 printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+DictionaryLanguage.getSelText 'Wort.GetItemCount 'Woerterbuch.GetSelText
669 if (Suggestions.GetItemCount > 0) then 'Wort.GetItemCount > 0) then
670 printlog "----- "+i+": "+Suggestions.GetItemText (1) 'Wort.GetItemText (1)
673 printlog "Click button 'Always ignore' on dialog."
676 printlog "Check in options, if word exists in word list."
677 printlog "Click button 'Options' on dialog 'Spellcheck'."
678 SpellcheckOptions.Click
679 Kontext "TabLinguistik"
680 printlog "Click button 'Edit ...' on dialog 'Writing Aids' in section 'User-defined dictionaries."
681 if TabLinguistik.exists(5) then
682 sleep 3 'culprint swedish windows; wait until butrton exists?
683 if (fGetIntoDictionary) then
690 Kontext "BenutzerwoerterbuchBearbeiten"
691 if not BenutzerwoerterbuchBearbeiten.exists(5) then
695 printlog "Check every book, if it contains the added word."
696 iBooks = Buch.getItemCount
697 bWordFound(2) = false
699 Kontext "BenutzerwoerterbuchBearbeiten"
701 Inhalt.setText sWord(iWord(2)) 'Wort.setText sWord(iWord(2))
703 if ((not neu.isEnabled) and Loeschen.isEnabled) then
705 printlog " added word is in dictionary: '" + Buch.getSelText + "'"
708 if (not bWordFound(2)) then
709 warnlog "Word was not added to dictionary, #ixxxxxx"
711 printlog "Cancel dialog 'Edit Custom Dictionary'."
712 BenutzerwoerterbuchBearbeiten.Close
713 Kontext "TabLinguistik"
714 printlog "Cancel dialog 'Writing Aids'."
718 Printlog "----------------------------------------------------------------------------"
719 Printlog "4th test: - Replace"
720 printlog "4th error: replace : 1st green word in 1st Paragraph."
721 printlog "Check if word in textfield 'Word' changed."
722 printlog "(check if it is the expected next error - you have to look into the source code for the right word!)."
724 sWordTwo = Suggestions.GetSelText
725 if (sWordOne = sWordTwo) then
726 warnlog "Always ignore didn't work? Spellcheck didn't go on."
728 printlog "********* word found: '" + sWordTwo + "'"
729 iSuggestions = Suggestions.GetItemCount
730 printlog "##### suggestions: " + iSuggestions + "; Language: "+DictionaryLanguage.getSelText '+"; dictionary: "+woerterbuch.getSelText
731 if (Suggestions.GetItemCount > 0) then
732 printlog "----- "+i+": "+Suggestions.GetItemText (1)
735 printlog "Click button 'Replace'."
736 if (iSuggestions > 0) then
739 qaerrorlog "Please change the text in the file, so the spellchecker can make a suggestion for the word: '" + sWordTwo + "'"
743 Printlog "----------------------------------------------------------------------------"
744 Printlog "5th Test: - Always Replace"
745 printlog "5th error: always replace : 1st pink word in 2nd Paragraph -> hasn't to show up anymore from now on."
746 printlog "backwards: 1st green word in 2nd Paragraph -> hasn't to show up anymore from now on."
747 printlog "check if word in textfield 'Word' changed."
748 printlog "(check if it is the expected next error - you have to look into the source code for the right word!)."
750 sWordTwo = Suggestions.GetSelText
751 if (sWordOne = sWordTwo) then
752 warnlog "Replace didn't work? Spellcheck didn't go on"
754 printlog "********* word found: '" + sWordTwo + "'"
755 iSuggestions = Suggestions.GetItemCount
756 printlog "##### suggestions: " + iSuggestions + "; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+woerterbuch.getSelText
757 if (Suggestions.GetItemCount > 0) then
758 printlog "----- "+i+": "+Suggestions.GetItemText (1)
761 printlog "click button 'Always Replace'."
762 if (iSuggestions > 0) then
765 qaErrorLog "Please change the text in the file, so the spellchecker can make a suggestion for the word: '" + sWordTwo + "'"
769 printlog "2 errors are left: 4th word (green) in 2nd and 3rd paragraph."
770 printlog "backwards: 1st word (pink) in 2nd and 1st paragraph."
773 sWordTwo = Suggestions.GetSelText
774 if (sWordOne <> sWordTwo) then
777 warnlog "there is anopther word left, that wasn't expected!. '" + sWordTwo +"'"
779 printlog "Click button 'Ignore' 2 times."
784 sWordTwo = Suggestions.GetSelText
785 if (sWordOne <> sWordTwo) then
786 warnlog "there is anopther word left, that wasn't expected!. '" + sWordTwo +"'"
790 printlog "Click button 'Ignore' 2 times."
793 if active.exists(5) then
794 printlog "Spellcheck works :-) '" + active.gettext + "'"
797 warnlog "Spellcheck didn't work :-(! there are still errors in the document."
801 if active.exists(5) then
802 qaErrorLog " Spellcheck dialog closed'" + active.gettext + "'"
808 Printlog "Delete all added words from dictionaries."
809 printlog "Call Tools->Options."
811 printlog "Select in category 'Languagesettings' entry 'Writing Aids'."
812 hToolsOptions ("LANGUAGESETTINGS","WRITINGAIDS")
814 Kontext "WRITINGAIDS"
815 printlog "Click on button 'edit' in section 'User-defined dictionaries'."
816 if (fGetIntoDictionary) then
820 Kontext "BenutzerwoerterbuchBearbeiten"
821 printlog "Check every book, if it contains the added word."
822 iBooks = Buch.getItemCount
823 bWordFound(1) = false
824 bWordFound(2) = false
828 Wort.setText sWord(j)
830 if ((not neu.isEnabled) and Loeschen.isEnabled) then
831 printlog "If it contains the word, press button 'delete'."
834 printlog " added word is in dictionary: '" + Buch.getSelText + "' - '" + sWord(j) + "'"
838 if ((not bWordFound(1)) AND (not bWordFound(2)))then
839 warnlog "Word was not found in dictionary. '" + sWord(1) + "': " + bWordFound(1) + " '" + sWord(2) + "': " + bWordFound(2)
841 printlog "Close dialog 'Edit Custom Dictionary'."
842 BenutzerwoerterbuchBearbeiten.Close
844 Kontext "ExtrasOptionenDlg"
845 printlog "press button 'OK' on dialog 'Writing Aids'."
847 printlog "Call dialog again and delete all remaining words from dictionary 'IgnoreAllList'."
848 if (not wIgnorierenlisteLoeschen) then
849 qaErrorLog "Can't get into Dictionary lists"
853 printlog "Close document"
855 endcase 'tiToolsSpellcheckCheck
857 '-------------------------------------------------------------------------------
858 testcase tToolsSpellcheckAutoSpellcheck
860 QaErrorLog "#i81928# - outcommented tToolsSpellcheckAutoSpellcheck due to bug."
871 dim sCompare as string
878 call hTextrahmenErstellen ("Ein Tipp: Schiffahrt schreibt man nun mit 3f Tunfisch Amboss a", 10, 10, 90, 50)
881 setCharacterLanguage(glLocale(4))
883 printlog "## check ENGLISH auto spellchecking"
885 ' Get underlined words / wrong recognized words by spellchecker
886 iResult = sAnalyseContextMenu(11, iError)
887 sTemp = sLongToBinary(iResult, 11)
888 sError = sLongToBinary(iError, 11)
889 ' reference of words, which should be underlined
890 sCompare = "11011001011"
891 iCompare = sBinaryToLong(sCompare)
892 ' compare result with reference -> get the difference
893 iTemp = not (iResult EQV iCompare)
894 ' eliminate errors from open bugs -> get the real errors
895 iTemp2 = iTemp AND NOT iError
897 warnlog "wrong words are not underlined? Should be: " + sCompare
898 warnlog "Is: " + sTemp
899 warnlog "Differences: " + sLongToBinary(iTemp, 11)
900 warnlog "Wrong after merging errors from bugs " + sLongToBinary(iTemp2, 11)
904 ' call hTypeKeys "<F2>"
905 call hTypeKeys "<mod1 end> <Shift mod1 home>"
906 setCharacterLanguage(glLocale(6))
908 printlog "## check GERMAN auto spellchecking"
910 iResult = sAnalyseContextMenu(11, iError)
911 sTemp = sLongToBinary(iResult, 11)
912 sError = sLongToBinary(iError, 11)
913 sCompare = "00010000000"
914 iCompare = sBinaryToLong(sCompare)
915 ' compare result with reference -> get the difference
916 iTemp = not (iResult EQV iCompare)
917 ' eliminate errors from open bugs -> get the real errors
918 iTemp2 = iTemp AND NOT iError
920 warnlog "wrong words are not underlined? Should be: " + sCompare
921 warnlog "Is: " + sTemp
922 warnlog "Differences: " + sLongToBinary(iTemp, 11)
923 warnlog "Wrong after merging errors from bugs " + sLongToBinary(iTemp2, 11)
925 printlog "-----------------------------------"
928 endcase 'tToolsSpellcheckAutoSpellcheck
930 '-------------------------------------------------------------------------------