Bug 122280 - Remove Block selection mode from Calc
Summary: Remove Block selection mode from Calc
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: lowest trivial
Assignee: Aditya Sahu
URL:
Whiteboard: target:6.3.0 target:6.5.0 target:6.4.0.2
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: Selection
  Show dependency treegraph
 
Reported: 2018-12-22 15:51 UTC by Buovjaga
Modified: 2019-12-21 12:16 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
block in 6.5 (15.05 KB, image/png)
2019-12-09 05:44 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2018-12-22 15:51:51 UTC
I was originally going to file this report for:

1. Left-click the selection mode icon in the status bar many times

You can never reach Block selection. This works fine in Writer.
Left-click behaviour was implemented with https://gerrit.libreoffice.org/plugins/gitiles/core/+/de1bb0878fc7d7eb6071ec94d770712648013075%5E!/

It is not clear to me, what the selection mode is supposed to do in Calc. It does not seem to behave at all differently from Standard. Nobody seems to be able to answer why we have it in Calc:
https://ask.libreoffice.org/en/question/170542/in-calc-what-does-block-selection-mode-do/
https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=95979

Block selection crept into Calc sometime after 3.5.0.

As it seems useless, should we remove it from Calc?
Comment 1 Regina Henschel 2018-12-22 18:53:10 UTC
The handling seems to be in https://opengrok.libreoffice.org/xref/core/sc/source/ui/view/cellsh3.cxx#101. I see no "Block selection" there.

If you simple click on the control in the status bar, you get Standard -> Extending -> Adding -> Standard. To see the current mode you need to disable extended tips and then hover the control with the mouse until the tooltip is shown. Only the context menu has the item "Block selection". If you select it, the control still shows the mode "Standard" in the tooltip.
Comment 2 Buovjaga 2018-12-23 14:42:12 UTC
Yep, forgot to mention you need to right-click to see the full list of selection modes.

I checked with bibisect-43all and the change seems to have appeared between 3.5 and 3.6 (there was no right-click action before). I was unable to pinpoint the exact commit.
Comment 3 Xisco Faulí 2018-12-26 16:07:11 UTC
if we agree to remove it, I guess we could turn this issue into an easyhack...
Comment 4 Tej 2018-12-27 07:08:08 UTC
Assigned to myself, will try to fix the easyhack.
Comment 5 Jim Raykowski 2018-12-29 09:35:44 UTC
Hi Tej,

Here are code pointers for an approach which hides the "block" menu item for Calc use of SvxSelectionModeControl.

core/svx/source/stbctrls/selctrl.cxx
SvxSelectionModeControl and SelectionTypePopup classes

member m_xMenu in SelectionTypePopup is type PopupMenu

core/include/vcl/menu.hxx
PopupMenu class is inherited from Menu class which has function/method ShowItem

SID_STATUS_SELMODE slot id can be used to identify Calc use of SvxSelectionModeControl
core/sc/source/ui/app/scdll.cxx
    SvxSelectionModeControl         ::RegisterControl(SID_STATUS_SELMODE,   pMod);

FN_STAT_SELMODE slot id is for Writer use of SvxSelectionModeControl (we don't need it for this hack)
core/sw/source/uibase/app/swmodule.cxx
    SvxSelectionModeControl::RegisterControl(FN_STAT_SELMODE, pMod );
    
Add a function/method to SelectionTypePopup class to hide the "block" item in m_xMenu
examine SelectionTypePopup::state_to_id to see how to GetItemId to used with m_xMenu ShowItem in created hide function

In SvxSelectionModeControl::MouseButtonDown use inherited function/method GetSlotId() to check if this is a Calc SvxSelectionModeControl
(this will require #include "../sc/inc/sc.hrc" for the SID_STATUS_SELMODE define)
Call SelectionTypePopup hide function on aPop if it is.
Comment 6 Xisco Faulí 2019-01-29 03:46:25 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2019-03-27 03:37:20 UTC Comment hidden (obsolete)
Comment 8 Aditya Sahu 2019-04-16 17:09:25 UTC
Since there have been no updates on this bug by the assignee for quite some time now, I think it'd be okay if I assign the ticket to myself. 
Tej, if you're still working on this - let us know :-)
Comment 9 Commit Notification 2019-04-20 07:46:52 UTC
Aditya committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/220ce1a5b1db6e456afe04b7e9002c524dcf1044%5E%21

tdf#122280: Hide Block selection mode from Calc

It will be available in 6.3.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 10 Buovjaga 2019-04-20 09:48:49 UTC
Thanks, I verify!

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: b8f33d053c2cbf05872cf9ddfeff4cc302ee281f
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 20 April 2019
Comment 11 Commit Notification 2019-04-23 17:58:07 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/aafc733e8d8447f1ba878faa6e7ed3804ed44007%5E%21

Revert "tdf#122280: Hide Block selection mode from Calc"

It will be available in 6.3.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 12 BogdanB 2019-12-09 05:44:17 UTC
Created attachment 156421 [details]
block in 6.5

I have block selection in 6.5

Version: 6.5.0.0.alpha0+
Build ID: 5030be4e85179147476b1e441eb618fb6ed58235
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-11-28_20:14:48
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 13 Commit Notification 2019-12-20 17:02:09 UTC
Aditya committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1e94d803f7a70027d03f1303c19818ca2de0d67f

tdf#122280: Hide Block selection mode from Calc

It will be available in 6.5.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 14 Commit Notification 2019-12-20 21:54:09 UTC
Aditya committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

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

tdf#122280: Hide Block selection mode from Calc

It will be available in 6.4.0.2.

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 15 Buovjaga 2019-12-21 12:15:41 UTC
Thanks for the new fix!

Arch Linux 64-bit
Version: 6.5.0.0.alpha0+
Build ID: 2dfc1dce87a0509e76d3d5875e03e3fae5d677d7
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 21 December 2019