Issue 73707 - Preview of Autoformatted table incorrect in RTL
Summary: Preview of Autoformatted table incorrect in RTL
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: OOo 2.0.4
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
: 77870 (view as issue list)
Depends on:
Blocks: 79434
  Show dependency tree
Reported: 2007-01-21 08:03 UTC by alan
Modified: 2013-08-07 14:43 UTC (History)
5 users (show)

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

How it looks in LTR (137.90 KB, image/jpeg)
2007-01-21 08:04 UTC, alan
no flags Details
How it looks in RTL (note that the black column in the preview is misplaced) (138.29 KB, image/jpeg)
2007-01-21 08:05 UTC, alan
no flags Details
Proposed patch (2.13 KB, patch)
2007-04-23 14:54 UTC, alan
no flags Details | Diff
The vertical line is incorrectly to the left of the leftmost column (27.12 KB, image/jpeg)
2007-04-23 14:56 UTC, alan
no flags Details
Note that the rightmost digits are slightly out of the cell area (34.79 KB, image/jpeg)
2007-04-23 14:58 UTC, alan
no flags Details
New patch, works for Calc-Autoformat dialog, too (7.12 KB, patch)
2007-05-28 14:38 UTC, alan
no flags Details | Diff
tabs removed, BOOL->bool, bRTL->mbRTL (7.29 KB, patch)
2007-05-30 08:24 UTC, alan
no flags Details | Diff
misaligned dialog in Calc (22.48 KB, image/jpeg)
2007-06-21 10:57 UTC, Oliver Specht
no flags Details
Also fixes misaligned dialog in Calc (7.81 KB, patch)
2007-06-27 16:56 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 2007-01-21 08:03:01 UTC
If a user inserts a table in a document whose text direction of a document is
RTL, the preview in the autoformat window has the wrong direction. See attached
Comment 1 alan 2007-01-21 08:04:16 UTC
Created attachment 42350 [details]
How it looks in LTR
Comment 2 alan 2007-01-21 08:05:20 UTC
Created attachment 42351 [details]
How it looks in RTL (note that the black column in the preview is misplaced)
Comment 3 kpalagin 2007-01-22 08:56:39 UTC
Confirming with build 9107 on WinXP.
Comment 4 michael.ruess 2007-01-22 10:56:39 UTC
The Table.Autoformat dialog does not seem to be RTL ready.
Comment 5 alan 2007-04-23 14:53:07 UTC
I'm attaching a patch which pretty much fixes the Autoformats for RTL. However,
after applying the patch, there are still two problems, which the attached
screenshots illustrate:

1.The vertical line in the lavender autoformat is on the wrong side of the left
2.The rightmost digit in the currency strings go slightly out of the cell. Is
this  because the Israel currency symbol is slightly larger than other symbols
that the designer of the autoformat had in mind?

I'm not sure how to go about fixing these two minor problems.
Comment 6 alan 2007-04-23 14:54:43 UTC
Created attachment 44612 [details]
Proposed patch
Comment 7 alan 2007-04-23 14:56:28 UTC
Created attachment 44613 [details]
The vertical line is incorrectly to the left of the leftmost column
Comment 8 alan 2007-04-23 14:58:27 UTC
Created attachment 44614 [details]
Note that the rightmost digits are slightly out of the cell area
Comment 9 Oliver Specht 2007-04-24 06:58:50 UTC
I'll have a look at it next week
Comment 10 Oliver Specht 2007-05-15 11:56:00 UTC
->ayaninger: The borders are painted in svx/source/dialog/framelink.cxx and
framelinkarray.cxx (This will influence the Calc-AutoFormat dialog, too!)

The table orientation does not necessarily meet the setting of
Application::GetSettings().GetRTLLayout(). The right way to find the RTL/LTR
setting is to call SwFEShell::IsTableRightToLeft() and propagate this
information to the dialog.

The currency problem does not occur with the relatively small EUR sign. 
Comment 11 alan 2007-05-28 09:13:03 UTC
Thank you for pointing me to the code in framelink.cxx and framelinkarray.cxx. 

Re: table orientation:
SwFEShell::IsTableRightToLeft() will give me the orientation of an existing
table. However, if I am using AutoFormat to create a table, this won't help,
since the table doesn't exist yet. In that case, wouldn't I have to use
Comment 12 alan 2007-05-28 14:39:03 UTC
Created attachment 45463 [details]
New patch,  works for Calc-Autoformat dialog, too
Comment 13 alan 2007-05-28 14:44:08 UTC
Could you review this patch before I change the status to "FIXED"?
Comment 14 Oliver Specht 2007-05-29 13:05:24 UTC
->dr: Please have a look at the Calc-patch.

->ayaniger: Regarding the table orientation you are right. If it is a
to-be-created table then Application::GetSettings().GetRTLLayout() will do.
Comment 15 daniel.rentz 2007-05-29 14:02:52 UTC
- In all patches, please use spaces instead of tabs.

- In svx::frame::Array::GetCellIndex(), please replace the outdated 'BOOL' by 
the builtin 'bool' type, and of course, 'FALSE' -> 'false'.

- In sc/source/ui/inc/autofmt.hxx, please replace 'BOOL bRTL' by 'bool 
mbRTL' (leading m for new class members).
Comment 16 alan 2007-05-30 08:20:23 UTC
I'm attaching a revised patch with the fixes you requested. I made those fixes
only in my new code, not elsewhere in the file, so the context lines still
contain tabs and "BOOL".
Comment 17 alan 2007-05-30 08:24:25 UTC
Created attachment 45512 [details]
tabs removed, BOOL->bool, bRTL->mbRTL
Comment 18 daniel.rentz 2007-05-30 08:29:40 UTC
Nothing to complain anymore from my side ;-)
Comment 19 Mathias_Bauer 2007-06-12 20:44:59 UTC
Oliver, Daniel: could you please comment the status. Is it ready for
integration? That would allow us to change the target to 2.3.
Comment 20 daniel.rentz 2007-06-13 08:28:00 UTC
Yes, no problem
Comment 21 Oliver Specht 2007-06-13 09:50:51 UTC
Target changed to 2.3
Reassigning to me to integrate the patch
Comment 22 Oliver Specht 2007-06-21 10:57:24 UTC
Created attachment 46133 [details]
misaligned dialog in Calc
Comment 23 Oliver Specht 2007-06-21 10:59:26 UTC
->ayaniger: I've attached a screenshot of the Calc AutoFormat dialog. The Writer
dialog is o.k.
Comment 24 alan 2007-06-27 16:56:37 UTC
Created attachment 46307 [details]
Also fixes misaligned dialog in Calc
Comment 25 daniel.rentz 2007-06-28 09:02:26 UTC
In class AutoFmtPreview (file sc/source/ui/miscdlgs/autofmt.cxx), please pass
the parameter "pDoc" from the c'tor to the Init() function. This saves the
"ugly" steps to get the document from the SfxObjectShell::GetFirst() call.
Comment 26 alan 2007-06-28 09:25:36 UTC
I also use those steps to get the current tab, so that I can check if it's RTL.
Is there another way of checking if the current tab is RTL?
Comment 27 daniel.rentz 2007-06-28 09:45:41 UTC
Right, I missed that, sorry. So your way is the way to go. An alternative is to
additionally pass the RTL flag to the c'tor, or to pass the ScViewData instead
of the ScDocument, which may be the "cleaner" solution.
Comment 28 alan 2007-06-28 10:02:26 UTC
So I'll leave the patch as is. If someone wants to implement one of the
alternatives you suggested, I'll reassign the issue. For now, I'll mark the
issue as "Fixed".
Comment 29 alan 2007-09-16 15:08:14 UTC
ayaniger->dr, os:
I'd like this to be integrated in to a cws. What should I do?
Comment 30 Oliver Specht 2007-09-18 08:41:39 UTC
If dr aggrees I'll create a cws next week to integrate the patch.
Target changed to 2.4 and reassigned.
Comment 31 Oliver Specht 2008-03-10 09:44:06 UTC
Sorry, I missed this issue. As it was set to fixed it was not part of the usual
queries :-(
Target changed to 3.0

Applied in cws os112
Comment 32 Oliver Specht 2008-04-11 12:15:08 UTC
Reassigned for verification
Comment 33 michael.ruess 2008-04-16 09:05:43 UTC
Verified fix in CWS os112.
Comment 34 niklas.nebel 2008-05-29 15:43:42 UTC
*** Issue 77870 has been marked as a duplicate of this issue. ***
Comment 35 stefan.baltzer 2008-06-13 14:34:30 UTC
SBA: Verified in DEV300m19. Closed.