Bug 149547 - Writer creates a new character style named "__XXX___invalid" when used style deleted
Summary: Writer creates a new character style named "__XXX___invalid" when used style ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) alpha0+
Hardware: All All
: low minor
Assignee: Not Assigned
Whiteboard: target:7.5.0
Keywords: bibisectRequest
Depends on:
Blocks: Writer-Styles-Character
  Show dependency treegraph
Reported: 2022-06-13 10:26 UTC by phv
Modified: 2023-07-19 20:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

New style appearing from nowhere (15.35 KB, image/png)
2022-06-13 10:26 UTC, phv
New character styles are been created (13.44 KB, application/vnd.oasis.opendocument.text)
2022-06-17 13:05 UTC, phv

Note You need to log in before you can comment on or make changes to this bug.
Description phv 2022-06-13 10:26:07 UTC
Created attachment 180722 [details]
New style appearing from nowhere

A new style has just appeared in my Character Style list but I didn't create it myself, so I ignore the steps to reproduce this bevavior. This bug would originally come from LibreOfficeDev 7.5 version since I was working on it at the time, but the style is still in the list once the document is saved and reopened in LibreOffice 7.3. The document is from LibreOffice (no import from another word processor).

So many questions but I have reason to believe that this behavior is new.

The style is named "__XXX___invalid" and is not attributed to a particular character or font. It can be deleted without any issues. Sorry I don't have more info but maybe this report will tell something to a developer.
Comment 1 phv 2022-06-13 10:36:44 UTC
Okay, I confirm that the issue is related to LibreOfficeDev 7.5 and that the new character style is created when opening the file. The same file opens correctly and without displaying any new style in LibreOffice 7.3.2.
Comment 2 phv 2022-06-13 10:54:37 UTC
Also, after deleting the new style and reopening the document, another new style pops up: "Character_20_style". I try to delete it, but it comes back when I reopen the document. This issue is definitely full of surprises!
Comment 3 Timur 2022-06-14 07:21:59 UTC Comment hidden (obsolete)
Comment 4 phv 2022-06-17 12:59:43 UTC
(In reply to Timur from comment #3)
> Does this happen only with a specific file? Can you attach it, if not
> personal?

I looked a little bit more into the issue and I found that Writer creates the character style named "Character_20_style" for the chapter numbering both in LibreOffice 7.3 and 7.5.

But in LibreOffice 7.5, Writer also creates another new character style named "__XXX___invalid" for the chapter numbering.

Both behavior are coming from the fact the initial character style for the chapter numbering has been deleted, so Writer creates new ones instead of assigning the style named "No Character Style" by default for the outline list.

So there is an initial bug (Writer doesn't reset properly the character style associated to None [it should be "No Character Style"]) that has been around for a while; coupled with a new bug (when None is assigned) that appeared in version 7.5.

Writer should be able to reset a default style without having to recreate another style. This behavior is not comprehensible from user's point of view.
Comment 5 phv 2022-06-17 13:05:04 UTC
Created attachment 180811 [details]
New character styles are been created

Here is a document to test.
- When opening it in LibreOffice 7.3 and 7.4, Writer creates a new style named "Character_20_style"
- When opening in LibreOfficeDev 7.5, Writer creates two new styles, "Character_20_style" and "__XXX___invalid".
Comment 6 Radish 2022-07-09 18:51:05 UTC
I have "Character_20_style" in one of my documents too. However, I am using LibreOffice (Still) x64 on Windows 7 Pro. SP1 x64.

Lord knows how the style got there. If I delete it, save the document, exit Writer then on relaunch of the document there is Character_20_style back again. Most annoying.

Point is this was happening before version
Comment 7 Radish 2022-07-10 10:58:27 UTC
If it is of any help with this I came across a thread at 'Ask LibreOffice' that attempted to deal with the issue of Character_20_style


That thread dates at 2017 so, it would seem, this problem has a long pedigree.
Comment 8 Commit Notification 2022-09-07 14:42:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":


tdf#149547 fix "tdf#75297 sw uno: override default num char style"

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Justin L 2022-09-07 14:52:30 UTC
Comment 8 might fix the creation of __XXX__invalid, but it will have nothing to do with Character_20_style.

Assuming __XXX__invalid is no longer an issue, this bug report should focus on Character_20_style (which I assume is an internal, automatic style).