Bug 111843 - one active cell selection is not searched with "Current selection only" option set in Find & Replace dialog tool
Summary: one active cell selection is not searched with "Current selection only" optio...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 136496 (view as bug list)
Depends on:
Blocks: Find&Replace-Dialog
  Show dependency treegraph
 
Reported: 2017-08-16 06:46 UTC by Stéphane Guillou (stragu)
Modified: 2023-10-23 18:50 UTC (History)
7 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 Stéphane Guillou (stragu) 2017-08-16 06:46:43 UTC
Description:
When using the "find & replace" tool after clicking on a single cell and using the "current selection only", the tool will not find a search criteria even if it exists in the active cell.

I think this is not intuitive. I assume most people would consider that the active cell they just clicked on is considered a "selection".

I am aware of the fact that it is not highlighted like a cell range would be, and that it is possible to click and drag from A1 over to A2 and back to A1 in order to highlight what we could call a "single-cell range", but that would not be straight-forward. An active cell is in my opinion a selection, and I can't think of a case when the active cell is not part of a selected range.

In my opinion, the following is a further confirmation that this is a bug:
When the active cell contains something, the option "Current selection only" is selectable; however, when the active cell is empty, the option "Current selection only" is greyed out. This shows that the tool differentiates between active cells that contain something and cells that don't, just like it does for ranges.

Steps to Reproduce:
1. Open a new document
2. Write "blah" in cell A1
3. Click on cell A1
4. Open the "Find & Replace" tool
5. Write "blah" in the "Find" field
6. Tick the option "Current selection only"
7. Click "Find All" (or alternatively, click "Replace All")

Actual Results:  
The tool returns "Search key not found".

Expected Results:
The tool finds the term in the selected (active) cell.


Reproducible: Always

User Profile Reset: No

Additional Info:
System details:

Version: 5.3.5.2
Build ID: 50d9bf2b0a79cdb85a3814b592608037a682059d
CPU Threads: 2; OS Version: Linux 3.13; UI Render: default; VCL: kde4; Layout Engine: new; 
Locale: en-GB (en_GB.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Comment 1 Stéphane Guillou (stragu) 2017-08-29 01:23:48 UTC
...actually, I can now think of a case when an active cell is not part of a selection: when selecting multiple cells with ctrl+click and deselecting a cell from the selection with a final ctrl+click.

To me, it would make sense to:
- keep the current behaviour for multiple-cell selection;
- in the absence of a selection (i.e. highlighted cell(s)), consider the current active cell as the selection.

But I guess that would be considered an inconsistency.

Maybe we could easily fix this and make everyone happy with greying out the "current selection only" when there is no highlighted selection? That would be enough of a hint to make the user understand that the active cell is *not* a selection.
Comment 2 Heiko Tietze 2017-09-09 09:42:26 UTC
@Stuart, please have a look.
Comment 3 V Stuart Foote 2017-09-12 04:22:12 UTC
On Windows 10 Pro 64-bit en-US with
Version: 5.4.1.2 (x64)
Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527
CPU threads: 8; OS: Windows 6.19; UI render: default; 
Locale: en-US (en_US); Calc: group

Confirming STR of the non-selection with just the currently active cell with cursor focus, or the misbehavior of the "Current selection only" option which shows active with just the one cell with cursor focus as a "range".

Selecting one additional cell produces valid search result. 

So seems like we have a logic flaw and test the view shell for HasSelection() at [1] enabling the "Current selection only" option-with just the one cell with cursor focus.  

Is it a valid selection range or not? 

   If it is--the search needs to accommodate a one cell range.

   If not--need to keep the Selection Btn disabled.

From UX perspective, searching just a single cell is not a common use, but why not? Could be of some use in macro to conditionally test a cell.

=-ref-=
[1] https://opengrok.libreoffice.org/xref/core/svx/source/dialog/srchdlg.cxx?a=true#915
Comment 4 Heiko Tietze 2017-09-12 06:58:16 UTC
(In reply to V Stuart Foote from comment #3)
> From UX perspective, searching just a single cell is not a common use, but
> why not? Could be of some use in macro to conditionally test a cell.

Is the expectation to find 'lo' in 'Hello World'? Or a certain part of a formula, to be more specific.
Comment 5 QA Administrators 2018-09-13 02:40:41 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2018-09-13 12:23:06 UTC
Tested and confirmed as still present with the following:

Version: 6.0.6.2
Build ID: 1:6.0.6-0ubuntu0.18.04.1
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_GB.UTF-8); Calc: group
Comment 7 Stéphane Guillou (stragu) 2019-07-11 13:19:13 UTC
Confirmed in:

Version: 6.3.0.1
Build ID: 41ac97386aba908b6db860cfb4cfe2da871886ae
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 8 BogdanB 2020-09-21 06:02:04 UTC
Reteested in
Version: 7.0.1.2
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (ro_RO.UTF-8); UI: en-US
Calc: threaded

Not working for 1 cell selection. Working for that cell plus any other cell selection.
Comment 9 BogdanB 2020-09-22 19:31:30 UTC
*** Bug 136496 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2021-12-10 21:58:26 UTC
Still reproducible in:

Version: 7.3.0.0.beta1 / LibreOffice Community
Build ID: 436f14c25ec1847646b953cf13d0db4f7ca3be57
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Already the case in:

Version: 5.2.0.0.alpha1
Build ID: 902b28a39528b6c92602e9b521a1d0861be1caf9
CPU Threads: 4; OS Version: Linux 5.4; UI Render: default; 
Locale: en-AU (en_AU.UTF-8)
Comment 11 Eike Rathke 2021-12-15 18:29:40 UTC
Nitpick: clicking on a cell does *not* result in a selection, just an active cell; note also that the dialog's "Current selection only" is not automatically activated for just an active cell, because it is *not* a selection, and activating "Current selection only" does not magically result in the cell being selected, so the subsequent action of "search in selected cells only" of course does not find anything.

To *select* 1 cell, Ctrl+Click the cell again, or select it with the keyboard sequence Shift+Down followed by Shift+Up, or Shift+Right followed by Shift+Left (or other combinations of invert direction selection).

Also, the differentiation between active cell and selected cell should not be eliminated as it can lead to ambiguities as comment 1 lined already out; as is, the differentiation and non-presence of a selection makes many state checks for range or multiple selections unnecessary.

If there is no selection then the "Current selection only" option could be disabled; however, note that the dialog is non-modal and un-/selecting cells while the dialog is open is possible, so dis-/enabling the option should follow the then current state, not being a one-time-set.
Comment 12 John Smith 2023-10-23 18:50:33 UTC Comment hidden (spam)