[Bug] [Writer] Wrong underline color when overlapping different types of underline

Hey there,

I recently noticed a bug in LibreOffice Writer : when two different types of underline (e.g. single, double, bold, dotted, dash, etc.) overlap, the second underline will not use the same color as the text.

Before reporting on Bugzilla, I thought I’d check here if this affects other people.

Steps to reproduce :

  1. Start Writer in safe mode
  2. Create a new document
  3. Increase the font size (to make the color difference more obvious)
  4. Write some text (e.g. “This is a test”)
  5. Select the first word (e.g. “This”) and underline it with a single underline (e.g. Ctrl+U)
  6. Select some text overlapping with the first word
    • For instance, select its last letter and the next two words (e.g. “s is a”)
  7. Underline the selection in Bold
    • i.e. click on the Underline icon drop-down button and select Bold in the menu
  8. The bold underline appears with a different color (in my case blue, but sometimes it’s also green) than the text (in my case black, since this is the default color)

I found a workaround : when underlining the overlapping text, if I first underline it with a single underline and then underline it with the other type of underline, then the color remains the same as the text.

To be noted that the bug also occurs when the two underlines are the same type, unless the first underline is a single one (e.g. in the procedure, underline both times in bold and the bug still occurs).

Please find attached the file I created to illustrate this bug, as well as a screenshot and a video of the bug.

writer_bug_underline_overlap.odt (17.0 KB)


writer_bug_underline_overlap

Below are my system details:

Version: 25.2.6.2 (X86_64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 8; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:25.2.6-0ubuntu0.25.04.1
Calc: threaded

Why are you working in “Safe Mode”?

Congratulations! But this is direct formatting.

I tested with character styles and it does not happen. So the “correct” workaround is to work with styles as recommended to achieve predictable and stable formatting.

Nevertheless, it is a bug related to direct formatting and toolbar button usage. Apparently, it affects Font Effects, Underlinig colour (which is changed from Automatic to some random value). Don’t hesitate to report it.

@Hrbrgr Only to show that this bug is not caused by any custom configuration.

@ajlittoz Thanks for the feedback and the recommendation! I confirm this bug doesn’t occur with character styles. It’s indeed related to direct formatting.

I reported it accordingly, see:
https://bugs.documentfoundation.org/show_bug.cgi?id=168690