Bug 166345 - LibreOffice Writer creates unwanted text portions when typing
Summary: LibreOffice Writer creates unwanted text portions when typing
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: IA64 (Itanium) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-25 19:09 UTC by Stephan Poirier
Modified: 2025-06-23 07:02 UTC (History)
0 users

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 Stephan Poirier 2025-04-25 19:09:01 UTC
Description:
In LibreOffice Writer, newly typed text within an existing paragraph automatically creates a new text portion with a different CharAutoStyleName identifier and a new Rsid, even when no visible formatting changes occur. This happens whether I'm using the default style (for both and/or alternatively paragraphs and characters) or if I'm using one of my own.  This also happens either with a new fresh document or one that I have used and edited across multiples version of OpenOffice/LibreOffice over the years.

Steps to Reproduce:
1. Open LibreOffice Writer and create a new document (ODT format).

2. Define a custom paragraph style (e.g., "MyParaStyle") and character style (e.g., "MyCharStyle").

3. Apply "MyParaStyle" to the entire paragraph and "MyCharStyle" to the text.

4. Type some text normally.  Everything remains in a single text portion, and CharAutoStyleName stays "0".

5. Click inside the paragraph and type additional text within an existing sentence.

6. Fork :
   a) Without saving and reopening the document
   b) With saving and reopening the document

Actual Results:
Fork a)
LibreOffice splits the paragraph into separate text portions, assigning different Rsid and CharAutoStyleName identifiers for new input, even when formatting remains unchanged.

Although a style has been applied to every paragraphs and characters, CharAutoStyleName will stays at "0" on every paragraphs.  If you return back into your text and type something new within the text, LibreOffice will split that paragraph into separate text portions, assigning a different CharAutoStyleName identifiers with different Rsid for that new input, even when formatting remains unchanged.

Fork b)
Upon reopening, all previously unified portions (originally CharAutoStyleName "0") that was set to MyParaStyle and MyCharStyle are now reassigned a new hex identifier, while the newly typed text retains its own separate CharAutoStyleName hex ID and own Rsid.

Upon opening, if no style were applied (because I've tested that one too), the same behavior happens, although this time, the CharAutoStyleName will remains to "0" and new typed text within it will holds its hex CharAutoStyleName ID with its previous Rsid.

Occurs in Safe Mode, meaning it’s unrelated to user settings or extensions.

Disabling AutoCorrect and Formatting Aids does not resolve the issue.

Changing keyboard layouts does not affect the behavior.

Changing user-settings and turning "Apply user data" off didn't change anything.

The issue persists across different LibreOffice versions.  As far as I know, I never noticed if it has ever happened in OpenOffice.

Pasting plain text does not trigger the issue, neither inserting text via special characters.  It retains the existing CharAutoStyleName, suggesting the problem might be tied to live typing input.

Expected Results:
LibreOffice should not create a new text portion when typing within an existing paragraph unless there is an explicit formatting change, or a user tracking change (although this creates new paragraph, not text portions). Additionally, upon reopening the document, previously unified portions should retain their original identifier rather than being reassigned a new hex ID.



Reproducible: Always


User Profile Reset: Yes

Additional Info:
This is annoying because I've made a macro that runs through over 5000 pages of documents filled with paragraphs and text portions and this bugs (is it actually a bug?) causes me lots of trouble and it causes my macro to be totally inefficient since it has to compare whether if there's an actual change or not between every single text portions and then reassemble the complete paragraph prior to work on it, on every paragraph loop, on every documents.  My code is well-written and optimized and that's 30mins of unwanted time that I have to go with every single time I run my macro.
Comment 1 Mike Kaganski 2025-04-25 19:26:31 UTC
This is not a bug. The rsid helps in comparing versions of the document (especially useful when there is no change tracking); and its creation is controlled by Options->Writer->Comparison->Random number to improve accuracy of document comparison. Note that disabling its generation there does not remove existing rsid spans; to remove those, you would have to save the document (once) as ODF non-extended (since the rsid is an ODF extension, it would be dropped in that format - as well as other ODF extensions possibly present in the document). The save format is controlled in Options->Load/Save->General.
Comment 2 Stephan Poirier 2025-04-25 20:45:41 UTC
Okay, I  get that.  So how I get rid of the problem I've mentioned about Text Portions being created as soon as I type back inside the same paragraph I was currently writing (without saving, closing and reopening my odf)?  I don't understand why it does happen.  Is there a workaround?  It renders working inside the paragraphs structure very complicated when building a macro since there's no WYSIWYG and I have to compare every single properties but the CharAutoStyleName  and the Rsid to reassemble the paragraph back in one single text portion.  Thanks for your help.