[Libreoffice] [PUSHED] [PATCH] Writer: Bug 36181 - EasyHack: Replace with "Notes" option doesn't work with text selected

Caolán McNamara caolanm at redhat.com
Mon Jul 4 06:54:25 PDT 2011


On Sun, 2011-07-03 at 23:07 +0200, Benoit Dolives wrote:

Yup, patch fixes fixes the problem. Thanks for this. Pushed now to
master.

Can you confirm that this is under our preferred LGPLv3+/MPL license
combo ?

> Concerning your open question, the proposed patch checks if the
> searched string belongs to the selection by using the same mechanism
> as the common search command. Therefore it should have the same
> behaviour as the search command in both cases (common or advanced
> search/replace).

Hmm, if I stick e.g. Apple banana in there, select nothing, search and
replace with regular expression of b.*a to match banana but where the
search string has a different length to the text it will match, with
"comments" enabled, then that one doesn't replace.

AFAICS that "length is the same" branch is just an optimization. When
removed everything works as I would expect, so I pushed that as a follow
up fix. 

Would be good if you could double-check my changes there, and if the
equal length code is based on some other code elsewhere, there might be
an additional fix needed for the legacy stuff too.

There's probably a few more gotchas with search and replace in writer,
(e.g. how come I can't use "replace all" when comments are selected) if
you dig around bugzilla for them :-)

C.




More information about the LibreOffice mailing list