Description: In Writer, manual auto correct (Tools/AutoCorrect/Apply) fails after the first two times. Steps to Reproduce: 1.Open Writer 2.Go to "Tools/AutoCorrect", and uncheck "While typing" 3.In the first line, type "www.google.com". 4.Select the first line, and click "Tools/AutoCorrect/Apply". A hyperlink is created. 5.Go to the second line, and type "www.google.com" again. 6.Select the second line, and click "Tools/AutoCorrect/Apply". A hyperlink is created. 7.Go to the third line, and type "www.google.com" again. 8.Select the third line, and click "Tools/AutoCorrect/Apply". A hyperlink should be created, but it isn't. Actual Results: The hyperlink is only created in the first two times, but not in the following times. Sometimes, no hyperlink is created in step 6 (second time). Expected Results: A hyperlink should always be created. Reproducible: Always User Profile Reset: No Additional Info: After step 6, no matter where you type a url, it is almost certain that no hyperlinks will be created by manually clicking "Tools/AutoCorrect/Apply".
When clicking Tools/AutoCorrect/Apply, SwAutoFormat::SwAutoFormat in sw/source/core/edit/autofmt.cxx is being called. During the first two times when auto correct works, eStat is set to TST_TXT_BODY and BuildText() is called, where text related auto correct is run, including URL Recognition, Capitalize first letter, etc. However, when manual auto correct fails, eStat is never set to TST_TXT_BODY, so BuildText() is never called. The fix should start from fixing the eStat jumping logics.
Thanks Baole. I think this is already covered by bug 90507 and bug 128192: applying the autocorrect rule changes the style from Default Paragraph Style to Text Body, and because autocorrect doesn't ever (?)[1] apply to other paragraph styles, it does not work on subsequent strings. Wondering if you can decide on which bug this is a duplicate of, and maybe continue the conversation there? It would be wonderful if you could work on some patches on this issues, as many reports are linked to this limitation: https://bugs.documentfoundation.org/showdependencytree.cgi?id=103341&hide_resolved=1 [1] question mark because I am still unsure of the intricacies of how autocorrect and styles interact.
Thank you for your comment. It is indeed true that this bug happens because the style becomes "Text Body" instead of "Default Paragraph Style", so this bug should be a duplicate of bug 128192. It is also true that the logic behind Tools/AutoCorrect/Apply is complicated, and I'm happy to work on it in bug 128192. But it will take some time :(
*** This bug has been marked as a duplicate of bug 128192 ***