Bug 141296 - Find & Replace must not change current selection
Summary: Find & Replace must not change current selection
Status: RESOLVED DUPLICATE of bug 132031
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2021-03-28 09:45 UTC by Roland White
Modified: 2023-05-30 08:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Search + replace screenshots (1.10 MB, application/gzip)
2021-04-26 10:09 UTC, Roland White
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland White 2021-03-28 09:45:22 UTC
Description:
Find & Replace: After marking an area (or column or line) checkmark "Current selection only" is set (as desired), so "Find" or "Replace All" relates only to the marked area, which is okay so far. Repeating this procedure checkmark disappears, so that next search and/ or replace affects all data (entire sheet), despite that the desired area is still marked.

Steps to Reproduce:
1. Mark area
2. Do "Replace All" (in marked area)
3. Close "Find & Replace" window
4. Do "Find & Replace" again (area still marked, but checkmark "Current selection only" is unset)

Actual Results:
Replacement affects all data by repetition, not only marked area (or column/ line) as desired

Expected Results:
Replacement should affect only the former marked area


Reproducible: Always


User Profile Reset: No



Additional Info:
Bug report recommended by Eike Rathke (de.comp.office-pakete.staroffice.misc, MsgID: N3e8I605f825cT37eb@kulungile.erack.de)
Comment 1 Harshita Nag 2021-04-24 05:05:20 UTC
Hello Roland White,
    Please attach a screenshot for clarity.
Comment 2 Roland White 2021-04-26 10:09:49 UTC
Created attachment 171411 [details]
Search + replace screenshots
Comment 3 Eike Rathke 2021-04-26 11:17:29 UTC
It's quite clear from the original description that invoking the dialog a second time on the very same selection set by the replacement result it has not the "Current selection only" option checked, which it should.
Comment 4 QA Administrators 2023-04-28 03:25:00 UTC Comment hidden (obsolete)
Comment 5 BogdanB 2023-04-28 04:18:09 UTC
"Current selection only" is not remembered the second time it is used.

Also in
Version: 7.5.2.1 (X86_64) / LibreOffice Community
Build ID: e8bf3b441b8370f8440b0339fd9490765a8d57ca
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 ady 2023-04-28 07:35:22 UTC
Please note that if the find and replace dialog is kept open, the checkbox is also kept ON (for a second search, on whichever area _seems_ selected at that moment). Only when closing the dialog and reopening, the problem is clearly noticed.

STR:
1. Select area including cells with content.
2. [CTRL]+[H]
3. Perform some search on selected area that results in some cells being selected.
4. Close all dialog windows. The same cells as _after_ step 3 _seem_ still selected.
5. [CTRL]+[H] > the "Current selection only" checkbox is not set ON by default.

Once the dialog is closed, some cells look highlighted (according to the result of the prior search). This is expected, and a helpful result. But only one cell is actually selected (as can be noticed by the "range" box at the left side of the formula bar). So it is understandable that the "Current selection only" checkbox won't be set ON.
Comment 7 ady 2023-04-28 07:39:48 UTC
(In reply to ady from comment #6)
> But only one cell is actually selected

Actually, that one cell is only in focus, not selected.
Comment 8 Heiko Tietze 2023-05-03 07:04:59 UTC
"Current selection" is checked if you have a selection, otherwise not (and it becomes disabled). So your use case is to select some cells but search everywhere- makes not much sense IMO. Just keep the dialog open, as Ady suggests in comment 6.

We could remember the off-state for selections and overwrite it accordingly. But I vote for resolving the request as NAB/WF.
Comment 9 ady 2023-05-03 10:45:19 UTC
(In reply to Heiko Tietze from comment #8)
> So your use case is to select some cells but search everywhere

@Heiko, I think that's not what Roland described. It is rather closer to the opposite.


@Roland,

After the initial search, some cells _seem_ selected:
* some cells are seemingly selected, 
* only _one_ cell actually has the focus, and,
* no cell is actually selected.


Without touching anything else but with the F&R dialog already closed once, Roland is attempting to reopen the dialog and search on those seemingly selected cells.

The workaround is simple (unless each search takes more than a couple of seconds at most): select the original area that is to be searched-for in the first search, perform the first search, and without closing the dialog you modify the search criteria field(s) and search for a second time. The second search is only limited to the cells that were already part of the results of the first search. The key is not to close the dialog and not to click on other cells meanwhile.
Comment 10 BogdanB 2023-05-03 10:57:05 UTC
Heiko, try to imagine a scenario where hundreds of columns and rows are selected, and having to repeat the selection for every search.
Comment 11 Heiko Tietze 2023-05-03 13:29:39 UTC
(In reply to ady from comment #9)
> @Heiko, I think that's not what Roland described. It is rather closer to the
> opposite.
To limit the search to the current(?) column if there is no selection?

(In reply to BogdanB from comment #10)
> Heiko, try to imagine a scenario where hundreds of columns and rows are
> selected, and having to repeat the selection for every search.
Why do you deselect if F&R is the workflow?

I struggle with the request after having started with the implementation. The code works fine and is well elaborated. And I started to wonder what use case makes it necessary to complicate this nice piece of code.
Comment 12 ady 2023-05-03 14:04:32 UTC
(In reply to Heiko Tietze from comment #11)
> (In reply to ady from comment #9)
> > @Heiko, I think that's not what Roland described. It is rather closer to the
> > opposite.
> To limit the search to the current(?) column if there is no selection?

No. I don't know how else to explain this. Perhaps reading again the STR in comment 0 (and following them)?

> 
> (In reply to BogdanB from comment #10)
> > Heiko, try to imagine a scenario where hundreds of columns and rows are
> > selected, and having to repeat the selection for every search.
> Why do you deselect if F&R is the workflow?
> 
> I struggle with the request after having started with the implementation.
> The code works fine and is well elaborated. And I started to wonder what use
> case makes it necessary to complicate this nice piece of code.

I already posted a simple workaround to Roland's request. Perhaps it would be better to wait for someone to present a use case in which the workaround is not enough before working on this?
Comment 13 Heiko Tietze 2023-05-25 07:28:55 UTC
We discussed the topic in the design meeting.

The option depends on whether a selection has been made or just one cell is selected, and automatically set on or off. Excel always applies F&R to the selection or all cells, meaning our option is rather to ignore the selection. Another difference is that we select the cells with replaced content, which is very convenient in most cases. But fails for iterative operations.

The suggestion is to select the replaced cells only if no selection was made before; i.e. to keep it. And ideally to introduce a different kind of feedback, eg. per accent color.
And consequently to remove the option to disable it.

Essentially a duplicate of bug 132031.
Comment 14 Heiko Tietze 2023-05-30 08:31:38 UTC
(In reply to Heiko Tietze from comment #13)
> Essentially a duplicate of bug 132031.

Let's consolidate the topic.

*** This bug has been marked as a duplicate of bug 132031 ***