Bug 100584 - With an RTL sheet, make added sheets RTL as well
Summary: With an RTL sheet, make added sheets RTL as well
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.3.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.6.0
Keywords: text:rtl
Depends on:
Blocks: Sheet User-Locale RTL-UI
  Show dependency treegraph
 
Reported: 2016-06-24 11:06 UTC by safa alfulaij
Modified: 2023-01-24 08:05 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Screenshot (8.97 KB, image/png)
2021-05-21 07:08 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description safa alfulaij 2016-06-24 11:06:18 UTC
When the original sheet direction is RTL, it's better to keep all the new added sheets as RTL, because it's annoying that I'm working with a RTL document for all the sheets and have to change the direction for each sheet manually. Especially if I'm working with LO translated to a RTL language (Like Arabic).
Comment 1 Buovjaga 2016-06-26 13:21:59 UTC
Yep.
Comment 2 safa alfulaij 2016-07-08 03:58:22 UTC
Just wanted to add that it seems LO determines the direction for new added tabs from the locale. It should detects it just for the first tab and then base the direction of others on it.
Comment 3 Yousuf Philips (jay) (retired) 2017-10-14 14:30:19 UTC
(In reply to safa alfulaij from comment #2)
> Just wanted to add that it seems LO determines the direction for new added
> tabs from the locale. It should detects it just for the first tab and then
> base the direction of others on it.

Heiko, Stuart: If a user sets sheet 1 to RTL, should it always use the first sheet text direction when it inserts additional sheets, or should it use the sheet text direction of the current sheet in the inserted sheet.

Eike: Is there a spreadsheet-level text direction setting being set to RTL when a spreadsheet is created using an RTL user locale? If so, even if a user is running a LTR user locale and opened a spreadsheet saved using an RTL user locale, adding additional sheets should still be in RTL, correct?
Comment 4 Heiko Tietze 2017-10-14 16:55:49 UTC
Started with the idea that when the regional setting is RTL, new sheets should be like that. This means that if you edit an English document you will also start with RTL when adding a new sheet in this English document. Not the best solution. Ideally, new documents follow the regional settings and existing documents what has been defined when created. And we need means to change this so that users in the Emirates, for example, create a new document in RTL but set the 'language' (or whatever) to LTR.
Comment 5 Omer Zak 2017-11-12 14:30:45 UTC
Still happens in:

Version: 6.0.0.0.alpha1+
Build ID: 5d12237d79f289a1dcf8e07aa03df329e136f078
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.utf8); Calc: group

OS: Debian 64bit Stretch (Debian 9.2, with some backported packages)
Comment 6 Heiko Tietze 2021-05-18 10:36:12 UTC
Hossein, what do you think? Making the sheet direction depending on first sheet sounds weird to me since first (or initial) sheet settings can change later. My take is WF and let Tools > Options > Locale Settings control LTR/RTL.
Comment 7 Hossein 2021-05-20 21:18:41 UTC
(In reply to Heiko Tietze from comment #6)
> Hossein, what do you think? Making the sheet direction depending on first
> sheet sounds weird to me since first (or initial) sheet settings can change
> later. My take is WF and let Tools > Options > Locale Settings control
> LTR/RTL.

(In reply to Heiko Tietze from comment #6)
> Hossein, what do you think? Making the sheet direction depending on first
> sheet sounds weird to me since first (or initial) sheet settings can change
> later. My take is WF and let Tools > Options > Locale Settings control
> LTR/RTL.

I think it is better to consider instead the UI direction (e.g. using SAL_RTL_ENABLED=1 or using RTL language for the UI).

This is also the default behavior in MS Excel. For example, if you use Persian or Arabic for the UI language, the spreadsheet default direction would be RTL unless you change the default direction in the options.

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_win10-mso_o365b/excel-direction-and-language/0b3913a8-872a-44bb-ba81-333fbd3aaabc

This behavior becomes easier for the user, with the help of the visible button in the toolbar which enables the user to see the sheet direction and change it easily. I couldn't find a comparable button in LibreOffice.

There are rare situations where a user uses different languages for the creation of several mixed RTL/LTR sheet spreadsheets, and in fact these use cases can be handled with the help of a visible toolbar button, as described before.

And at last, a dedicated option for the sheet direction in the settings can help users who work with the sheet direction other than the UI language default direction. This is specially helpful for the languages with incomplete LO UI translation.
Comment 8 Heiko Tietze 2021-05-21 07:06:34 UTC
If I set Tools > Options > Language > Locale to Arabic (or any other RTL lang), new spreadsheets will be RTL meaning A starts at right, the statusbar's controls are right aligned etc. New sheets.... oh wait a second! I believe this is not about the whole document but where Sheet2 is added after Sheet1 - currently left-of which is LTR'ish. 

Quite old ticket and I'm afraid Safa will not verify this. Adjusting the summary a bit - please revert if I'm wrong.
Comment 9 Heiko Tietze 2021-05-21 07:08:48 UTC
Created attachment 172216 [details]
Screenshot

The tab Sheet2 should be left of Sheet1.
Comment 10 Andreas Heinisch 2023-01-20 17:56:50 UTC
Proposed patch: https://gerrit.libreoffice.org/c/core/+/145765

This only displays the sheets in the order: Sheet1, Sheet2, Sheet3

Should we check, if one sheet is RTL, than all sheets should be rearranged in the tab bar on the right and side?
Comment 11 Andreas Heinisch 2023-01-20 17:59:53 UTC
Sry of course: Sheet3, Sheet2, Sheet1
Comment 12 Eike Rathke 2023-01-20 18:25:33 UTC
(In reply to Andreas Heinisch from comment #10)
> Should we check, if one sheet is RTL, than all sheets should be rearranged
> in the tab bar on the right and side?
I don't think so. Regarding a sheet as a part of document content, I don't see a reason why the UI sheet tab bar should switch to RTL just because one of the sheets is RTL. I'd do it only if all are RTL, if at all.
Comment 13 Andreas Heinisch 2023-01-23 07:34:49 UTC
Imho, this ticket is about changing the order of appearence of the worksheets. Maybe we should file a follow-up ticket in order to decide if all the sheets should be arranged at the right hand side.
Comment 14 Commit Notification 2023-01-24 08:04:24 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/be86c8f2432623fdb8ed4f22ca08c35121fd8bec

tdf#100584 - Arrange sheets in the tab bar depending on the RTL settings

It will be available in 7.6.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.