[KJotsEdit] Don't mess with margins when pasting rich text
ClosedPublic

Authored by poboiko on Apr 25 2020, 12:36 PM.

Details

Summary

Original code contained weird html parsing, removing `margin-*: *px;' style properties from raw HTML.
However, when inserted, QTextDocument sees no margins and decides to set them to the default 12px,
which breaks even copy-pasting of non-formatted text (see attached).

Instead just use standard QTextDocument manipulation methods to remove margins. It fixes both pasting
formatted and non-formatted text.

BUG: 302107

Test Plan

Before:
After:

Diff Detail

Repository
R573 KJots
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poboiko created this revision.Apr 25 2020, 12:36 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 25 2020, 12:36 PM
poboiko requested review of this revision.Apr 25 2020, 12:36 PM
poboiko edited the test plan for this revision. (Show Details)Apr 25 2020, 12:38 PM
poboiko edited the test plan for this revision. (Show Details)
mlaurent accepted this revision.Apr 26 2020, 8:11 PM
This revision is now accepted and ready to land.Apr 26 2020, 8:11 PM
This revision was automatically updated to reflect the committed changes.