Opened 15 years ago
Closed 15 years ago
#4665 closed Bug (fixed)
[IE] Behavior for pasting from Excel is changed in 'pasting' branch
Reported by: | pomu0325 | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.1 |
Component: | Core : Pasting | Version: | SVN (CKEditor) - OLD |
Keywords: | Confirmed Review? | Cc: | pomu@… |
Description
I tried the new pasting feature listed in #4379, and I found that the behavior is changed when I copy & paste from Excel.
Before, the borders of Excel cell was reflected in the CKEditor, but in the pasting branch, borders are no more copied.
Attachments (2)
Change History (11)
Changed 15 years ago by
Attachment: | paste_test.html added |
---|
comment:1 Changed 15 years ago by
Summary: | Behavior for pasting from Excel is changed in 'pasting' branch → [IE] Behavior for pasting from Excel is changed in 'pasting' branch |
---|
TextRange.execCommand('paste') is used in new pasting feature, but it generates different html codes than document.execCommand('paste') which was used in current CKEditor release.
Try attached code with IE, copy a bordered cell from Excel and click 'paste' button.
- document.execCommand('paste') generates following table
<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64 x:str> <COLGROUP> <COL style="WIDTH: 48pt" width=64> <TBODY> <TR style="HEIGHT: 12.75pt" height=17> <TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 12.75pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl24 height=17 width=64><FONT size=2>test</FONT></TD></TR></TBODY></TABLE>
- TextRange.execCommand('paste') generates following, border-* and background-color style is disappeared
<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64 x:str> <COLGROUP> <COL style="WIDTH: 48pt" width=64> <TBODY> <TR style="HEIGHT: 12.75pt" height=17> <TD style="WIDTH: 48pt; HEIGHT: 12.75pt" class=xl24 height=17 width=64>test</TD></TR></TBODY></TABLE>
comment:2 Changed 15 years ago by
Keywords: | Confirmed added |
---|---|
Milestone: | → CKEditor 3.1 |
Owner: | set to Garry Yao |
Status: | new → assigned |
@pomu0325 Thanks for the discovery, that's very important for us, I have even noticed the difference when coding in the paste branch and the missing style is far not limited to 'border-', we may sometimes missing 'margin-' as I experienced before.
comment:3 Changed 15 years ago by
Found another approach which could avoid using the weird TextRange.execCommand('paste').
Changes are committed with [4482] at paste branch.
comment:4 Changed 15 years ago by
Keywords: | Review? added |
---|
@pomu0325 I believe I've fixed the excel pasting issue as well, but would ask you to attach the sample excel file for confirmation.
comment:5 Changed 15 years ago by
It outputs almost the same result as 3.0.1, besides <p> </p> is inserted at the very beginning.
<p> </p> <table border="0" cellpadding="0" cellspacing="0" style="width: 48pt; border-collapse: collapse" width="64" x:str=""> <tbody> <tr height="17" style="height: 12.75pt"> <td class="xl24" height="17" style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; width: 48pt; height: 12.75pt; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid" width="64"> test</td> </tr> </tbody> <colgroup> <col style="width: 48pt" width="64" /> </colgroup> </table>
to reproduce
- Copy the 1st cell from attached Excel file by Ctrl+C
- Select all the contents in the WYSIWYG area by Ctrl+A
- Paste by Ctrl+V
- Switch to source mode
comment:6 Changed 15 years ago by
Keywords: | Review- added; Review? removed |
---|
comment:7 follow-up: 8 Changed 15 years ago by
Keywords: | Review? added; Review- removed |
---|
It outputs almost the same result as 3.0.1, besides <p> </p> is inserted at the very beginning.
The problem described at this ticket was the inline style lost issue, instead of anything else, which would desire other tickets. The empty paragraph issue mentioned here is supposed to be fixed at #3105.
comment:8 Changed 15 years ago by
Replying to garry.yao:
The problem described at this ticket was the inline style lost issue, instead of anything else, which would desire other tickets.
I see your point. As far as Excel pasting issue, fix confirmed.
comment:9 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ok... we'll be handling it at the pasting branch at this point.
test code for comparing execCommand('paste')