Issue 119612

Summary: [From Symphony][BiDi]The order of Hebraic string are changed after save as new .doc
Product: Writer Reporter: louqle <louqingle>
Component: save-exportAssignee: AOO issues mailing list <issues>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: bjdujing, debin.lei, liushenf, zjchen
Version: 3.4.0   
Target Milestone: 4.0.0   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
7733.doc
none
screenshot
none
patch for i119612
none
patch for i119612 zjchen: review?

Description louqle 2012-05-31 03:03:00 UTC
Created attachment 77831 [details]
7733.doc

open the sample file and compare it with that in MS Word

the order of the English words and Hebraic words are incorrect
Comment 1 louqle 2012-08-30 08:25:38 UTC
Above steps are incorrect.

1. open the sample file in Aoo
2. Save as another .doc file
3. reopen the new .doc file in MS word, compare it with the original one.

defect: order of some Hebraic string are changed
Comment 2 louqle 2012-08-30 08:31:26 UTC
Created attachment 79233 [details]
screenshot
Comment 3 zjchen 2012-09-07 06:24:49 UTC
In MS Word, if a paragraph has English and Arabian text, The order of text will not be reversed and the RTL property(which property ID is 0x085A) would not be set.

While loading the document in AOO, the RTL property is not handled and saved. and the export process logic will export the paragraph has the property of "RTL" simply for there is Arabian text in paragraph. See  <WW8AttributeOutput::RTLAndCJKState> in main\sw\source\filter\ww8\ww8atr.cxx Line 952-953 for more detail.

There is another character property sprmCIdctHint specifies a script bias for the text in the run for Unicode characters that are shared between far east and non-far east scripts. we also need to support this property in mixed English and Arabian text situation.

The solution is that add these two properties in AOO to record RTL and IdctHint property value, when loading MS Word document, handle the properties and save the value into document model. when this document saving to MS Word document, write out the property value according to the new properties in property set.

Noticed that this solution just support the properties in loading and saving. So the text order will  display correctly in MS Word while wrong in word processor.

I propose to create a new issue to track the text order in word processor is not consistent with in Word. SW core function need further improvement to support these properties.
Comment 4 zjchen 2012-09-07 06:27:51 UTC
Created attachment 79343 [details]
patch for i119612
Comment 5 zjchen 2012-09-07 06:30:07 UTC
Created attachment 79344 [details]
patch for i119612
Comment 6 Lei Debin 2012-09-12 04:57:04 UTC
Now, in AOO core function, we can not process the RTL property correctly.
So the solution is preserve the property and export correctly with doc. It is reasonable, reviewed pass for me.
Comment 7 SVN Robot 2012-09-12 05:07:55 UTC
"leidb" committed SVN revision 1383777 into trunk:
#119612# fix the order of Hebraic string are changed after save as new .doc *...
Comment 8 Lei Debin 2012-09-12 05:15:59 UTC
fixed
Comment 9 Du Jing 2012-10-16 03:30:25 UTC
verified on the build AOO3.5_r1397404
Comment 10 Shenfeng Liu 2012-10-18 05:39:42 UTC
Update Target Milestone to AOO 3.5.0.