Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7275: Paste from Office should use the same instance of StylesProcessor as editor #7313

Merged
merged 4 commits into from
May 28, 2020

Conversation

niegowski
Copy link
Contributor

@niegowski niegowski commented May 27, 2020

Suggested merge commit message (convention)

Fix (paste-from-office): Paste from Office should use the same instance of StylesProcessor as editor. Closes #7275.


Additional information

@niegowski niegowski changed the title #7275: Paste from word should use the same instance of StylesProcessor as editor #7275: Paste from Office should use the same instance of StylesProcessor as editor May 27, 2020
@Reinmar
Copy link
Member

Reinmar commented May 27, 2020

cc @ckeditor/qa-team

Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without digging much into it. The PR found the real problem there.

This was because the MSWord normalizer creates a new View document to parse clipboard content despite the fact that we already have one created by Clipboard. The problem with this approach is that we have to take care of proper view document creation in two places (in the editor and here). AFAICS this relates to:

  • proper styles processor definitions must be passed from editor document
  • the DOM converter must use the same blockFillerMode

Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be a bit more fluent about this - As I still remember more or less what is happening in PFO and styles normalization the PR solution is OK 👍 but I didn't check the tests, comments, etc. So it might require double check.

ps.: I've just saw the missing inheritDoc annotation in MSWordNormalizer ;)

@FilipTokarski
Copy link
Member

I checked it and pasted content looks pretty good now. It solves the latest issues with highlight and background colors in tables pasted from Word 👍

Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dobule checked ;) AFAICS the other new StylesProcessors() usages are legit.

@oleq oleq merged commit f7fff58 into master May 28, 2020
@oleq oleq deleted the i/7275 branch May 28, 2020 14:08
pomek pushed a commit that referenced this pull request May 29, 2020
Fix (paste-from-office): The Paste from Office feature should use the same instance of `StylesProcessor` as the view document. Closes #7275.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy Word table and pasting into CKE5 loses table cell background color
5 participants