Bug 132860 - UI: Paragraph style name field should be grayed out for default styles (can't be editted)
Summary: UI: Paragraph style name field should be grayed out for default styles (can't...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Shubham Jain
URL:
Whiteboard: target:7.2.0 target:7.1.0.0.beta2
Keywords: difficultyMedium, easyHack, skillDesign, topicUI
Depends on:
Blocks: Page-Style-Dialog
  Show dependency treegraph
 
Reported: 2020-05-08 20:23 UTC by Telesto
Modified: 2020-12-04 10:31 UTC (History)
4 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 Telesto 2020-05-08 20:23:03 UTC
Description:
UI: Paragraph style name field should be grayed out for default styles (can't be editted)

Steps to Reproduce:
1. Open Writer
2. Styles -> Edit styles -> Organizer
3. The name field looks editable (can place a cursor in it and select everything).. but you actually can't.. Only home made styles have a changeable name

Actual Results:
Misleading dialog

Expected Results:
Make clear it can't be changed


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.0.alpha0+ (x64)
Build ID: 97a2c1fc5e376c0c00968f17a0392c6d3a5ed565
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: threaded
Comment 1 Jim Raykowski 2020-05-12 02:24:07 UTC
This is an edit control that is read only for non home made styles. The cursor doesn't show for the gtk3 backend like it does for the sal backends I have tested, x11, kf5, qt5.

I found this comment in the code:
// Set the field read-only if it is NOT an user-defined style
// but allow selecting and copying 

The ability to copy the name to the clipboard will be lost for non home made styles if this is changed to be a grayed out. If this can be lived with, here are some code pointers to help do it:

code pointers:

core/sfx2/source/dialog/mgetempl.hxx
study class SfxManageStyleSheetPage, m_xName is our friend

core/sfx2/source/dialog/mgetempl.cxx
look in the SfxManageStyleSheetPage constructor for Widget Flag settings for m_xName for non home made user defined styles. set_.*
set_sensitive is the function to set weld widgets sensitive flag which will make them grey or not gray :-)

it may be fun to get the Glade out to examine core/sfx2/uiconfig/ui/managestylepage.ui
One might possibly want to begin with the sensitive Widget Flag off.
Comment 2 Heiko Tietze 2020-05-12 06:20:26 UTC
Don't see need to copy a name. The advantage of a common usability with disabled controls when no input is possible (instead of read-only) is clear. So let's do it.
Comment 3 Commit Notification 2020-11-24 05:39:43 UTC
shubham656 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1795cfde106c830bff513d3a9ff27d1759f9b227

tdf#132860 Assign value to set_sensitive flag in m_xName

It will be available in 7.2.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 4 Commit Notification 2020-11-24 10:41:19 UTC
shubham656 committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/e0c1dcd97edc1194e4445a45a815406446c1c7d7

tdf#132860 Assign value to set_sensitive flag in m_xName

It will be available in 7.1.0.0.beta2.

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 Heiko Tietze 2020-11-24 10:46:25 UTC
(In reply to Commit Notification from comment #3)
> shubham656 committed a patch related to this issue.

"Default Style" is now greyed out but none of the other styles such as "Text Body" (or "Bullets" for CS). However, I cannot change any of those.
Comment 6 Shubham Jain 2020-11-24 12:28:31 UTC
(In reply to Heiko Tietze from comment #5)
> (In reply to Commit Notification from comment #3)
> > shubham656 committed a patch related to this issue.
> 
> "Default Style" is now greyed out but none of the other styles such as "Text
> Body" (or "Bullets" for CS). However, I cannot change any of those.

I think I checked and I couldn't change them before graying out the default box as well. (Please correct me if I am wrong!)
Comment 7 Heiko Tietze 2020-12-04 10:31:19 UTC
(In reply to Shubham Jain from comment #6)
Please correct me if I am wrong!

You are not, me was wrong. Thanks for fixing the issue.