Bug 146728 - Direct formatting is applied to newly inserted text even if the paragraph previously uses paragraph style without any direct formatting
Summary: Direct formatting is applied to newly inserted text even if the paragraph pre...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Szymon Kłos
Whiteboard: target:7.4.0
Keywords: bibisected, regression
Depends on:
Reported: 2022-01-13 02:43 UTC by Kevin Suo
Modified: 2023-01-21 21:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

testTextStyles.odt (9.83 KB, application/vnd.oasis.opendocument.text)
2022-01-13 02:43 UTC, Kevin Suo

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2022-01-13 02:43:26 UTC
Created attachment 177515 [details]

The attached test doc contains a simple paragraph formatted using the Title paragraph style, without any direct formatting. When I type in a Chinese character within the paragraph, the new typed character will have direct character formatting applied.

Steps to Reproduce:

1. Open the test doc in Writer. Notice that the paragraph has the "Title" paragraph style applied, and there is no direct formatting (which can be observed from the Styles Inspector sidebar deck).

2. Type any Chinese character (e.g. the character 的 which can be typed by hitting the keys "d" and "e" using the ibus-libpinyin input method) anywhere within the paragraph text. (Note: copy-paste from web-browser as unformatted text does not trigger this bug)
--> Bug: the newly typed-in text has direct formatting applied.

3. Change the font size of the Title paragraph style to a smaller size.
--> The font size for the newly typed-in text remains unchanged (due to it was applied direct formatting in step 2). I need to apply "clear direct formatting" to make the font size same as other characters.

Current Result:
See comment "-->" in above step 2.

Expected Result:
When I type-in any text in this paragraph, it should use the Title paragraph style and no new direct character formatting should be created or applied to the newly inserted text.

Version: / LibreOffice Community
Build ID: 8ede76d9accc8e3b1ea2c8e332cbb373a1b4d9cf
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.3-CN
Calc: threaded

Fedora 34, Gnome x11, ibus-libpinyin 1.12.1.
Comment 1 Kevin Suo 2022-01-13 02:46:03 UTC
Bibisected to range: b8e9e1bc7713ac159c3f23f9e4be4ddb656a9d79..8ede76d9accc8e3b1ea2c8e332cbb373a1b4d9cf

8ede76d9accc (lok: IME: directly copy formatting for inserted text, 2021-09-16)
7df324b4561a (lok: IME: preserve formatting when inserting at the end of paragraph, 2021-09-07)
d99c7586edf4 (jsdialog: send full update for autofilter, 2021-09-23)

Adding Szymon Kłos to cc: could you please take a look? Thanks.
Comment 2 Szymon Kłos 2022-01-13 08:53:32 UTC
I know about the issue, I'm working on that already.
Comment 3 Kevin Suo 2022-01-13 09:25:22 UTC
(In reply to Szymon Kłos from comment #2)
Thanks. For bug triaging purpose I mark this as ASSIGNED to you per your comment.
Comment 4 Commit Notification 2022-01-23 18:55:13 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":


tdf#146728 lok: IME: preset formatting in the new paragraph

It will be available in 7.4.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 5 Kevin Suo 2022-01-24 05:03:48 UTC
Verified fixed on master.

As a reminder, this also affects 7.3, thus the patch should also be backported there.
Comment 6 Kevin Suo 2022-09-10 15:20:04 UTC
@Szymon Kłos @Xisco Fauli:

This issue was resolved on 7.4 branch but it still remains in the 7.3 branch. Could you reconsider whether to backport this to 7.3, so that it can be resolved in the upcoming 7.3.7?
Comment 7 Kevin Suo 2022-09-10 15:23:53 UTC
(In reply to Kevin Suo from comment #6)

Backporting to 7.3 should be safe. I noticed on gerrit that this patch was already backported to other branches such as distro/collabora/cp-6.4 and distro/collabora/co-2021, see https://gerrit.libreoffice.org/c/core/+/128832.