Bug Hunting Session
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.3.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-16 06:46 UTC by stragu
Modified: 2019-07-11 13:19 UTC (History)
5 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 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 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 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 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