Bug 302107

Summary: Line spacing doubled, if lines are pasted
Product: [Unmaintained] kjots Reporter: Joe <waveacer>
Component: generalAssignee: Stephen Kelly <steveire>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 4.8   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Joe 2012-06-18 09:48:51 UTC
If you cut e.g. two lines to paste them elsewhere in a page, suddenly the line spacing for these two lines is doubled - regardless of windows or Linux line endings.

Reproducible: Always

Steps to Reproduce:
1. Enter a page and mark two following lines of text
2. Cut or copy them or use the middle mouse key and paste the two lines elsewhere in the page

Actual Results:  
The line spacing for these two lines is doubled - regardless of windows or Linux line endings.

Expected Results:  
Same format of line spacing as the cut or copied lines.
Comment 1 Andrew Crouthamel 2018-11-09 01:04:23 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 2 Andrew Crouthamel 2018-11-20 04:09:51 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Igor Poboiko 2020-04-26 21:09:24 UTC
Git commit 4f861fa9211b31b1e810696b724d8459e2251a7c by Igor Poboiko.
Committed on 26/04/2020 at 21:09.
Pushed by poboiko into branch 'master'.

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

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.

Test Plan:
Before: {F8259687}
After: {F8259688}

Reviewers: dvratil, mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D29177

M  +15   -29   src/kjotsedit.cpp

https://commits.kde.org/kjots/4f861fa9211b31b1e810696b724d8459e2251a7c