Opened 14 years ago

Last modified 8 years ago

#6465 closed Bug

Paste: content pasted from Excel document loses formatting — at Version 11

Reported by: Paweł Horzela Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 3.0
Keywords: CantFix Cc: kenny.demetter@…

Description (last modified by Jakub Ś)

Original TC:

To reproduce the defect:

  1. In configuration file (config.js) set flag:
    config.pasteFromWordPromptCleanup = true;
    
  2. Copy some text from Word or Excel and click on 'Paste' button from toolbar. You get a prompt message saying: "the text you wanted to paste seems to be copied from Word. Do you want to clean it up before pasting?".
  3. Click on 'Cancel' button.

Expected Result: Text pasted from Word is not cleaned up. It is formatted like in Word document. Actual Result: Text pasted from Word is cleaned up.

This issue was reproduced only using 'Paste' button from toolbar. When you use 'Ctrl+V' keys and then click 'Cancel' button on prompt window, it works fine.


NEW CORRECT TC:

It seems that we have problems with formatting content pasted from Excel.

To reproduce:

  1. Open one of samples provided and paste it into editor using CRTL+V button, paste button and paste from word button

Results:

  1. IE6-9 - Background is not preserved when using paste from word button although it is present in HTML. CRTL+V button and paste button work on the other hand.
  2. Opera, Chrome and FF - In all cases there is no background
  3. Safari - table is pasted as paragraph (doesn't matter which command you use). I have described this as separate issue #8639)
    <p>
    	&nbsp; &nbsp; &nbsp;a b c d &nbsp;</p>
    

Issue(s) has been reproducible from CKEditor 3.0.

Change History (15)

Changed 14 years ago by Paweł Horzela

Attachment: input.xls added

comment:1 Changed 14 years ago by Paweł Horzela

Description: modified (diff)
Summary: ckeditor paste from word detection difference ctrl v and button excelPaste: text pasted from word is cleaned up even when you select 'Cancel' on prompt window

comment:2 Changed 14 years ago by Paweł Horzela

Status: newconfirmed

comment:3 Changed 14 years ago by Paweł Horzela

Using 'Ctrl+V' works only for IE8. For other browsers it doesn't work as well.

comment:4 in reply to:  3 Changed 13 years ago by Garry Yao

Replying to paho:

Using 'Ctrl+V' works only for IE8. For other browsers it doesn't work as well.

When there's no prompt triggered for content from MS Excel in other browsers, it's because there's no cleanup needed.

comment:5 Changed 13 years ago by Garry Yao

Status: confirmedpending

WFM in IE, more clue?

comment:6 Changed 13 years ago by Wiktor Walc

WFM as well, I have used a custom cleanup function from #7304 to make sure it is not executed when 'Cancel' is pressed.

comment:7 Changed 13 years ago by Wiktor Walc

Keywords: IE added
Status: pendingconfirmed
Summary: Paste: text pasted from word is cleaned up even when you select 'Cancel' on prompt windowPaste: content pasted in IE from Excel document loses formatting

The original TC is wrong. This issue has nothing to do with the pastefromword plugin. To prove it, I managed to reproduce it with:

config.removePlugins='pastefromword';

The only thing you need to reproduce it, is to set in IE8: "Tools -> Internet Options -> Security -> Custom Level -> Scripting -> Allow programmatic clipboard access" to Enable.

Remember to run it in IE7 mode. I have confirmed this issue also in IE6.

Having IE configured in the right way, copy contents from input.xls and paste it with the "Paste" button. Note that the formatting is lost, all colors are gone (see the screenshot).

Changed 13 years ago by Wiktor Walc

Attachment: ie8_6465.png added

comment:8 Changed 12 years ago by Jakub Ś

Keywords: IE removed
Summary: Paste: content pasted in IE from Excel document loses formattingPaste: content pasted from Excel document loses formatting

#8594 was marked as duplicate

comment:9 Changed 12 years ago by Jakub Ś

Version: 3.0

Below is the comment from #8594 - the issue concerns all browsers

It seems that we have problems with formatting content pasted from Excel.

To reproduce:

  1. Open one of samples provided and paste it into editor using CRTL+V button, paste button and paste from word button

Results:

  1. IE6-9 - Background is not preserved when using paste from word button although it is present in HTML. CRTL+V button and paste button work on the other hand.
  2. Opera, Chrome and FF - In all cases there is no background
  3. Safari - table is pasted as paragraph (doesn't matter which command you use). I have described this as separate issue #8639)
    <p>
    	&nbsp; &nbsp; &nbsp;a b c d &nbsp;</p>
    

Issue(s) has been reproducible from CKEditor 3.0.

Note:

  1. When pasting first to word and then to Excel everything seems to be fine but this should work without Word.
Last edited 12 years ago by Jakub Ś (previous) (diff)

Changed 12 years ago by Jakub Ś

Attachment: 8594.xls added

Changed 12 years ago by Jakub Ś

Attachment: 8594.xlsx added

comment:10 Changed 12 years ago by Frederico Caldeira Knabben

I've created an Excel document with a single cell filled with the number "1". I've then made it bold, with red font and yellow background.

By checking the raw data the browser receives from Excel on pasting, without passing it through the editor, I found that we'll hardly be able to do something here.

The following is what I had with Firefox:

<table width="64" border="0" cellpadding="0" cellspacing="0"><colgroup><col width="64"></colgroup><tbody><tr height="19">
  <td class="xl65" style="height:14.4pt;
  width:48pt" align="right" height="19" width="64">1</td>
</tr></tbody></table>

This is IE instead:

<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64>
<COLGROUP>
<COL style="WIDTH: 48pt" width=64>
<TBODY>
<TR style="HEIGHT: 14.4pt" height=19>
<TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: yellow; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=19 width=64 align=right><STRONG><FONT color=#ff0000 face=Calibri>1</FONT></STRONG></TD></TR></TBODY></TABLE>

So we can see that the formatting information is simply not passed to FF. Additionally, despite the additional information available with IE, we have no ways to "sniff" this data to understand that it comes from Excel. So, there is no chance for us to work on it to make it better. At the current stage, at least.

comment:11 Changed 12 years ago by Jakub Ś

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy