Issue 125511

Summary: Right-to-Left mode not recognized when loading .doc
Product: Writer Reporter: Andreas Säger <villeroy>
Component: editingAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: anies2014
Version: 4.1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Broken table 1
none
Broken table 2
none
Broken table 3
none
Broken table 4 none

Description Andreas Säger 2014-08-25 15:38:56 UTC
There seems to be a problem with RtL text in .doc. Although the text is stored properly, the text cursor operates in LtR mode after loading the doc until you turn on RtL manually (Ctrl+Shift+D). This does not happen with .odt documents. And it may be a regression: https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71876
Comment 1 anies2014 2016-10-29 03:11:35 UTC
Configuration:
  OS: Windows 10 Pro Version 10.0.14393 Build 1493
  RAM: 16gb
  CPU: AMD FX8350
  GPU: AMD Radeon 390
  Display: 3x 1080p
  Keyboard: US, QWERTY

Software Versions Tested:
  - Version 4.2.0: AOO420m1(Build:9800)  -  Rev. 1761251
  Rev.1761251

NOTE:

More details of the issue are found on the linked forum post from the original post (https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71876).

There are two behaviors described for this bug:
1. "Right-to-Left mode not recognized when loading .doc" from this report.
2. A table issue from the forum, "Once the table is shorter than the page width, the whole table move to the left instead of being on the right side."

What I found:
1. I was unable to reproduce the first behavior.
2. I was able to reproduce the second behavior as a result of converting the document into 'rtf' format and saving in another program. NOTE: The original report used the 'doc' format for compatibility with MS Word (See the forum post). The format and program change was done due to my lack of MS Word access.
3! I was able to corrupt the table after loading the document in 'doc' format.

I've outlined the steps below for:
- Prerequisite steps used to input in right-to-left mode.
- Reproducing the table moving behavior (#2) with 'rtf' format and Wordpad.
- Reproducing corruption of the table (sometimes recoverable).
- Steps to restore a corrupted table.

Prerequisite steps:
1. Navigate "tools" -> "Options..." -> "Language Settings" -> "Languages"
2. Check the box for "Show UI elements for Bi-Directional writing"

Steps to reproduce the table moving behavior with 'rtf' format and Wordpad:
1. Start a new document in OOW.
2. Select "Right-to-Left".
3. Select "Insert" -> "table" -> "OK" to insert a 2x2 table.
4. Save the file in "rtf" format.
5. (If a dialog appears) Select "Keep Current Format".
6. Close OOW and open the file in Wordpad.
7. Observe table is aligned to the right.
8. Click-and-drag the left side of the table and shrink the left column.
9. Save the document.
10. Close Wordpad and open the file in OOW.
11. Observe the table is aligned to the left.
12. Close OOW, open again in Wordpad, observe table is aligned to the left.

Steps to reproducing corruption of the table.
1. Start a new document in OOW.
2. Select "Right-to-Left".
3. Select "Insert" -> "table" -> "OK" to insert a 2x2 table.
4. Save the file in "doc (97/2000/XP)" format.
5. (If a dialog appears) Select "Keep Current Format".
6. Close OOW.
7. Reopen the file in OOW.
8. Click-and-drag the left side of the table and shrink the left column.
9. Observe visual distortion of the table (e.i. Loss of some rows and columns and rogue dividing lines)
10. Check if any of the remaining table lines show mouse-over-icons when hovering over them.
11. Observe table selection area by pressing 'ctrl+a'.
12. Observe Undo functionality by pressing 'ctrl-z' 10 times.

Steps to restore a corrupted table:
1. Observe table selection area by pressing 'ctrl+a'.
2. Right-click within table area.
3. Select "Row" -> "Insert" -> "OK"
4. Observe table and cell data restored.

Follow up notes:
- Not all table adjusting restores a broken table.
- Resizing the table after saving the doc but before reopening OOW does not break the table.
- Tables don't break the same way. Sometimes there are edges that remain movable, other times no edges are movable.
- I have attached screen shots showing the corrupted table from various steps. Some of the screenshots include cell data from follow-up tests.
Comment 2 anies2014 2016-10-29 03:13:28 UTC
Created attachment 85808 [details]
Broken table 1
Comment 3 anies2014 2016-10-29 03:13:54 UTC
Created attachment 85810 [details]
Broken table 2
Comment 4 anies2014 2016-10-29 03:14:17 UTC
Created attachment 85812 [details]
Broken table 3
Comment 5 anies2014 2016-10-29 03:15:01 UTC
Created attachment 85814 [details]
Broken table 4

The table is selected in this screenshot.