Issue 119612 - [From Symphony][BiDi]The order of Hebraic string are changed after save as new .doc
[From Symphony][BiDi]The order of Hebraic string are changed after save as ne...
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: save-export
3.4.0
PC All
: P3 normal (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-31 03:03 UTC by louqle
Modified: 2012-10-18 05:39 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
7733.doc (97.50 KB, application/msword)
2012-05-31 03:03 UTC, louqle
no flags Details
screenshot (33.37 KB, image/jpeg)
2012-08-30 08:31 UTC, louqle
no flags Details
patch for i119612 (9.89 KB, application/octet-stream)
2012-09-07 06:27 UTC, zjchen
no flags Details
patch for i119612 (9.89 KB, patch)
2012-09-07 06:30 UTC, zjchen
zjchen: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
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.