Apache OpenOffice (AOO) Bugzilla – Issue 72028
Align Calc cells to right for Hebrew
Last modified: 2017-05-20 11:11:21 UTC
In Hebrew OO, Calc cells should be aligned right by default. I'm attaching a patch which does this for Hebrew. farzanehs, would this be desirable for Persian as well? I don't know who to cc to ask whether this is the case for Arabic.
Created attachment 40940 [details] For Hebrew, align Calc cells to right in the default style
Hi Niklas, please have a look at this one and adjust target as needed. Frank
ayaniger, this would be the case for Persian as well. In fact, you either input text which should be aligned right, or input number which is best aligned right so that the digits of the same decimal value are aligned in the same column.
Unlike the font (and height) items, ATTR_HOR_JUSTIFY affects all cells. That would mean, if the user has selected Hebrew as CTL language, but wants to create an English document, they would still get the right-alignment. That's not how the CTL language selection is supposed to behave.
ayaniger->nn: I see what you mean. A Western user would not expect the default alignment to be "right", just because the CTL language is set to Hebrew or Persian. However, a Hebrew-speaking user would indeed expect the default alignment to be "right". Perhaps then it would be better to check: if( Application::GetSettings().GetLayoutRTL() ) instead of checking the eCtl variable. What do you think?
Sorry about the delay. A few points. First: Are you confident that right-to-left users will accept the changed default as a solution, or would they still miss the automatic distinction (based on text content)? Assuming that the default is enough: Do we also want it when importing files like text or HTML (where the filters don't change the default). For the right-to-left layout of sheets, we don't do that - only in a new, empty document the existing sheets are right-to-left based on locale settings. Finally, a smaller technical detail: Currently, we use Application::GetSettings().GetLayoutRTL() for UI elements, and ScGlobal::IsSystemRTL() for document defaults (so far, default sheet layout and text direction in page style). Following this, it should be ScGlobal::IsSystemRTL() in this case.
I think that as a default, right-alignment would be preferable to automatic, since automatic alignment based on text content sometimes has undesirable results. However, it would be very helpful for Excel import if automatic alignment existed as an option. Currently, I use a very ugly patch which examines each cell when importing, and changes the alignment of each "Context" cell to right-aligned, if that cell begins in Hebrew. I posted this patch to Issue 37905. I think that I've since revised it. If there was a "Context" option in OOo, the patch would be unnecessary, since Excel "Context" would be converted to OOo "Context". Additionally, many Excel users are used to this option, and would prefer not to be forced to give it up. However, we would not want it when importing text or HTML files. Thanks for the tip about ScGlobal::IsSystemRTL(). One other point: I want to keep the default text direction as left-to-right, since RTL text direction causes a mess if you try to type a formula like “=SUM(A1:A3)”.
Created attachment 45153 [details] suggestion
So, would something like the new attachment work for you?
The patch is good, but I'm adding code to make the text direction LTR, so that RTL users can enter formulas easily.
Created attachment 45181 [details] Same as above, only LTR text-direction added
The default for ATTR_WRITINGDIR is to use the value from the page style, and in the page style it is already locale-dependent (see ScStyleSheet::GetItemSet). There's no point in overriding this again with the view. Also, are you sure that the default should be LTR, or is some special handling for formulas needed? That should be a separate issue.
See http://www.openoffice.org/issues/show_bug.cgi?id=77928 regarding formulas in RTL.
retarget 2.x -> 3.x
Any news?
I'm adding this comment to all open issues with Issue Type == PATCH. We have 220 such issues, many of them quite old. I apologize for that. We need your help in prioritizing which patches should be integrated into our next release, Apache OpenOffice 4.0. If you have submitted a patch and think it is applicable for AOO 4.0, please respond with a comment to let us know. On the other hand, if the patch is no longer relevant, please let us know that as well. If you have any general questions or want to discuss this further, please send a note to our dev mailing list: dev@openoffice.apache.org Thanks! -Rob
Reset assigne to the default "issues@openoffice.apache.org".