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))
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.3 or later) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results; 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-06-08
Confirmed in LO 5.0.2
It might not apply to this issue, but I was encountering a similar error with the "Alternative Searching 1.4.1" extension reporting "SearchCaseSensitive" in object Desc = ThisComponent.createSearchDescriptor" My issue appears to have been resolved in today's RC 5.1.0.3
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.2.5 or 5.3.0 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20170306
Both bugs are still here. LibreOffice 5.3.0
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
I investigated the bug and for me the behaviour of LO is partially correct, because the replaceDescriptor does not support the SearchWords flag, if we search using regular expressions, because they itself have the word boundary capturing group, i.e., \b. So the example should work using: oReplace.SearchString = "\b(h)e\b" oReplace.ReplaceString = "$1is" oReplace.SearchRegularExpression = true This example indeed works in the search and replace dialog in Writer, but it replaces all the he/He with $1is. I think this is the main bug. Any thoughts?
Updt. First appearance of He replaced with His, all following - with $1is
ReplaceAll replaces all he/He with $1is and a simple replace does nothing and jumps to the next he/He. However, if the \b is omitted, all occurences of he/He will be found.
FTR, steps: 1. In a new text document, insert dummy text using dt<F3>, which gives a text starting with "He ..." 2. Ctrl+H 3. Use regular expressions; search for `\b(h)e\b`, replace with `$1is` 4. Try using Replace 5. Try Replace All Result of #4 is nothing happens for all but first [Hh]e; result of #5 is all but 1st [Hh]e turn into $1is.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eb973a46ba0e34026db2d2929f2aa10505623872 tdf#75806: use actual string leading characters for correct precondition match It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fd8f926b0e409d49d235409daaf8f7aa8532cc40 tdf#75806: extend SwUiWriterTest::testTextSearch to test relevant regexes It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 107916 has been marked as a duplicate of this bug. ***
*** Bug 133084 has been marked as a duplicate of this bug. ***