Bug 168965 - "Comment" paragraph style does not inherit text direction from superordinate object setting
Summary: "Comment" paragraph style does not inherit text direction from superordinate ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-20 09:09 UTC by Farid
Modified: 2025-10-24 08:50 UTC (History)
2 users (show)

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 Farid 2025-10-20 09:09:00 UTC
Description:
Hi, 

"Comment" paragraph style does not inherit text direction from superordinate object setting; The parent is Default Paragraph Style.

thanks


Steps to Reproduce:
To reproduce this bug, create an empty document and set the page style text direction to "Right to Left" and the Default Paragraph Style text direction to "User Superordinate Object Setting". Verify the Comment style "text direction" is "Use Superordinate" and insert a new comment using Alt+Ctrl+M; the direction is not RTL but LTR. If we change the Comment style direction to RTL, it works fine. I edit both english and persian document and want this setting to use superordinate object setting i.e. the Default Paragraph Style.


Actual Results:
When editing an RTL document (e.g. Persian) where the default page style and default paragraph style directions are RTL, if I insert a new comment  the text inside the comment is left to right aligned. 

Expected Results:
When editing an RTL document (e.g. Persian) where the default page style and default paragraph style directions are RTL, if I insert a new comment  the text inside the comment be right to left aligned.


Reproducible: Always


User Profile Reset: No

Additional Info:
Render it RTL
Comment 1 افشین 2025-10-20 09:46:16 UTC
I can confirm this bug. 

Version: 25.8.2.2 (X86_64) / LibreOffice Community
Build ID: 580(Build:2)
CPU threads: 2; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:25.8.2~rc2-0ubuntu0.24.04.1~lo1
Calc: threaded
Comment 2 Regina Henschel 2025-10-21 12:20:10 UTC
The reason is not the paragraph style.

The text direction "User Superordinate Object Setting" becomes draw:writing-mode="page" in file markup. However, the value "page" does not mean, that the paragraph uses the writing-mode specified in the page style. It means that the paragraph uses the writing direction that is defined for the object in which the paragraph is located. In case of a comment this object is a <office:annotation> element in file markup. An <office:annotation> element uses styles of family "graphic". LibreOffice does not use a dedicated style and thus the style:default-style of family "graphic" is used. And that has attribute style:writing-mode="lr-tb".

If I manually set the writing-mode to "page" in the default graphic style, that does not work. Only if I set it to "rl-tb", the text in the annotation gets the correct direction.

So I see these problems here:
(A) A writing-mode "page" in the default graphic style is not resolved to the writing-mode in the page-layout.
(B) A draw:style-name attribute of the <office:annotation> element is ignored. That might be by purpose, because the background color of an annotation depends on whether the author of the annotation is the same user as the current user.
(C) If the writing-mode in the page style is set to "rl-tb", the default graphic style has nevertheless writing mode "lr-tb". This mismatch effects not only annotations but ordinary shapes like rectangles too. Also in ordinary shapes the initial writing-mode is "lr-tb" although the page style has set "rl-tb".
Comment 3 Farid 2025-10-24 07:55:05 UTC
Regina,
thank you for your analysis and look into this issue. What are your proposed solutions to the listed problems?
Comment 4 Regina Henschel 2025-10-24 08:50:23 UTC
(In reply to Farid from comment #3)
> Regina,
> thank you for your analysis and look into this issue. What are your proposed
> solutions to the listed problems?

I have no solution. It is surely a bug, but how to solve it, is a task for a Writer developer. That is not my area.

For you, I suggest, that you create a special RTL document template. For details please ask on https://ask.libreoffice.org/c/english/5. When you mention @Regina there, I will be notified.