Bug 131920 - Full text highlight + shading support
Summary: Full text highlight + shading support
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: DOCX DOC Highlight-Color 143557
  Show dependency treegraph
 
Reported: 2020-04-06 07:24 UTC by Miklos Vajna
Modified: 2022-09-07 09:15 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
1-HighlightedOnly.png (30.70 KB, image/png)
2020-04-10 22:28 UTC, Bart
Details
2-HighlightedAndShaded.png (39.74 KB, image/png)
2020-04-10 22:29 UTC, Bart
Details
Word2002BordersAndShading.png (29.70 KB, image/png)
2020-04-14 23:03 UTC, Bart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Vajna 2020-04-06 07:24:08 UTC
Steps to reproduce the problem:

1) Start Writer, highlight text with a custom color. Something that is not within the few colors Word supports for text highlighting.

2) Save this in a Word format like DOCX.

Actual result: currently this is saved as shading to avoid a data loss.

Expected result: Writer's UI supports both text higlighting and shading, similar to what Word provides.

This is a follow-up bug to 125268, where the data loss part is already solved.
Comment 1 V Stuart Foote 2020-04-06 13:17:21 UTC
as approved by ESC 2020-04-02, => NEW
Comment 2 Bart 2020-04-10 22:25:32 UTC
I am one of those who was surprised that I had selected "Light Yellow 3" in a document, saved it as .doc and to see that the color was changed to "Yellow" after I had reopened it.

So I had a suggestion. Upon request I'm repeating it here. :)

I hope that this suggestion works well for:
- The Libre Office standard user 
- The Libre Office advanced user
- The Microsoft Word user
- The Libre Office developers (last but not least!)

    I'll start with the functional part (= what the user sees).

When clicking 
   "Highlight Color", 
in LibreOffice, the user first gets a 15-color palette. 
   (This is "1-HighlightedOnly.png")
These Highlighted Colors are supported by other word processors, e.g. Microsoft Word.

Because most users initially only see the Highlighted Colors, and because of the sentence "Usually supported by other word processors", I hope to persuade these standard users to choose a Highlighted Color. That improves compatibility with Word documents and the user should have less surprises.

After clicking button
   "More Colors (= Shaded Colors)"
the dropdown expands and the user will also see a 120-color palette with "Shaded Colors".
   (This is "2-HighlightedAndShaded.png")

The sentences
   "Usually supported by other word processors" 
and 
   "Other word processors may not support Shaded 
    Colors, OR they may support them differently.", 
both have a nice undertone. To me they express that LibreOffice is of a higher technical level, because LibreOffice takes into account that other word processors may work differently. Very classy. ;)

Advanced users may choose a Shaded Color, but I also expect them to be more aware of compatibility topics.

Even if Highlighted Colors and Shaded Colors are stored the same way in the document itself, I hope that users are better aware of the difference between the two, simply because of showing that difference.

If the user selects a piece of text that already had a "Highlighted Color" and then clicks button "Highlight Color", it may be logical to show the dropdown with only Highlighted Colors and pre-select that Highlighted Color in the palette.
   (This is again "1-HighlightedOnly.png")

If the user selects a piece of text that already had a "Shaded Color" and then clicks button "Highlight Color", it may be logical to show the dropdown with both Highlighted and Shaded Colors and pre-select that Shaded Color in the palette.
   (This is again "2-HighlightedAndShaded.png")

When clicking buttons "More Info" the user can get an explanation and warnings about exporting and compatibility. The text might also explain how to remove Shaded Colors in Word. I'm not sure if that's the responsibility of Libre Office, but if this information is added, there may be less questions on forums, and that may prevent that users move away from Libre Office. ;) The text on the buttons could also be "? Help" instead of "More Info".

    Then there's the technical part (= what developers see).

If the user selected a color from the "Highlighted Color" palette, then that color is stored in the document as Highlighted (and supported by Word).

If the user selected a color from the "Shaded Color" palette, then that color is stored as Shaded (also supported by Word, but less easy to change there).

I think that under:
   "Tools -> Options -> Load/Save -> Microsoft Office" 
the option:
   "Character Highlighting, Export As Highlighting / Shading" 
is no longer needed.

As a user, I am even happier with less options under:
   "Tools -> Options -> etc.",
because I never know if an option is found there, and if it's there, I never know where to find it or what the name is.

I suspect there's backward compatibility with LibreOffice version 6.4 and earlier, but if I'm wrong, I'm happy to hear.

This suggestion is not "carved in stone". It's a suggestion, no more, no less. I don't know how LibreOffice works internally, or how .doc and .docx documents are organized internally, so maybe this solution still needs to be polished.

Thanks again to all the developers for all the time and effort they put into developing LibreOffice.

PS:

I also hope that implementing this suggestion will lead to less confused users, that less confused users will lead to less bug reports, and that less bug reports will lead to less work for developers. :) :) :)

I wondered if it would be good to check the "Highlighted Colors" that Google Docs and Apple Pages offer, besides to Microsoft Word. On second thought, Google Docs and Apple Pages also have to figure out how to deal with Highlighted versus Shaded when exporting to Word format, just like we have to figure it out.

Nevertheless, and just to make sure that we don't have to go back to this topic later, I would still appreciate to know what the options are that Google Docs, Apple Pages, and maybe other word processors offer. Are there any users of Google Docs or Apple Pages here, willing to take a look?

Initially I tried to adapt to the current terminology. In LibreOffice I found "Highlight Color" , "Highlighting" and "Shading", but after a while I was more and more going towards "Highlighted" and "Shaded".
Comment 3 Bart 2020-04-10 22:28:01 UTC
Created attachment 159483 [details]
1-HighlightedOnly.png

This is the pulldown that the user gets after clicking button "Highlight Color" in the button bar.
Comment 4 Bart 2020-04-10 22:29:48 UTC
Created attachment 159484 [details]
2-HighlightedAndShaded.png

This is the pulldown that the users gets after clicking "More Colors (= Shaded Colors)".
Comment 5 Mike Kaganski 2020-04-12 06:30:43 UTC
(In reply to Bart from comment #2)

+1
Comment 6 Heiko Tietze 2020-04-14 10:12:24 UTC
(In reply to Bart from comment #2)
> I am one of those who was surprised that I had selected "Light Yellow 3" in
> a document, saved it as .doc and to see that the color was changed to
> "Yellow" after I had reopened it.

Which won't happen again. Your proposal looks like a tremendous amount of work to fix the issues of Microsoft. Do you think it's needed given the Theme Shading is not that hard to find in MSO?
Comment 7 Bart 2020-04-14 23:00:28 UTC
(In reply to Heiko Tietze from comment #6)
> Which won't happen again. Your proposal looks like a tremendous amount of
> work to fix the issues of Microsoft. Do you think it's needed given the
> Theme Shading is not that hard to find in MSO?
Heiko, you are right. I see that this is a Microsoft issue. When I look into it deeper, Microsoft is confusing me more than once. 

But for LibreOffice, maybe that's also a nice opportunity to do better, and to persuade some users over? ;-)

My hope as a user now, is that the LibreOffice help text can explain what I need to do for a specific result. I'm not here to cause a lot of work for others. If that's welcome and needed, I'll be happy to make a draft. I don't know what the help texts contains now, because I can't see them. I'm super sorry for writing this, but please check Bug 131988. If I made a mistake there, I'll be happy to hear. (PS: I wish I had not used "crystal clear" there. It's too strong.)

   I wonder if the next part is useful information for
   a long-term solution and maybe for help texts as well:

I rebooted my computer and ran Windows.

I first tried Word 2002.

In Word 2002 shading is found under "Format -> Borders and Shading -> Shading". (I added screen copy "Word2002BordersAndShading.png") For me, "Borders and Shading" is typical for tables and cells and I didn't have any of those in my document. That's why I initially ignored "Borders and Shading". That again is why I couldn't find "Shading" for regular text. (That's confusing nr. I, not just for me, but for other users of Word 2002 as well. Am I right that  users now have to pay monthly or yearly for Office 365? That's why I expect many users to stick to the version that they have, OR to move to LibreOffice.)

Then I started Word 2010.

In Word 2010 "Highlight" is found in the "Font" group. But to my surprise, "Shading" is found in the "Paragraph" group. (Confusing nr. II) (Heiko, you already showed this, thanks.)

The balloon text calls it "Shading", but just above the color palette I see "Theme Colors". They're using different terminology for the same thing? (That's confusing nr. III)

Further down in the box I see "Standard" colors. Is that different terminology for something that's found elsewhere, or is that something new? Or do "Shaded" colors fall apart into "Theme" colors and "Standard" colors? (Confusing nr. IV)

I also found that "Shading" colors (= "Theme Colors" ?) are updated in Word when switching to a different theme, while "Highlighting" colors are not updated when switching to another theme. Maybe this is why "Highlight" is found in the "Font" group, while "Shading" is found in the "Paragraph" group?

(All these questions are rhetorical, feel free to ignore them. ;-) )

Apply shading to words or paragraphs :
https://support.office.com/en-us/article/Apply-shading-to-words-or-paragraphs-2020D0E0-F99E-4D53-A895-009077CBCFDA

I should also have MS Office 97, Office 2000, Office 2003, Office 2006, Office 2007 and Office 2013. I'm perfectly willing to check those too, but only if we need to know how these versions work. Installing several versions side-by-side doesn't always work.

I would like to start to make a summary of all the terminology that I just found, and describe what each term means. That is, if that hasn't been done yet.

Most of all I hope that this last part is useful information for a longer-term solution. ;-)
Comment 8 Bart 2020-04-14 23:03:15 UTC
Created attachment 159568 [details]
Word2002BordersAndShading.png

In Word 2002, "Shaded" text is located under "Format -> Borders and Shading -> Shading".
Comment 9 Heiko Tietze 2020-04-17 14:26:53 UTC
(In reply to Bart from comment #7)
> But for LibreOffice, maybe that's also a nice opportunity to do better, and
> to persuade some users over? ;-)

Many thanks for your detailed workflow description. This is very helpful for usability. About MSO2002 I'm not so sure if we should be guided by a 20 year old software. But I fully sign you quoted sentence. Let's see if a developer picks this topic.
Comment 11 Justin L 2020-11-26 05:38:54 UTC
(In reply to Heiko Tietze from comment #6)
> (In reply to Bart from comment #2) who was suggesting the compatibility
> palette be "encouraged" for character highlighting, and selective export of
> highlight-compatible colours as highlight, and the rest as shading.
> 
> Your proposal looks like a tremendous amount of work to fix Microsoft's issues.
>  Do you think it's needed given that MSO's Theme Shading is not hard to find?

I had initially come to the same conclusion as Bart. However, as Heiko notes, that will be a tremendous amount of work since the current PaletteManager has no capabilities for "special use cases". The most recent palette used is saved in user settings and used for EVERY use case.

Also, Heiko is right about modern MS Word's shading tool being easy to find. At first I compared shading to a permanent marker used on a whiteboard - really hard to remove. But today, a better analogy is the difference between a pencil/eraser and a pen/white-out.

Our current support for import/export of highlight works for the practical cases, but isn't complete enough to handle the theoretical documentation. I mean, MS Word doesn't allow the user to add highlighting to paragraph styles, so the fact that we don't import or export "none" highlighting doesn't really matter.

But it DOES matter if we start exporting colours as highlight in styles. So Bart's idea of exporting the 15 colours as highlight is simple enough on the surface, but it leads to a lot of other development work to support styles properly. (It would be easy enough to do if it only applied to direct formatting.)  See bug 137683 and bug 138345.

So my conclusion after working on various parts of this for a week is that it is not beneficial to export the 15 colours as highlight with the rest as shading - just export them all as shading. Otherwise LibreOffice edits become inconsistent to remove in MS Word.
Comment 12 Justin L 2020-11-26 05:47:19 UTC
LibreOffice is able to recognize and clear highlighting in character properties, but it is missing that ability in paragraph-style's highlighting tab. Proposed fix at https://gerrit.libreoffice.org/c/core/+/106323.
Comment 13 Commit Notification 2020-11-26 08:09:56 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/04df1e271b64109631c6746f2e735dfc4f5b7d3a

tdf#131920 sw UI Char highlight: editing via Para-style highlight tab

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 14 Justin L 2020-12-02 11:49:27 UTC
(In reply to Justin L from comment #11)
> Our current support for import/export of highlight works for the practical
> cases, but isn't complete enough to handle the theoretical documentation.

In case things ever flip-flop back to "highlight by default", then it might be wise to implement https://gerrit.libreoffice.org/c/core/+/106587, but for now I'll just leave things as they are - so that someone who really wants to export as HIGHLIGHT can't complain that it doesn't work the same as before.

Char highlight: no export to para-style

Highlight really doesn't benefit paragraph styles because:

1a.) During LO design, a character style can override a
paragraph style. If the paragraph style is exported
as w:highlight, then the character style would not
be able to affect it any more.
[Note: MS Word doesn't allow highlight in character styles.]
1b.) MS Word's style UI has no ability to change whatever
we set here: either as a highlight or a shading.
1c.) Exporting COL_AUTO as shade allows both char-style
and para-style charBackground to be cancelled.
1d.) Serious colour degrading happens with highlight,
which is even more glaring when it affects an entire para.

(The only reason to export paragraph styles as highlight
is so that MS Word can cancel it with direct-formatting highlight.
That loses out amongst all the other considerations IMHO.
Plus at a paragraph level, it should be natural for MS Word
users to look for the paragraph tools to remove - which is
where shading is found...)

So never export the character background as w:highlight,
but always as w:shd for paragraph styles.

2.) The only time a COL_AUTO is used is to cancel
style-assigned values. So with both paragraph and
character styles using shading, COL_AUTO also needs to
be exported as w:shd. It never makes sense to export
it as w:highlight (unless it was imported, but then
it wouldn't be a RES_CHRATR_BACKGROUND).
Comment 15 Justin L 2020-12-10 13:47:02 UTC
(In reply to Justin L from comment #11)
> Our current support for import/export of highlight works for the practical
> cases, but isn't complete enough to handle the theoretical documentation. I
> mean, MS Word doesn't allow the user to add highlighting to paragraph
> styles, so the fact that we don't import or export "none" highlighting
> doesn't really matter.
This is now fixed. We do export and import NONE highlighting now in 7.2.
See bug 137683 and bug 138345.

At this point, I think the importance of this bug is very low. The only thing I know of that cannot be done easily is to assign a new highlight as a direct character property.
Comment 16 Gerald Pfeifer 2020-12-10 17:41:27 UTC
(In reply to Justin L from comment #15)
> This is now fixed. We do export and import NONE highlighting now in 7.2.
> See bug 137683 and bug 138345.

Cool, thank you, Justin!

I'm wondering, is bug 96061 essentially the same,
just for Impress/PPTX rather than Writer/DOCX?