Issue 124914

Summary: AOO opens Word .docx with wrong text alignment
Product: Writer Reporter: Tal <tal>
Component: open-importAssignee: Oliver-Rainer Wittmann <orw>
Status: CLOSED FIXED QA Contact:
Severity: Major    
Priority: P3 CC: cmention, fanyuzhen, jsc
Version: 4.1.0Flags: jsc: 4.1.1_release_blocker+
Target Milestone: 4.1.1   
Hardware: PC   
OS: Windows 7   
See Also: https://issues.apache.org/ooo/show_bug.cgi?id=107841
Issue Type: DEFECT Latest Confirmation in: 4.1.0
Developer Difficulty: ---
Attachments:
Description Flags
Example English file downloaded from http://www.latrobe.edu.au/psy/research/cognitive-and-developmental-psychology/esci none

Description Tal 2014-05-16 08:43:27 UTC
Opening a Word doc/docx in AOO shows the text as Right Aligned, even though it's written in English, and is Left aligned, when opened in Word 2003. 

Marked as Major, since it's one of the basic key points AOO states it can do - "open other office software documents".

Note: I use AOO, with Hebrew lang. pack. Changing the lang back to English U.S. (Default) doesn't fix the problem.
Comment 1 Tal 2014-05-16 08:49:56 UTC
Created attachment 83402 [details]
Example English file downloaded from http://www.latrobe.edu.au/psy/research/cognitive-and-developmental-psychology/esci

Speculations:
Default alignment may be related to the locale of the OS, or to the default template of Writer documents?
Comment 2 cmention 2014-06-19 03:34:13 UTC
Environment:
Windows 7 Home Premium
Processor Intel(R) Core(TM) i3 CPU 550  @ 3.20GHz, 3192 Mhz, 2 Core(s), 4 Logical Processor(s)
OpenOffice 4.1.0
AOO410m18(Build:9764)  -  Rev. 1589052
2014-04-22 11:43:54 (Di, 22 Apr 2014
MS Word Version 14.0.7116.5000 (32bit)

I had mixed results trying to duplicate this bug.  I could not replicate the bug for either Word 97-2003 documents (.doc) OR Word 2010 documents (.docx) with my normal language settings: UI: Default English (USA)/Locale setting: English(USA)/Default Currency: USD $ English USA/Default Languages for documents: English (USA)/CTL: [None].  

However, if I changed the language settings to the following, I could partially duplicate the issue with a Word 2010 file (.docx).  Changed settings:  UI: Default English (USA)/Locale setting: Hebrew/Default Currency: ILS Hebrew/Default Languages for documents: English (USA)/CTL: [None].  With those Language settings, a Word 97-2003 document (.doc) showed the correct Left Alignment .  The Word 2010 document (.docx) incorrectly showed a Right Alignment.

downloaded the user attachment 83402 [details] and saved it as both a Word97-2003 and a Word 2010 document.  When I got the above results, I then downloaded a 75KB User’s Guide from the website { http://www.latrobe.edu.au/psy/research/cognitive-and-developmental-psychology/esci} and saved it again in the two formats specified above, getting the same results as I did with the attachment when I opened them in Writer.
Steps:
Steps:
1 - Open Writer
2 – Go to Tools >> Language >> For all Text >> More
3 – Change settings in Dialogue box: UI: Default English (USA)/Locale setting: English(USA)/Default Currency: USD $ English USA/Default Languages for documents: English (USA)/CTL: [None].  
4 – Open User Attachment 83402 [details] and save as TWO documents (WORD 97-2003 (.doc) AND Word 2010 (.docx)
5 – Open each document in Writer with same Default – English (USA) Settings
RESULT:  Documents will be correctly Left Aligned

6 - Open Writer
7 – Go to Tools >> Language >> For all Text >> More
8 – Change settings in Dialogue box to (2): UI: Default English (USA)/Locale setting: Hebrew/Default Currency: ILS Hebrew/Default Languages for documents: English (USA)/CTL: [None].  
9 – Open each document in Writer with same Locale setting: Hebrew settings
RESULT:  Word 97-2003 Document (.doc)  will be correctly Left Aligned.  Word 2010 Document (.docx) will be Incorrectly Right Aligned.
Recommend follow-up tests changing other Locale settings using countries with Right to Left reading conventions to see if these results hold true.
Comment 3 Tal 2014-06-21 09:49:55 UTC
Thanks for checking this thoroughly, cmention. 
Your tests with Word 2010 show similar results to Word 2003 docx. 
Following your tests, I've managed to get correct and incorrect alignment, only by changing the Locale settings. So, it seems that the default paragraph alignment for the whole document, in AOO 4.1, is based on the Locale setting (Tools > options > Language), rather than the original intended alignment, in Word 2003 & Word 2010 docx files.
Comment 4 Oliver-Rainer Wittmann 2014-06-24 14:01:53 UTC
confirmed due to comment #2

taking over for a closer look
Comment 5 Oliver-Rainer Wittmann 2014-06-25 14:08:23 UTC
a solution is in progress
Comment 6 SVN Robot 2014-06-26 08:03:25 UTC
"orw" committed SVN revision 1605689 into trunk:
124914: Writer - reset certain language dependent pool defaults before import...
Comment 7 Oliver-Rainer Wittmann 2014-06-26 08:07:08 UTC
fixed on trunk.

I am voting for the integration of this fix into branch AOO410 for the planned 4.1.1 release.
Comment 8 jsc 2014-07-01 07:28:41 UTC
grant showstopper fix
Comment 9 fanyuzhen 2014-07-01 07:37:46 UTC
Wait for 4.1.1 build which includes the fix, as current available build is AOO411m1(Build:9770)  -  Rev. 1603804
Comment 10 SVN Robot 2014-07-01 08:14:19 UTC
"orw" committed SVN revision 1607011 into branches/AOO410:
124914: Writer - reset certain language dependent pool defaults before import...
Comment 11 Oliver-Rainer Wittmann 2014-07-01 08:21:25 UTC
fixed on branch AOO410 for planned 4.1.1 release
Comment 12 SVN Robot 2014-07-01 12:55:08 UTC
"jsc" committed SVN revision 1607062 into branches/AOO410:
#124914# correct name of member variable, merged fix but removed code on trunk
Comment 13 Tal 2014-07-02 22:46:10 UTC
Woohoo! Thanks Oliver & crew; Looking forward for 4.1.1 release.
Comment 14 Tal 2014-07-19 09:05:54 UTC
I cannot verify, since I can't uninstall AOO 4.1.0, prior to installing AOO 4.1.1.
Comment 15 Oliver-Rainer Wittmann 2014-07-21 10:55:08 UTC
(In reply to Tal from comment #14)
> I cannot verify, since I can't uninstall AOO 4.1.0, prior to installing AOO
> 4.1.1.

There is no need to uninstall 4.1.0 prior to the installation of developer snapshot M2 of planned 4.1.1 release. Your 4.1.0 version will be upgraded to the developer snapshot M2 of planned 4.1.1 release.
Comment 16 Tal 2014-07-22 13:25:22 UTC
Verified that works on AOO 4.1.1 Snapshot M2 (Full Hebrew installation over AOO 4.1.0). Attachment opened as intended -- as an LTR document.
Thanks Oliver, for fixing this.