Quantcast

[REVIEW: 3-5] fdo#44861 make "Replace All" behave correctly with REs

classic Classic list List threaded Threaded
2 messages Options
David Tardon David Tardon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[REVIEW: 3-5] fdo#44861 make "Replace All" behave correctly with REs

Hi all,

the problem is that we did not refresh search data for subsequent
searches, so the back references were always filled using the search
data of the first match. So, for RE ([0-9]{2})([0-9]{2}), replacement
$1.$2 and string "1200-1300", that would lead to the following sequence
of changes:

1. back refs 0-2, 2-4 -> "12", "00"; repl. "12.00"; new str. "12.00-1300"
2. back refs 0-2, 2-4 -> "12", ".0"; repl. "12..0"; new str. "12.00-12..0"

Commit ea1cd1a10cc2d2bbf4f82aeca689fe81a3b79856 fixes that.

D.
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Petr Mladek Petr Mladek
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [REVIEW: 3-5] fdo#44861 make "Replace All" behave correctly with REs

David Tardon píše v St 18. 04. 2012 v 10:02 +0200:

> Hi all,
>
> the problem is that we did not refresh search data for subsequent
> searches, so the back references were always filled using the search
> data of the first match. So, for RE ([0-9]{2})([0-9]{2}), replacement
> $1.$2 and string "1200-1300", that would lead to the following sequence
> of changes:
>
> 1. back refs 0-2, 2-4 -> "12", "00"; repl. "12.00"; new str. "12.00-1300"
> 2. back refs 0-2, 2-4 -> "12", ".0"; repl. "12..0"; new str. "12.00-12..0"
>
> Commit ea1cd1a10cc2d2bbf4f82aeca689fe81a3b79856 fixes that.

Great catch! Makes sense. Works well => pushed into 3-5 branch, see
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=4bd76b74c0145635ef69caa94e3235f6ce3ab5de

It will be in 3.5.3-rc1.


Best Regards,
Petr

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Loading...