Issue 38158 - RTL table imported with columns reversed
Summary: RTL table imported with columns reversed
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 680m62
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords: regression
: 31313 50877 51618 52427 (view as issue list)
Depends on:
Blocks:
 
Reported: 2004-11-30 20:04 UTC by alan
Modified: 2013-08-07 14:42 UTC (History)
4 users (show)

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


Attachments
The problem file (45.00 KB, application/msword)
2004-11-30 20:05 UTC, alan
no flags Details
Screen shot of the file as it appears in Word (102.54 KB, image/jpeg)
2004-11-30 20:06 UTC, alan
no flags Details
Screen shot of the file as it appears in OOo (96.41 KB, image/jpeg)
2004-11-30 20:06 UTC, alan
no flags Details
Problem file resaved by Word 2000 Hebrew version (33.00 KB, application/msword)
2005-01-12 11:58 UTC, alan
no flags Details
Word doc with tables (879.50 KB, application/msword)
2005-03-06 09:41 UTC, Unknown
no flags Details
Proposed patch to fix the ordering of columns in RTL tables (1.45 KB, patch)
2005-03-13 12:08 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 2004-11-30 20:04:29 UTC
The attached Word file contains an RTL table. After import, the columns are 
reversed, row height is too small, some lines are doubled, cells which should 
be in the same column are not.
Comment 1 alan 2004-11-30 20:05:11 UTC
Created attachment 19928 [details]
The problem file
Comment 2 alan 2004-11-30 20:06:02 UTC
Created attachment 19929 [details]
Screen shot of the file as it appears in Word
Comment 3 alan 2004-11-30 20:06:41 UTC
Created attachment 19930 [details]
Screen shot of the file as it appears in OOo
Comment 4 michael.ruess 2004-12-01 10:30:54 UTC
MRU->MMAHER: the content of the columns is in reversed order after import. Also
the structure of the complex table is wrong. Maybe this both problems are
succeeding errors of each other.
Comment 5 alan 2005-01-12 11:51:25 UTC
When the problem file is loaded into Word 2000 (Hebrew version), then saved
under a different name, OOo m69 reads the table correctly (though the grid
disappears).

When the problem file is loaded into Word 2002 , then saved under a different
name, OOo m69 reads the table with the columns reversed.

This may provide you with a clue for fixing this bug. I'm attaching the file
which was saved under Word 2000 Hebrew version (the one which OOo read correctly).
Comment 6 alan 2005-01-12 11:58:24 UTC
Created attachment 21400 [details]
Problem file resaved by Word 2000 Hebrew version
Comment 7 alan 2005-01-12 19:42:53 UTC
This is a regression bug. The file is imported correctly in 1.1.4.
Comment 8 alan 2005-01-12 19:44:45 UTC
This is a regression bug. The file (TableTest4.doc) is imported correctly in 1.1.4.
Comment 9 alan 2005-02-22 09:18:22 UTC
ayaniger -> mmaher

Have you had the time to work on this issue? This is a very visible bug for
Hebrew users, and I'd like to look into it myself. Where in the code is the
adjustment of column order for RTL tables?

Thanks.
Comment 10 martin_maher 2005-02-22 13:38:34 UTC
mmaher: reassigning to flr. I am no longer responsible for filters.
Comment 11 alan 2005-03-02 12:19:36 UTC
If you run "Convert table to text" in the sample document TableTest4, the text
is displayed correctly, from right to left. If you then convert that text back
to a table, the table is displayed properly.
Comment 12 Unknown 2005-03-06 09:36:58 UTC
Tested document "2003-2Horaa.doc" (attached) on Beta2.0 version 1.9m79 from date
5.3.05 on Linux. The results are that the tables aligned Right-to-Left in the
original word document  are imported into OOo with the columns reveresed. Tables
aligned Left-to-Right in Word are imported ok into OOo. 
Comment 13 Unknown 2005-03-06 09:41:40 UTC
Created attachment 23409 [details]
Word doc with tables
Comment 14 alan 2005-03-13 12:06:50 UTC
ayaniger->flr:
This problem seems to stem from a fix for a problem with vertical text,
described in issue 25071. In the course of the fix, code was added which set the
frame direction without taking right-to-left tables into account. I'm attaching
a patch to fix this oversight. When I tested it, the documents attached to this
issue were imported with columns in the correct order. The same goes for the
test document in Issue 31313. To make sure I didn't break the fix to Issue
25071, I also tried importing the test documents with vertical text attached to
Issue 25071, and there was no change. RTL documents with tables containing
vertical text were also imported correctly. It seems to me that this patch fixes
the problem. Could you take a look and send me your comments? It would be great
if we could have a fix for this issue in the final 2.0 version.
Comment 15 alan 2005-03-13 12:08:22 UTC
Created attachment 23762 [details]
Proposed patch to fix the ordering of columns in RTL tables
Comment 16 michael.ruess 2005-06-17 09:18:55 UTC
*** Issue 50877 has been marked as a duplicate of this issue. ***
Comment 17 michael.ruess 2005-07-13 10:29:14 UTC
*** Issue 51618 has been marked as a duplicate of this issue. ***
Comment 18 michael.ruess 2005-07-25 10:17:31 UTC
*** Issue 52427 has been marked as a duplicate of this issue. ***
Comment 19 ikonst 2006-01-03 22:17:01 UTC
A patch was available for more than half a year. Whom do we address to get it
checked in?
Comment 20 alan 2006-08-29 15:43:01 UTC
ayaniger->flr:
I have integrated this patch into our Hebrew builds of OOo, which have been used
for about a year and a half now. Can you review this patch, so it can be
integrated into the source tree? Thanks.
Comment 21 frank.meies 2006-08-30 05:57:11 UTC
fme->flr: I'll take over if you don't mind ;-)

fme->ayaniger: Thank you for the patch, I'll have a look. I changed the target
to the next OOo release.
Comment 22 frank.meies 2006-09-18 10:53:16 UTC
FME: Analysis: The problem is caused by setting the table direction to RTL but
the cell direction to LTR.

FME->ayaniger: I'm not sure if we should set the table cell direction to RTL (in
case bIsBiDi is set), or if we should better set it to ENVIRONMENT (or if we
should not set it at all, which has the same effect). Both works fine, but if we
set the cell direction to RTL, there are two minor problems:
1. the ui (table properties - text flow - text direction) will show an empty
list box for the cell direction.
2. switching the table direction to from RTL to LTR does not work correctly,
since this results in a table with different directions for the table and the
contained cells.

Anyway, since setting the cell direction to RTL has already been tested in your
own builds and it definitely makes the import better than it is right now, I'll
integrate the patch. Thank's again for your contribution!

FME: One more remark: The table in the document TableTest200Heb.doc will be
imported as a LTR table, although it is RTL in Word. However, the layout looks
fine, only the cell names and tab travelling are reversed. For some myterious
reasons this problem vanishes, if I save this file again with Word.

FME: Fixed in cws swqbf86, ww8par2.cxx rev. 1.122.32.2
Comment 23 openoffice 2006-10-04 12:16:06 UTC
*** Issue 31313 has been marked as a duplicate of this issue. ***
Comment 24 frank.meies 2006-10-09 07:55:57 UTC
FME: Ready for QA.
Comment 25 michael.ruess 2006-10-11 13:22:23 UTC
Verified fix in CWS swqbf86.
Comment 26 michael.ruess 2006-12-22 15:13:14 UTC
Checked fix in OO 2.1 release build.