Bug 145868 - Find and replace: incorrect replacement after reopening the dialog
Summary: Find and replace: incorrect replacement after reopening the dialog
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-11-24 12:15 UTC by Xisco Faulí
Modified: 2022-02-08 08:36 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2021-11-24 12:15:18 UTC
I found this issue while working on the UItest for bug 122788

Steps to reproduce:
1. Open attachment 148401 [details] from bug 122788
2. Open Search&Replace dialog
3. Write 'Second' in the Find textbox
4. Click on Find Next -> Slide 2 is displayed and text 'second' selected
5. Close the dialog
6. Open it again while 'second' is still selected in the slide
7. Write 'First' inthe find textbox and 'replace' in the replace textbox
8. Click on replace

-> 'second' text is replaced by 'replace'

Reproduced

Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: 59e70256a358db136f5fd23651aea96d218b1a64
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2021-11-24 12:23:47 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=2ebc26aeefefe33ee6180862509e4971ff2dfc6f

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2020-08-22 21:45:44 +0200
committer	Tomaž Vajngerl <quikee@gmail.com>	2020-08-29 13:14:04 +0200
commit 2ebc26aeefefe33ee6180862509e4971ff2dfc6f (patch)
tree 9540fbb5cf497e907b738c59a83a338ce643e975
parent 88e52e539eaf7981441ec3e042f321c2615919ca (diff)
sd: Make search bound to a view - to allow independent searching

Bisected with: bibisect-linux64-7.1

Adding Cc: to Tomaž Vajngerl
Comment 2 Justin L 2022-01-25 13:18:36 UTC
This seems like a very specific instance of a general case that started even earlier.
1.) Press Ctrl-H to open a find/replace dialog
2.) search: "second", and replace: "junk".  Press either find or replace button
   -this "finds" the first instance of second - good
3.) change to search: "first".  Press replace button
   -this replaces "second" with "junk" and finds "first" - bad

Bibisecting this was just nasty. I either got on a streak of "good", or "bad". But later on when retesting, I had lots of "good" results in 42max, but then when it wasn't consistent I retested "oldest" and it was "bad". Also bad in oldest of 41max. Incomprehensible.
Comment 3 Justin L 2022-02-02 08:55:00 UTC
Note the # FIXME: tdf#145868 in sd/qa/uitest/findReplace/findReplace.py
Comment 4 Commit Notification 2022-02-04 20:40:56 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/583185235389b55d6cfffac3067c0e1ccb2852b1

related tdf#145868 sd: Clone SvxSearchItem to avoid use after free

It will be available in 7.4.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.
Comment 5 Commit Notification 2022-02-07 09:04:58 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/32c946c064cc2889bda2f46c1862e5100f0a257a

tdf#145868 sd replace: if search changes, restart find/replace

It will be available in 7.4.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.
Comment 6 Commit Notification 2022-02-08 08:33:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/dc3f27c910f455fce7a3afe3115ba51effd5e63f

related tdf#145868 sd: Clone SvxSearchItem to avoid use after free

It will be available in 7.3.1.

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.
Comment 7 Commit Notification 2022-02-08 08:36:02 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/0e1d4fec1b701c334c1e320f4d58c939aaa82910

tdf#145868 sd replace: if search changes, restart find/replace

It will be available in 7.3.1.

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.