Issue 72028 - Align Calc cells to right for Hebrew
Summary: Align Calc cells to right for Hebrew
Alias: None
Product: Calc
Classification: Application
Component: ui (show other issues)
Version: OOo 2.0.4
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2006-11-27 12:16 UTC by alan
Modified: 2017-05-20 11:11 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---

For Hebrew, align Calc cells to right in the default style (650 bytes, patch)
2006-11-27 12:17 UTC, alan
no flags Details | Diff
suggestion (1.58 KB, text/plain)
2007-05-16 19:35 UTC, niklas.nebel
no flags Details
Same as above, only LTR text-direction added (2.02 KB, patch)
2007-05-17 08:57 UTC, alan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description alan 2006-11-27 12:16:01 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.
Comment 1 alan 2006-11-27 12:17:30 UTC
Created attachment 40940 [details]
For Hebrew, align Calc cells to right in the default style
Comment 2 frank 2006-11-27 12:37:39 UTC
Hi Niklas,

please have a look at this one and adjust target as needed.

Comment 3 farzaneh 2006-12-06 12:55:06 UTC
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.
Comment 4 niklas.nebel 2006-12-21 19:21:34 UTC
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.
Comment 5 alan 2007-01-07 09:40:20 UTC
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?

Comment 6 niklas.nebel 2007-05-14 18:21:42 UTC
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.
Comment 7 alan 2007-05-15 16:19:14 UTC
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
Comment 8 niklas.nebel 2007-05-16 19:35:43 UTC
Created attachment 45153 [details]
Comment 9 niklas.nebel 2007-05-16 19:36:50 UTC
So, would something like the new attachment work for you?
Comment 10 alan 2007-05-17 08:55:43 UTC
The patch is good, but I'm adding code to make the text direction LTR, so that
RTL users can enter formulas easily.
Comment 11 alan 2007-05-17 08:57:59 UTC
Created attachment 45181 [details]
Same as above, only LTR text-direction added
Comment 12 niklas.nebel 2007-05-29 17:00:09 UTC
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.
Comment 13 alan 2007-09-05 14:12:46 UTC
See regarding formulas in
Comment 14 niklas.nebel 2007-12-04 18:07:23 UTC
retarget 2.x -> 3.x
Comment 15 kaplanlior 2010-08-14 18:48:11 UTC
Any news?
Comment 16 Rob Weir 2013-03-11 15:04:36 UTC
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:


Comment 17 Marcus 2017-05-20 11:11:21 UTC
Reset assigne to the default "".