Bug 140521 - FORMATTING: style applied direct formatting to all text typed in place of old one (without delete)
Summary: FORMATTING: style applied direct formatting to all text typed in place of old...
Status: RESOLVED DUPLICATE of bug 134426
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All Windows (All)
: medium normal
Assignee: Marti
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks:
 
Reported: 2021-02-18 21:37 UTC by Marti
Modified: 2021-02-21 19:30 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
testcase of the bug, with instructions to reproduce it (23.67 KB, application/vnd.oasis.opendocument.text)
2021-02-20 12:29 UTC, Marti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marti 2021-02-18 21:37:49 UTC
Hi everyone,

this is the first time I report a bug. Please don't hesitate to ask for clarification in case I don't express myself with the proper terms.

I found the bug on several versions of LibreOffice, specifically 6.4.4.2, 7.0.4.2 and also 7.1.0 which by the way I used to understand how the bug worked. I could replicate the bug on two completely independent machines, both running Windows 10 x64. I don't know whether the bug is present also in other OS. I also tried to do the same with OpenOffice on my machine, but OpenOffice worked fine, so I think we can totally exclude coincidences or some peculiar fault of my machine.

It works this way: when you select a portion of text that you have written in a certain style, be it just a word or a whole paragraph, and then directly type in the new text you want to have without deleting the old one first, LibreOffice applies direct formatting to the new text. Meaning: the new text appears to be in the same style as the old one, but all its characteristics (ok to be fair I tried with only some characteristics, like font and line spacing, but I think it's fair to assume it works for everything) are registered as direct formatting rather than simply paragraph style or character style.

How to replicate: type a text. Any text, in a certain paragraph style, for example you could have a paragraph style with font Times New Roman bold. Now select a part of the text, type in something else WITHOUT DELETING THE OLD ONE FIRST, then change the paragraph style. For example, try changing the font style to italic instead. Now you'll see that the new text you typed in keeps the bold, registered as direct formatting and not style formatting.

This can wreak absolute havoc on a document, especially if it's a long one, and especially if you relied on styles to format it, and I love LibreOffice and I would love to see it fixed. :)

I would attach a document, and I can do it if somebody thinks it's necessary, but it's a bug that I believe is best "seen in action"; if I send you a document with some direct formatting in it I don't think it would be very helpful for you to understand how the direct formatting got there.

As for version 7.1.0: it's very helpful to see what's going on! Download the version, go to Tools-->Options-->Advanced and check "Enable experimental features". Now you'll have the style inspector enabled (right bar, under Navigator. Same bar where you can access the styles). This means you can see the bug happening in real time. Have the style inspector open, and do the text substitution as I described: where first there were only Paragraph Styles or Character Styles, you'll suddenly see Direct Formatting too!

Workaround for the bug: delete the text first, then type in the new one. Still bothersome though, especially if you have no idea that the bug exists in the first place.
Comment 1 Timur 2021-02-20 09:37:09 UTC
It's always better to attach minimal sample, where issue can be visually seen, just put all steps inside. 
And please search for existing bugs, both closed and open.
Comment 2 Marti 2021-02-20 12:29:10 UTC
Created attachment 169917 [details]
testcase of the bug, with instructions to reproduce it

Follow the instructions in the document to see the bug in action for yourself. You can also see the effects of the bug in the document itself.
Comment 3 Marti 2021-02-20 12:31:37 UTC
Ok I just created a sample. I tried looking for the bug yes, but it doesn't seem anybody reported this before. I did find somebody though on the forum who seemed to be dealing with the same problem, probably without realizing.
https://superuser.com/questions/1591427/disable-direct-formatting-in-libreoffice-writer
Comment 4 David 2021-02-20 21:38:31 UTC
Yes, I can confirm this problem.  It is very irritating if you re-type something and then later change a style setting, only to find out after you sent the document that not everything got changed according to the style because what you re-typed was set to direct formatting!
Comment 5 Timur 2021-02-21 19:00:27 UTC
No repro OO and 6.2.8, repro 6.4.0 and 7.2+ so it can be called regression. 
Reproduced somewhat different (previous italic remains, new bold added), for typing and after space, not after delete and type.

<style:style style:name="T2" style:family="text">
<style:text-properties fo:font-style="italic" fo:font-weight="normal"/>
<text:p text:style-name="P4">7) text text <text:span text:style-name="T2">new text</text:span>
Comment 6 Timur 2021-02-21 19:30:30 UTC
This started in 6.3. Looks duplicate.

*** This bug has been marked as a duplicate of bug 134426 ***