Bug 100538 - Find & Replace makes replacement when it shouldn't, and Close button stops working
Summary: Find & Replace makes replacement when it shouldn't, and Close button stops wo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.4.1 rc
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.3.0 target:5.2.0
Keywords: bibisectRequest, regression
Depends on:
Blocks:
 
Reported: 2016-06-22 06:46 UTC by Aron Budea
Modified: 2016-10-25 18:41 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 Aron Budea 2016-06-22 06:46:43 UTC
1. Open attachment from bug 100535 [1] with LO 5.1.4.x, 5.2 beta or master builds. Observe that the document has no spaces (it has two empty lines, plus "Test" in a text box).
2. Press Down, then Enter (add an empty line at the end).
3. Open Find & Replace, enter " *$" in the Search For field. Leave Replace With field blank.
4. Press "Replace All". 1 replacement will be made.
5. Press "Replace All". 1 replacement will be made. (additional "Replace Alls" yield no further replacements, also the line added in step 2. will be gone)
6. Press Close or [X]. Nothing happens. (until you click outside the dialog, then Close / [X] works again)

Results for steps 4-6 are not correct, the regex is supposed to remove trailing spaces, but there are not spaces in the document.

This behavior replaces the crash described in bug 100535, but it is a regression. The Close button works fine in 5.1.3.2, and 4.4.0.3 works completely fine.

[1] https://bugs.documentfoundation.org/attachment.cgi?id=125819
Comment 1 Aron Budea 2016-06-22 07:03:45 UTC
Forgot an essential part of step 3:
check "Regular expressions" under "Other options".
Comment 2 Aron Budea 2016-06-22 15:24:12 UTC
Oliver, I found a commit for Find&Replace hang that was applied in 5.1 between 5.1.3 and 5.1.4.1, do you think that can explain this behavior? (also found the referenced bug report, bug 98224)
Comment 3 Per 2016-06-23 13:42:13 UTC
(In reply to Aron Budea from comment #0)
> 1. Open attachment from bug 100535 [1] with LO 5.1.4.x, 5.2 beta or master
> builds. Observe that the document has no spaces (it has two empty lines,
> plus "Test" in a text box).
> 2. Press Down, then Enter (add an empty line at the end).
> 3. Open Find & Replace, enter " *$" in the Search For field. Leave Replace
> With field blank.
> 4. Press "Replace All". 1 replacement will be made.
> 5. Press "Replace All". 1 replacement will be made. (additional "Replace
> Alls" yield no further replacements, also the line added in step 2. will be
> gone)
> 6. Press Close or [X]. Nothing happens. (until you click outside the dialog,
> then Close / [X] works again)
> 
> Results for steps 4-6 are not correct, the regex is supposed to remove
> trailing spaces, but there are not spaces in the document.
> 
> This behavior replaces the crash described in bug 100535, but it is a
> regression. The Close button works fine in 5.1.3.2, and 4.4.0.3 works
> completely fine.
> 
> [1] https://bugs.documentfoundation.org/attachment.cgi?id=125819

I have tried your test case on LO Version: 5.1.4.2 (x64) Win7 and is unable to confirm behaviour. Perhaps fixed now? Best Per
Comment 4 Aron Budea 2016-06-23 19:16:04 UTC
(In reply to Per from comment #3)
> I have tried your test case on LO Version: 5.1.4.2 (x64) Win7 and is unable
> to confirm behaviour. Perhaps fixed now? Best Per

Thanks for checking. Can you reproduce the crash in 5.1.3.2 with the same steps?
I haven't actually checked with 5.1.4.2, but it's there in master branch and in 5.2.0.1, so I wouldn't expect it to be fixed.
Comment 5 Aron Budea 2016-06-23 19:16:57 UTC
And by crash I mean freeze, as described in bug 100535.
Comment 6 Aron Budea 2016-06-24 03:01:57 UTC
I tested in 5.1.4.2, and could still reproduce it.
Did you check "Regular expressions" in addition to step 3., as I added in Comment 1?
Comment 7 JoNi 2016-06-24 23:54:10 UTC
I can confirm the described behaviour on recent linux master (d56dc64795dcd913d5fa663275bf34b75a0c82e6)

close button not working until you click inside the document and try to close again.
But it's not a real freeze as in busy and unresponsive, it just won't close the dialog.
Comment 8 Caolán McNamara 2016-07-11 19:36:49 UTC
I imagine the dialog doesn't close because its close button calls rBindings.Execute( SID_SEARCH_DLG ); and the same reason that you can't launch the search and replace dialog from inside the drawing box means you can't cancel it when the cursor is in there.
Comment 9 Caolán McNamara 2016-07-12 09:12:56 UTC
I see that the match claims to success inside the drawing shape which is odd seeing as it shouldn't match surely. And I see that in draw/impress regular expression search is disabled in the search dialog, I suspect because its known not to work
Comment 10 Caolán McNamara 2016-07-12 14:38:54 UTC
hmm, and anyway the selection that *writer* has is the anchor point not the content inside the drawing this. This only works for "FIND", not replace, or find & replace or find all. Looking at the timing of the original commit I feel this is for libreofficekit search support so I'd like to restrict it to just that mode as a quick fix
Comment 11 Commit Notification 2016-07-12 14:55:58 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=46b52c22bfb6b145af3c8407fd96321381e78d99

Resolves: tdf#100538 make searching in shape text a libreoffice-kit only thing

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-07-15 12:57:24 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e4f935f138d941f537227a344d4b93b05f951457&h=libreoffice-5-2

Resolves: tdf#100538 make searching in shape text a libreoffice-kit only thing

It will be available in 5.2.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2016-07-15 18:18:09 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f12492f72e744bd5b5b016d9c6c85e735948cc4b&h=libreoffice-5-2-0

Resolves: tdf#100538 make searching in shape text a libreoffice-kit only thing

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.