Bug Hunting Session
Bug 119804 - Permit sorting using column labels even if labels row is protected
Summary: Permit sorting using column labels even if labels row is protected
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Martin van Zijl
URL:
Whiteboard: target:6.3.0
Keywords: difficultyBeginner, easyHack, skillCpp
: 127206 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-11 12:04 UTC by ed38
Modified: 2019-08-28 18:30 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 ed38 2018-09-11 12:04:04 UTC
Description:
It is very useful to protect the first row containing labels but it blocks sorting by key in Sort menu, even if this row is not modified.

Steps to Reproduce:
1. Fill 3 first columns of first row with "label 1", "label 2" "label 3"
2. Fill cells below with random data 
3. Protect first row and protect sheet
4. Go to Sort Menu, choose "label 1" as "Sort key 1" and "range contains column labels" in Options.
5. Sorting fails due to protection of first row.



Actual Results:
Sorting fails due to protection of first row.


Expected Results:
First row, containing labels is not modified so there is no reason to block sorting.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.3.2
Build ID: 1:6.0.3-0ubuntu1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 1 Mike Kaganski 2018-09-12 05:07:16 UTC
Also reproducible with OOo 3.3.0 OOO330m20 (Build:9567)

A code pointer: ScDBDocFunc::Sort in sc/source/ui/docshell/dbdocfun.cxx tests whole passed range for editability, not excluding labels.
Comment 2 Martin van Zijl 2019-01-10 21:27:59 UTC
I have just submitted a patch for this.
Comment 3 Mike Kaganski 2019-01-10 21:32:33 UTC
https://gerrit.libreoffice.org/66133
Comment 4 Commit Notification 2019-01-14 06:07:01 UTC
Martin van Zijl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#119804 allow sort when header row protected

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 5 BogdanB 2019-01-22 19:22:04 UTC
I wanted to confirm this bug as fixed, it is fixed but with an important mention...

In a new file in version 6.3 all cells are protected as default. This way the first row and also next rows are protected. 
So, when I Sort after sheet protection, nothing happend.

I have to select all numbers, except first row to be unprotected, in order to confirm this bug, as working as expected, but only if this problem of ALL CELL protected as default is an ok thing.


Version: 6.3.0.0.alpha0+
Build ID: 1e38d5b976dacd8b42b8330b4b9635a058ffe20b
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-21_21:44:37
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 6 BogdanB 2019-01-22 19:27:48 UTC
If it is not clear, I can make a short video. Just in case.
Comment 7 Mike Kaganski 2019-01-22 20:45:14 UTC
(In reply to BogdanB from comment #5)

Thanks for testing!

> but only if this problem of ALL
> CELL protected as default is an ok thing.

Yes, it's OK; and it was that way since ~forever.
Comment 8 BogdanB 2019-01-26 13:42:35 UTC
Fixed. Verified on Version: 6.3.0.0.alpha0+
Build ID: 3424004cca7cb61043800f0ff0acc9de64768276
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-26_00:45:09
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 9 Mike Kaganski 2019-08-28 18:24:38 UTC
*** Bug 127206 has been marked as a duplicate of this bug. ***
Comment 10 Mike Kaganski 2019-08-28 18:30:09 UTC
Mentioned at https://wiki.documentfoundation.org/ReleaseNotes/6.3#Calc.