https://bugs.documentfoundation.org/show_bug.cgi?id=171825
--- Comment #4 from Franklin Weng <[email protected]> --- (In reply to Justin L from comment #3) > Created attachment 208263 [details] > 171825_surpriseAttributes.odt: example why replace-all might not be wise > > I must admit I can't really imagine a scenario where you want to change any > kind of formatted text to one specific string... > > I'm not convinced that allowing Replace-All is wise. Searching for > Attributes is likely to result in some surprises, so forcing the user to > step through and approve each match seems to be wise. > > > For replace-once, this is handled by viewsrch.cxx, where FUNC_Search is > called as ::FIND (not ::REPLACE) and then the replace aspect is handled > separately by m_pWrtShell->SwEditShell::Replace. > > In the replace-all case, the replace aspect is handled by FUNC_Search > itself. Under the conditions of this bug report, FUNC_Search does NOT pass > aSearchOpt to m_pWrtShell->SearchAttr because the SEARCH string is empty > (while for bug 99672 there was a search string, so aSearchOpt was provided). > > A sample patch that solves this bug report is at > https://gerrit.libreoffice.org/c/core/+/210129 First, this is real-world requirement from our users. Then, "forcing the user to step through and approve each match" seems to be wise, but not when there are a lot more places (like, 100 or 300) to replace. If users need to approve each by each they can still do it by clicking Replace instead of Replace All. Also, it shows "Search key replaced x times", but actually none of them were replaced. That is definitely not correct. Thanks for working on this issue! -- You are receiving this mail because: You are the assignee for the bug.
