https://bugs.documentfoundation.org/show_bug.cgi?id=171865
--- Comment #13 from Justin L <[email protected]> --- (In reply to Paolo Benvenuto from comment #11) > At least Comments and Regular expressions are ignored, too. Match whole word is NOT ignored. When you both search for and select 'or', then that is considered an entire word because that is the only context it has! If you had selected 'ore' or 'Lor' instead, then the replace would not have happened. Similarly, 'Comments' is also not ignored. It doesn't mean 'only comments', it means 'also comments'. Similarly, 'Regular expressions' are not ignored. If you select 'or' and search for '..' then the replace will happen. (In reply to Paolo Benvenuto from comment #0) > So the buttons should be inactive until the searched text is selected. I strongly disagree. This is a very normal workflow for people - to only press the replace button. (In reply to Paolo Benvenuto from comment #6) > The problem with the actual behaviour is that: > - if nothing is selected in the document, clicking Replace doesn't do anything That is not a problem. As a user, I shouldn't expect anything to happen the very first time (when there is no selection). > - if something is pre-selected in the document, the selection is automatically > put in the find text box, and clicking Replace substitutes it with what is > added in the replace text box, without checking if the selection in the text > is matched by the state of the search&replace dialog; Not true. It does first check that the 'search string' exists in the user-selection. [see SwView::ExecSearch case SvxSearchCmd::REPLACE] AFAICS, the exact same FUNC_Search(aOpts) runs to confirm the replace as what runs after to find the next match. So actually each word is normally found twice. The first time is the wide-open search-after-replace. Then, before being replaced, it is confirmed again (limited to the selection). I don't know how you could avoid the problem of comment 8 - since this is exactly how multiple presses of 'Replace' work. -- You are receiving this mail because: You are the assignee for the bug.
