Bug 135106 - Direct Formatting should be empty by default in Inspector
Summary: Direct Formatting should be empty by default in Inspector
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Shivam Kumar Singh
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks: Style-Inspector
  Show dependency treegraph
 
Reported: 2020-07-24 16:34 UTC by Shivam Kumar Singh
Modified: 2022-08-14 18:52 UTC (History)
1 user (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 Shivam Kumar Singh 2020-07-24 16:34:51 UTC
Description:
Currently Direct Formatting category shows a list of properties which are not actually manually formatted. These should be hidden

Steps to Reproduce:
1.Click on Inspector in the sidebar
2.Check "Direct Formatting"

Actual Results:
"Direct Formatting" is not empty

Expected Results:
"Direct Formatting" is empty


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+
Build ID: d8270636a57e7dc68ede51308c380e2098f765d7
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 1 Mike Kaganski 2020-07-24 16:42:44 UTC
Not so sure.

There are direct properties that may be actually hidden: I mean paragraph style and character style. They may be hidden simply because they are shown in a different way - in respective sections. But about others -

well, the whole idea around the styles inspector was to provide a low-level, detailed view into what's going on under the cover. This view might allow filtering, and it's reasonable to provide useful view modes; but it's unreasonable to try to hide the reality when it turns out to be different from expectations.

E.g., Rsid is necessarily a direct property of a text (applied for change tracking and comparison purposes); where input language is taken into account (Windows), the text language will be the direct property without any explicit user formatting... and we need to consider the properties shown here one by one, to see why would we hide them.
Comment 2 Shivam Kumar Singh 2020-07-24 18:19:31 UTC
I agree with you Mike that its important to have an idea about the direct properties that are actually hidden, but should not DF only show properties which are 
"manually formatted" ?
The properties shown currently in the "Direct Formatting" are :-

* ContinueingPreviousSubTree
* NumberingisNumber
* NumberingLevel
* NumberingStartValue
* PageStyleName
* ParaConditionalStyleName
* ParaIsNumberingRestart
* ParaStyleName
* Rsid

We can choose some individual properties and hide them forcefully.
Waiting for more input.
Comment 3 Mike Kaganski 2020-07-25 06:21:45 UTC
(In reply to Shivam Kumar Singh from comment #2)
These are special properties of cursor (SwUnoCursorHelper::getCursorPropertyValue)

> * ContinueingPreviousSubTree
    Does not make sense in character properties => hide in current "Direct properties". In paragraph properties, indicates that this paragraph continues numbering after previous unnumbered list entry (SwNumberTreeNode::mbContinueingPreviousSubTree); not a setting, just a flag indicating state => hide also in paragraph direct properties (tdf#135115).
> * NumberingisNumber
    Does not make sense in character properties => hide in current "Direct properties". In paragraph properties, indicates that this paragraph is numbered in its list (controlled by Format->Lists->Insert Unnumbered Entry). Despite it only makes sense in lists, it's still a direct paragraph property. Hide when not in list (test "ListId" (UNO_NAME_LIST_ID) property state (default -> not in list)); hide when true (default for this property when in list).
> * NumberingLevel
    Does not make sense in character properties => hide in current "Direct properties". In paragraph properties, indicates level in list (controlled by Format->Lists->Promote/Demote). Despite it only makes sense in lists, it's still a direct paragraph property. Hide when not in list.
> * NumberingStartValue
    Does not make sense in character properties => hide in current "Direct properties". In paragraph properties, when this paragraph restarts numbering, indicates the number from which to restart (I don't know what controls this - needs investigating). My take: hide when its state is PropertyState_DEFAULT_VALUE (it will only show up when actually set).
> * PageStyleName
    Style of page this point is on. Not a setting, just a state. Hide.
> * ParaConditionalStyleName
    Indicates a *state* related to conditional paragraph styles [1]. Not a setting. Hide.
> * ParaIsNumberingRestart
    Does not make sense in character properties => hide in current "Direct properties". In paragraph properties, indicates that this paragraph restarts numbering (controlled by Format->Lists->Restart Numbering). Hide when is false (will automatically hide when not in list).
> * ParaStyleName
    We see it in paragraph styles => Hide.
> * Rsid
    Not user-settable property (auto-generated counter used for change tracking and comparing). Now I think we should just hide it, since it's not editable.

[1] https://help.libreoffice.org/7.1/en-US/text/swriter/01/05130100.html
Comment 4 Mike Kaganski 2020-07-25 06:48:08 UTC
By the way, please use constants from sw/inc/unoprnms.hxx when testing and formatting the values. You will need to move value formatting code from svx into sw, because svx might not always know how to display something specific to a module.
Comment 5 Commit Notification 2020-07-26 19:33:02 UTC
Shivam Kumar Singh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135106 Direct Formatting should be empty by default

It will be available in 7.1.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.