Bug 100584 - With an RTL sheet, make added sheets RTL as well
Summary: With an RTL sheet, make added sheets RTL as well
Status: NEW
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: Not Assigned
URL:
Whiteboard: target:7.6.0 target:24.2.0 target:7.6...
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-12-26 08:31 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


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.
Comment 15 Stéphane Guillou (stragu) 2023-10-29 15:36:42 UTC
Reopening as I don't see it fixed, but instead think the commit goes the _opposite_ way of what was suggested in comment 9.

- Heiko, I can't reproduce the behaviour you describe in comment 8 and comment 9. Testing in LO 7.5, if I set the locale to Arabic, I can confirm that all new sheets are RTL. This is a good default in my opinion (and maybe the same should happen when using the RTL UI, as suggested by Hossein in comment 7). However, when I add a new sheet "after" the current sheet, the new tab is displayed to the left, which is exactly what you describe as desired (I tested gtk3, kf5 and gen). Can you give steps to reproduce what you saw in attachment 172216 [details]? Are you sure the sheet wasn't added "before"?
- Andreas, can you please check that your patch does what you describe in comment 11? I see it doing the opposite.

Thank you both!
Comment 16 Stéphane Guillou (stragu) 2023-10-29 16:01:12 UTC
Oh I think I see what Andreas fixed:
With RTL UI _but_ the sheet in LTR, the tabs are now ordered RTL (wasn't the case before).
However, we now have what can be perceived as a regression in bug 157784: LTR UI + RTL sheet has LTR tab order.

In any case, we have to sort out the general issue of how RTL sheets and RTL UI influence (or not) the sheet tabs (order and side), in bug 100585.

Keeping this report open for the following issues:
- should using the RTL UI mean all sheets are automatically RTL? (just like for locale)

I think there is agreement here that the current sheet's setting shouldn't influence the newly created sheet.
The better solution is having UI / locale influence it.
Comment 17 Buovjaga 2023-10-29 16:54:06 UTC
(In reply to Stéphane Guillou (stragu) from comment #16)
> Oh I think I see what Andreas fixed:
> With RTL UI _but_ the sheet in LTR, the tabs are now ordered RTL (wasn't the
> case before).
> However, we now have what can be perceived as a regression in bug 157784:
> LTR UI + RTL sheet has LTR tab order.

The change was made per comment 12 and the reporter of bug 157784 does not like it. Not a regression as such.
Comment 18 Buovjaga 2023-10-29 17:03:37 UTC
(In reply to Buovjaga from comment #17)
> (In reply to Stéphane Guillou (stragu) from comment #16)
> > Oh I think I see what Andreas fixed:
> > With RTL UI _but_ the sheet in LTR, the tabs are now ordered RTL (wasn't the
> > case before).
> > However, we now have what can be perceived as a regression in bug 157784:
> > LTR UI + RTL sheet has LTR tab order.
> 
> The change was made per comment 12 and the reporter of bug 157784 does not
> like it. Not a regression as such.

Or maybe I misread it :( I thought it would be about the order of the sheets, but perhaps it was about the *positioning* of the tab bar?!
Comment 19 Eyal Rozenberg 2023-10-29 19:45:06 UTC
(In reply to Stéphane Guillou (stragu) from comment #16)
> Oh I think I see what Andreas fixed:
> With RTL UI _but_ the sheet in LTR, the tabs are now ordered RTL (wasn't the
> case before).
> However, we now have what can be perceived as a regression in bug 157784:
> LTR UI + RTL sheet has LTR tab order.

I'm sorry I didn't notice that is what was changed, because that's really not what (I would say) we want to happen.
Comment 20 Andreas Heinisch 2023-10-29 22:36:37 UTC
Could be fixed using isRTL and changing the file in the commit as prefered by the community.
Comment 21 Andreas Heinisch 2023-10-30 06:48:03 UTC
Imho, the better function is IsEffectiveRTL
Comment 22 Heiko Tietze 2023-10-30 07:48:18 UTC
Let's have the discussion first on bug 157784.
Comment 23 Andreas Heinisch 2023-10-30 19:47:24 UTC
Patch is here: I could not find any other setting then GlobalSettings.

https://gerrit.libreoffice.org/c/core/+/158675

Could anyone test it with a real RTL enviornment? Changing the language did not work for me.
Comment 24 Buovjaga 2023-10-31 08:56:56 UTC
(In reply to Andreas Heinisch from comment #23)
> Patch is here: I could not find any other setting then GlobalSettings.
> 
> https://gerrit.libreoffice.org/c/core/+/158675
> 
> Could anyone test it with a real RTL enviornment? Changing the language did
> not work for me.

Did you test by running with

SAL_RTL_ENABLED=1
Comment 25 Commit Notification 2023-10-31 14:38:21 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

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

tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings

It will be available in 24.2.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.
Comment 26 Commit Notification 2023-10-31 14:40:23 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3be361d00eb1d61543e2c8c6953e63c149fb1eb0

Revert "tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings"

It will be available in 24.2.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.
Comment 27 Commit Notification 2023-10-31 14:52:27 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4f1b3c16f5530a2a190cab07c07c7bf63acf42c7

tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings

It will be available in 24.2.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.
Comment 28 Andreas Heinisch 2023-10-31 14:55:21 UTC
The tab bar's position is now globally determined based on the RTL settings, rather than being individually set for each sheet.
Comment 29 Commit Notification 2023-11-01 04:58:54 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/7a062cdd9b91c577b2296bfe1f81ea78e0b75168

tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings

It will be available in 7.6.3.

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.
Comment 30 Andreas Heinisch 2023-12-21 19:26:31 UTC
Should we revert this fix? This causes to many regressions. Let the sheets jump around.

See Also:	
157961
158552
158768
Comment 31 Commit Notification 2023-12-21 19:33:11 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/19e856aa1ade6686fa495e57386b81cabae47495

Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings"

It will be available in 24.8.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.
Comment 32 Commit Notification 2023-12-21 19:34:16 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3430a2c639a9f714259f9d319515464a653d21ab

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

It will be available in 24.8.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.
Comment 33 ady 2023-12-21 21:52:02 UTC
(In reply to Andreas Heinisch from comment #30)
> Should we revert this fix? This causes to many regressions. Let the sheets
> jump around.
> 

bug 157961
bug 158552
bug 158768

This may sound rude to some readers; please don't take it like that, as it is not my intention.

If anyone cares to actually carefully read those reports, all those consequences were already foreseen and mentioned before, more than once.

The solution is to actually pay attention to what users are reporting.

The Row header and the worksheet tab have been "jumping" for too long. Some old users might already be used to it and even might take advantage of it. But that is because there was no better behavior for such a long time. So users shrug and adapt (but are not happy with the situation).

So, in that regard, the solution *for the worksheet tab* is to provide 2 alternatives for users to choose from: A)leave the old "jumping" behavior, or B)set the side according to UI locale (RTL or LTR).

And what about the Row header? Whichever the location of the first column (Column A), the vertical Row header should always cross the horizontal Column header on the "origin, zero". Whichever the side that "zero" would be.

The patch in comment 25 attempted to put the worksheet tab according to UI RTL or UI LTR, but screwed up the Row header crossing point!

Hopefully this comment will be (carefully) read, with the same sincere and thankful spirit I have when attempting to convey the problemS with these RTL issues. Let's see if we can start over in Bug 157961.
Comment 34 Commit Notification 2023-12-21 22:33:41 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings"

It will be available in 24.2.0.2.

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.
Comment 35 Commit Notification 2023-12-22 11:31:06 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

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

It will be available in 24.2.0.2.

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.
Comment 36 Commit Notification 2023-12-22 19:31:56 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

Revert "tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings"

It will be available in 7.6.5.

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.
Comment 37 Commit Notification 2023-12-26 08:31:35 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/7c10c49309acb2f183ef726283e36044d8f68766

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

It will be available in 7.6.5.

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.