Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#9114 closed Bug (duplicate)

Colors are possibly removed when using pastefromword

Reported by: linnex Owned by:
Priority: Normal Milestone:
Component: Plugin : Paste from Word Version: 3.6.3
Keywords: Cc:

Description

Hello everybody,

in plugin pastefromword\filter\default.js (V 3.6.3, Line 1190ff) the styleFilter for colors, or more specific the new-value function does not return anything but "false" for transparent colors (or the replace for gecko). When this filter is applied to styles colors and background-colors are removed - which I believe is not desired. Shouldn't this function "return value;" if the two other tests have "failed".

Tested in IE on an Excel copy&paste: without: background-color is removed with "return value": background-color is retained (as expected - removeStyles in config is false).

Problem still remains in todays downloaded nightly build.

Thanks linnex

Change History (3)

comment:1 Changed 7 years ago by Jakub Ś

Keywords: pastefromword removed
Resolution: duplicate
Status: newclosed

DUP of #6465.

@linnex from your ticket report I understand that have come up with a patch? Can you tell me what have you changed that fixed this filter?

Last edited 7 years ago by Jakub Ś (previous) (diff)

comment:2 Changed 7 years ago by linnex

Hi,

I tried to explain it above, maybe I wasn't exact enough though.

I just added one line to the following code snippet in "pastefromword\filter\default.js"

					// Otherwise provide a black-list of styles that we remove.
					[
						[ ( /^mso-/ ) ],
						// Fixing color values.
						[ ( /-color$/ ), null, function( value )
						{
							if ( value == 'transparent' )
								return false;
							if ( CKEDITOR.env.gecko )
								return value.replace( /-moz-use-text-color/g, 'transparent' );
      // 2012-07-25 linnex: the following line is new
      return value;
						} ],

I believe the problem is the blacklist that falsely removes all back-colors from Excel pastes instead of transparent only.

It worked for me.

Cheers linnex

comment:3 Changed 6 years ago by Frederico Caldeira Knabben

Component: Core : PastingPlugin : Paste from Word
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy