Let say, we have text and we need to replace all words "he" with "his". Also, we keep in mind that "he" may be beginning with capital - "He". Dim oDocument As Object Dim oReplace As Object oDocument = ThisComponent oReplace = oDocument.createReplaceDescriptor oReplace.searchAll=True oReplace.SearchString = "(h)e" oReplace.ReplaceString = "$1is" oReplace.SearchRegularExpression = true oReplace.SearchCaseSensitive = false oReplace.SearchWords = true oDocument.replaceAll(oReplace) This macro replaces all "he/He" with "his/His", but all "she" will be replaced with "shis" as well. "oReplace.SearchWords = true" does not work. This bug is relevant to all versions of LibreOffice and OpenOffice.
Noel - thoughts on this one?
Nobody is interesting?
Looking for workaround for this bug, I found a next one. Dim oDocument As Object Dim oReplace As Object oDocument = ThisComponent oReplace = oDocument.createReplaceDescriptor oReplace.searchAll=True oReplace.SearchString = "\<(h)e\>" oReplace.ReplaceString = "$1is" oReplace.SearchRegularExpression = true oReplace.SearchCaseSensitive = false oDocument.replaceAll(oReplace) Expected - he/He replaced with his/His and she will not be replaced Current - all he/He replaced with $1is Any ideas?
Please don't up the priority of your own bugs
I will not.
Goff - are you trying to find someone to mentor you so you can make a patch or are you asking for workarounds? If you're looking for a mentor I'll try to help - if you're asking for "user advice" on how to proceed given the problem - I suggest going to the ask.libreoffice.org site or the mailing list.
Thank you Joel! Unfortunately, I'm not able to patch this bug even supported by your help. And I've found a workaround, so it is not a bug that is crucial for me personally. I just want to tell - there are two bugs and this bugs exist since years, and LibreOffice will be better without this bugs because workaround looks not pretty. That is all. Workaround (if someone has same problems): Dim oDocument As Object Dim oReplace As Object oDocument = ThisComponent oReplace = oDocument.createReplaceDescriptor oReplace.searchAll=True oReplace.SearchString = "([^A-Za-z]h|^h)e\>" oReplace.ReplaceString = "$1is" oReplace.SearchRegularExpression = true oReplace.SearchCaseSensitive = false oDocument.replaceAll(oReplace) Thank you for your offer))
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.