Bug 85131 - Update style command (.uno:StyleUpdateByExample) doesnt work when paragraph is partially selected and/or not all text has same formatting
Summary: Update style command (.uno:StyleUpdateByExample) doesnt work when paragraph i...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 84999 91207 92021 (view as bug list)
Depends on:
Blocks: Styles-Management Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2014-10-17 11:14 UTC by Yousuf Philips (jay) (retired)
Modified: 2024-03-20 10:48 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (9.03 KB, application/vnd.oasis.opendocument.text)
2014-10-17 11:14 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-10-17 11:14:03 UTC
Created attachment 107983 [details]
sample file

Steps:
1) Open attached file
2) Select part of the italics, non-bold or colored of the text
3) On style drop down, open drop down submenu, and click to update the style based on selection.

Version: 4.4.0.0.alpha0+
Build ID: 3b6ee58652d99accd610425264114d1d5b3330df
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2014-10-15_21:41:26
Comment 1 Yousuf Philips (jay) (retired) 2014-10-21 09:27:24 UTC
After discussing the style issue with Sophi on IRC regarding her similar bug 84999, it seems that you need to modify the full text defined in a particular style in order for 'update to match selection' to work with or without a selection.

This behaviour is different from MS Word which applies the style based on the selection or the cursor position.
Comment 2 sophie 2014-10-21 09:30:03 UTC
Hi, so confirmed as discussed with Jay on irc. The style is not updated if the paragraph selection is partial, you have to select the whole paragraph to be able to update the style. Tested with Heading1 paragraph style. Sophie
Comment 3 sophie 2014-10-21 09:33:56 UTC
*** Bug 84999 has been marked as a duplicate of this bug. ***
Comment 4 Cor Nouws 2015-06-09 10:31:15 UTC
If I'm not mistaken, this is behaviour from the old days, so > Inherited from OOo
Comment 5 Cor Nouws 2015-06-09 10:34:43 UTC
Question is whether this must be changed..
When you have to select a whole paragraph and all formatting must be the same: 
 - it prevents messing up formatting (in at least the selected paragraph)
 - there is no change that one updates to a font that is not intended.

Ideas for WontChange / WorksForMe ?
Comment 6 Cor Nouws 2015-06-09 10:41:57 UTC
hmm, it is not needed to select the whole paragraph if it has the same formatting.
And the style will not be updated if the paragraph is not equally formatted.
Works like this in 3.3.0 and 5.0.0beta1
Comment 7 Yousuf Philips (jay) (retired) 2015-06-09 11:03:30 UTC
Punting this over to ux-advise for other people's opinion.

For me, if it didnt act like i expected it to act, it should have given me an error or something rather than it doing nothing and not telling me why its doing nothing. Also the label is called 'update the style based on selection', its not called 'update the style based on the style of the entire paragraph'.
Comment 8 Cor Nouws 2015-06-09 12:40:14 UTC
(In reply to Yousuf (Jay) Philips from comment #7)

> For me, if it didnt act like i expected it to act, it should have given me
> an error or something rather than it doing nothing and not telling me why
> its doing nothing. 

Yep, a message would be appropriate.

> Also the label is called 'update the style based on
> selection', its not called 'update the style based on the style of the
> entire paragraph'.

LOL, it was called "Update style" previously ;)
Comment 9 V Stuart Foote 2015-06-09 15:40:03 UTC
There is an issue, and misconceptions, on how a style is applied and how a style can be modified. Bug 89960 -- Suggestion to Change Style Behavior in Relation to Direct Formatting, as well as bug 83726 -- Applying Styles Does Not Consistently Set Character Properties, are the broader case.

However, the .uno command linked to this menu item functions correctly to modify Paragraph style to match selection, but only when selection is a whole paragraph and only when all characters in the paragraph have the same direct formatting.

Regards the the sample file, it contains a paragraph defined in Title Paragraph style so has bold black text, but also with several direct formattings applied to individual characters, e.g. italics and red color--and all as Default Character style. Because the direct formatting are applied to individual characters and not over the entire paragraph they are invalid attributes for defining/modifying a paragraph style.

Even the "New Style from Selection" from the Paragraph styles or the Character styles tabs of the Styles and Formatting content panel on the Sidebar will not work with partial selections from Paragraphs.

The other facet is that Character styles when applied are not merged with Paragraph styles--and Paragraph styles do not influence Character styles--it is one or the other, and you either need to define a new Paragraph style or a new Character file--but must choose. Individual characters or strings can take or define/modify Character styles--but Paragraphs are monolithic.

But, even with a correct understanding of the relationship between component styles, and of direct formatting the behavior of some of the .uno commands are faulty, for example bug 70759 -- Apply Style toolbar "Clear formatting" action does not clear the formatting but sets style "text body".
Comment 10 Cor Nouws 2015-07-02 08:39:43 UTC
(In reply to V Stuart Foote from comment #9)

Thanks for your coherent explanation, Stuart!
Comment 11 Buovjaga 2016-08-05 18:48:01 UTC
*** Bug 91207 has been marked as a duplicate of this bug. ***
Comment 12 Buovjaga 2016-08-05 18:48:16 UTC
*** Bug 92021 has been marked as a duplicate of this bug. ***
Comment 13 QA Administrators 2018-05-15 02:31:13 UTC Comment hidden (obsolete)
Comment 14 Thomas Lendo 2019-01-05 17:59:21 UTC
Still reproducible.

Version: 6.3.0.0.alpha0+
Build-ID: be8897d9c63a77b223a9c0aed1d2eb689e0e0082
CPU-Threads: 4; BS: Linux 4.15; UI-Render: Standard; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-01-02_04:49:04
Comment 15 Xisco Faulí 2020-03-09 13:28:05 UTC
Please add keyword 'needsUXEval' and CC 'libreoffice-ux-advise@lists.freedesktop.org' if input from UX is needed.
Comment 16 QA Administrators 2022-03-10 03:44:17 UTC Comment hidden (obsolete)
Comment 17 QA Administrators 2024-03-10 03:15:01 UTC Comment hidden (obsolete, obsolte)
Comment 18 Cor Nouws 2024-03-20 10:48:38 UTC
cf comment #9, we can simply close as NAB