Created attachment 41302 [details] Sample output from Excel and LibreOffice Currently when text is entered into an empty cell, it is aligned to the left of the cell. This is correct for text in Left to Right (LTR) languages such as English, but wrong for text in Right to Left (RTL) languages such as Hebrew. The alignment of text should be inferred from the directionality of the entered text, specifically from the directionality of the first character (as text may contain a mix of RTL and LTR characters). As RTL text is mis-aligned by default, users need to manually correct the alignment of all affected cells. It's of course possible to set the alignment of all cells to the Right, but then cells containing LTR text must be manually corrected. For reference, Excel does align the text correctly. Eyal.
This is http://www.openoffice.org/issues/show_bug.cgi?id=72028 It also has a patch upstream, but no progress since 2007.
Kohei: Can you please review the patch from the OOo bugzilla, and apply if OK?
Hmm.... I don't think that patch is the right approach, because that would only work when the system locale is RTL, not when the sheet is set to RTL (cf. Format - Sheet - Right-to-Left). Also, that would set the horizontal alignment for the default cell style to right. But what I *think* we need to do is to render text right-aligned when * the text direction of the sheet is right-to-left, and * the horizontal alignment is set to 'Default'.
Eyal, could you attach a small sample document with some RTL text in a cell? Thanks.
The sheet direction should not determine the alignment. Even when the sheet is RTL, many cells still contain left-to-right values such as numbers, Latin text, email addresses, etc. I suggest to align text as follows: * When horizontal alignment is default - * If the first char is RTL (eg. Hebrew letter) - align to right. * Otherwise (eg. English letter, digit) - align to left. I've attached a file with both English and Hebrew text. Note that you need to have support for complex scripts and/or RTL langauges enabled in your operating system. Eyal
Created attachment 41360 [details] Calc sheet with both LTR and RTL text
I'd like to take a look at this for 3.5 if possible.
Hopefully I got it right. http://cgit.freedesktop.org/libreoffice/core/commit/?id=66778dd58d69426d527edd6ea5d847ce62c950ac The fix landed on master and libreoffice-3-5 branch. 3.5 Beta2 will have the fix incorporated.
Verified in 3.5.0 beta2. Thanks for the fix (:
Created attachment 91895 [details] still the same problem if the tab is rtl
change status based on comment 10
Abdulaziz A Alayed committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f08c1edc0a99e0c29fb1614162d3e88c5660e092 fdo#32530 calc:alignment depend on 1st char direct The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Please do not reopen such an old bug report. Create a new one and work there please.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c6d5433c673f592c3fda4270df66fff6c667d021 Revert "fdo#32530 calc:alignment depend on 1st char direct" The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
For the records, the follow-up appears to be bug 73588 (fixed).