Issue 120442 - Copy text to Firefox or Chrome cause data damaged
Copy text to Firefox or Chrome cause data damaged
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: editing
3.4.0
All All
: P3 normal (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks: 102943
  Show dependency treegraph
 
Reported: 2012-08-02 06:48 UTC by Yan Ji
Modified: 2012-08-30 08:46 UTC (History)
4 users (show)

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


Attachments
sample (11.17 KB, application/vnd.oasis.opendocument.text)
2012-08-02 06:48 UTC, Yan Ji
no flags Details
Patch for 120442 (1.93 KB, patch)
2012-08-07 08:02 UTC, Chen Peng
hdu: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-08-02 06:48:42 UTC
Created attachment 78816 [details]
sample

Build AOO 3.4.1
OS: All
Steps:
1. Open attached sample file
2. Select content of line 8
3. Paste it to edit field in Firefox, Chrome or Safari. e.g. in memo of gmail

Defect: the content is not pasted correctly.
Comment 1 Chen Peng 2012-08-02 08:20:59 UTC
I will take this bug, thanks.
Comment 2 Regina Henschel 2012-08-02 13:38:57 UTC
I think, that a browser is not suitable to examine, whether AOO uses the clipboard correctly. The character set and the font of a displayed website depends on the settings of the browser and the settings in the website.
Comment 3 Chen Peng 2012-08-07 07:59:06 UTC
1. Root Cause:
  In Firefox or Chrome, if the unicode is equal or larger than 0xd800 and smaller equal or than 0xdbff, and the next unicode is equal or larger then 0xdc00 and equal or smaller than 0xdfff, using such two 16-bit unicode can't display the data such as the last 5 charaters of line 8 in the sample. 
2. Resolution:
Need to convert such two 16-bit unicode to a 32-bit unicode to show the content.
Comment 4 Chen Peng 2012-08-07 08:02:48 UTC
Created attachment 78870 [details]
Patch for 120442
Comment 5 Chen Peng 2012-08-07 08:16:22 UTC
It is correct if paste such content in IE or MS. The content of last 5 characters in clipboard is using two 16-bit unicode format, but paste such content in Chrome, Firefox or Safari, it is wrong, need to change the two 16-bit unicode to a 32-bit unicode to show the right content. 
(In reply to comment #2)
> I think, that a browser is not suitable to examine, whether AOO uses the
> clipboard correctly. The character set and the font of a displayed website
> depends on the settings of the browser and the settings in the website.
Comment 6 SVN Robot 2012-08-08 09:32:13 UTC
"hdu" committed SVN revision 1370716 into trunk:
#i120442# fix html-flavored copy+paste of unicode surrogate pairsPatch-by: Ch...
Comment 7 hdu@apache.org 2012-08-08 09:34:26 UTC
Thanks for finding, analyzing and solving the problem. I reviewed and applied the patch with some minor modifications.
Comment 8 Chen Peng 2012-08-09 00:50:14 UTC
Thank you, Herbert. It is more clear now.
Comment 9 Du Jing 2012-08-30 08:44:12 UTC
verified on the build r1378446