Bug 58070 - Switching paragraph styles removes explicit text direction choice
Summary: Switching paragraph styles removes explicit text direction choice
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 96859 (view as bug list)
Depends on:
Blocks: Writer-Styles-Paragraph RTL
  Show dependency treegraph
 
Reported: 2012-12-10 08:07 UTC by Inkbug
Modified: 2024-08-03 09:15 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Downstream attachment (12.50 KB, application/msword)
2013-05-29 11:09 UTC, Chris Peñalver
Details
Manifesting document saved as ODT (10.22 KB, application/vnd.oasis.opendocument.text)
2020-02-29 10:52 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Inkbug 2012-12-10 08:07:33 UTC
Steps to reproduce:
1. Create new paragraph
2. Change paragraph direction to RTL
3. Change paragraph style to Heading 1

Current Behavior:
The paragraph becomes a heading but switches back to LTR direction.

Expected Behavior:
The paragraph becomes a heading but stays RTL.
Comment 1 Chris Peñalver 2013-05-29 11:09:00 UTC
Created attachment 79954 [details]
Downstream attachment
Comment 2 Chris Peñalver 2013-05-29 11:27:54 UTC
As per downstream report https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1093765 :

1) lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:4.0.2-0ubuntu1
  Candidate: 1:4.0.2-0ubuntu1
  Version table:
 *** 1:4.0.2-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ raring/main i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen in Writer via a terminal:
cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1093765/+attachment/3688368/+files/test-bug1093765.doc && lowriter --nologo test-bug1093765.doc

is select all -> change combo box Apply Style from Text Body to Heading 1 and the text style changes, preserving the character order.

4) What happens instead is:
(Example text=) טקסט לדוגמה

changes to:
טקסט לדוגמה (=Example text)

Microsoft Office Professional Plus 2010 Word Version 14.0.6023.1000 (32-bit) changes it to:
=)טקסט לדוגמהExample text(
Comment 3 QA Administrators 2015-03-04 02:21:25 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2015-03-22 14:12:31 UTC
(In reply to Inkbug from comment #0)
> Steps to reproduce:
> 1. Create new paragraph
> 2. Change paragraph direction to RTL
> 3. Change paragraph style to Heading 1
> 
> Current Behavior:
> The paragraph becomes a heading but switches back to LTR direction.
> 
> Expected Behavior:
> The paragraph becomes a heading but stays RTL.

Reproduced.

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI
Comment 5 Buovjaga 2016-01-04 11:39:56 UTC
*** Bug 96859 has been marked as a duplicate of this bug. ***
Comment 6 Omer Zak 2017-11-03 01:31:37 UTC
Still happens in:

Version: 5.4.2.2.0+
Build ID: 1:5.4.2-3~bpo9+1
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.utf8); Calc: group

OS: Debian 64bit Stretch (Debian 9.2, with some backported packages)
Comment 7 Dina 2018-09-17 19:36:11 UTC
(In reply to Inkbug from comment #0)
> Steps to reproduce:
> 1. Create new paragraph
> 2. Change paragraph direction to RTL
> 3. Change paragraph style to Heading 1
> 
> Current Behavior:
> The paragraph becomes a heading but switches back to LTR direction.
> 
> Expected Behavior:
> The paragraph becomes a heading but stays RTL.

Managed to reproduce it by following your instructions on the "Downstream attachment" file, but not on a new document.

Lubuntu 18.04.1 32bit

LibreOffice Version: 6.1.1.2
Build ID: 1:6.1.1~rc2-0ubuntu0.18.04.1~lo3
CPU threads: 1; OS: Linux 4.15; UI render: default; VCL: gtk2; 
Locale: he-IL (en_US.UTF-8); Calc: group threaded
Comment 8 QA Administrators 2019-10-01 03:02:36 UTC Comment hidden (obsolete)
Comment 9 Eyal Rozenberg 2020-02-29 10:52:24 UTC
Created attachment 158272 [details]
Manifesting document saved as ODT

The bug still manifests if we save attachment 79954 [details] as an ODT rather than a DOC file.
Comment 10 Eyal Rozenberg 2020-02-29 10:57:52 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2023-02-16 03:26:01 UTC Comment hidden (obsolete)
Comment 12 Eyal Rozenberg 2023-02-16 16:10:15 UTC
With build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US


I am able to reproduce even on a plain new document. But let me offer more robust reproduction instructions:

1. Create a new Writer document.
2. Set the Default Page Style to LTR.
3. Set the Default Paragraph Style to LTR.
4. Set the Heading 1 paragraph style to LTR.
5. Enter some text (e.g. "hello").
6. Change paragraph direction to RTL
7. Set the paragraph style to Heading 1

The paragraph direction switches to LTR.

However - I am now wondering whether the DF of text direction should really be maintained. When we switch paragraph style, the pre-vspace and post-vspace are reset to the style's defaults, as is the background color and the border. Perhaps the text direction should be reset as well?

Reporter, please opine on this if you're still around - and asking other users as well.
Comment 13 Heiko Tietze 2023-02-21 10:37:25 UTC
Why do you expect attributes to be consistent when switching from one style to another? If your default paragraph uses a (directly applied) italic font style it will be removed when switching to any other style.

We could turn this question around and ask what you expect when switching from one style to another. Meaning whether all or just the different attributes should be overwritten. Let's say the text is Text Body with the special attribute italic (whether set directly or via style modification doesn't matter). Switching to Heading 1 could mean you expect the font size larger and the bold weight to be applied - in addition to the italic weight. This does not solve the use case to explicitly switch off an attribute, eg. H1 in bold but H2 not.

The issue is clearly NAB.
Comment 14 Eyal Rozenberg 2023-02-21 21:14:06 UTC
(In reply to Heiko Tietze from comment #13)
> Why do you expect attributes to be consistent when switching from one style
> to another? If your default paragraph uses a (directly applied) italic font
> style it will be removed when switching to any other style.

Heiko, that's not exactly true: Only if the _entire_ paragraph uses the italic font will it go away. If part of the paragraph is in italic and part of it isn't - that will be preserved through paragraph style change.
Comment 15 Heiko Tietze 2023-02-22 08:04:14 UTC
(In reply to Eyal Rozenberg from comment #14)
> If part of the paragraph is in italic...

...it's not a formatting on the paragraph but at the characters. The Style Inspector shows nicely where the attribute of the selection comes from.

For the topic being discussed here you could switch to indentation, background color, or associated list attributes. You want these settings to switch on/off depending on the chosen paragraph style.
Comment 16 Urmas 2023-02-26 16:18:50 UTC
Italic is a formatting, while text direction is not.
Comment 17 Heiko Tietze 2023-02-27 07:36:32 UTC
(In reply to Urmas from comment #16)
> Italic is a formatting, while text direction is not.

Both are attributes of the paragraph. Clearly NAB.
Comment 18 Chris Peñalver 2023-02-27 11:51:03 UTC
AFAIK, the original reporter's preference wasn't ever designed this way so this is an enhancement request.

Also, nothing changed in:
Version: 7.5.0.3 (AARCH64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 8; OS: Mac OS X 13.1; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Latest Office still behaves the same way as noted in https://bugs.documentfoundation.org/show_bug.cgi?id=58070#c2 :
Microsoft Word for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20278) 64-bit
Comment 19 Urmas 2023-03-07 14:14:27 UTC
The decision to make the text direction a formatting attribute is a LO's idiosyncrasy; the text never changes its direction, it is its immutable semantic property.