Bug 70318 - EDITING: Paragraph break is inserted unintentionally with Paste special > Text with formatting (rtf)
Summary: EDITING: Paragraph break is inserted unintentionally with Paste special > Tex...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium minor
Assignee: Mike Kaganski
URL:
Whiteboard: BSA target:5.0.0 target:4.4.5 target:...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-09 12:41 UTC by Harald Koester
Modified: 2016-10-25 19:17 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2013-10-09 12:41:12 UTC
Problem description: 

[1] Create new text document.
[2] Display non-printing characters.
[3] Insert two paragraphs with just 1 short sentence each.
[3] Select first word of first sentence with double-click.
[4] Copy to clipboard: Ctrl+C.
[5] Move cursor between two words of second sentence.
[6] Paste clipboard as formatted text with: Edit → Paste Special... → Formatted text [RTF] → OK: The word plus an end paragraph character is inserted, i.e. the sentence is split to two paragraphs. Expected: Only the word without an end paragraph character should be inserted.

Bug already exists in Version 3.4.x

I did the same tests with WordPad, whose standard format is Rich text. With WordPad no paragraph end character is inserted.
Operating System: Windows 7
Version: 4.1.1.2 release
Comment 1 Mike Kaganski 2013-10-10 09:30:39 UTC
Reproducible since 3.3.0.4 and in AOO 4.0.
Comment 2 Cor Nouws 2013-10-10 11:17:18 UTC
accoring to comment #1 an old issue
also the word, number of words, and line from which you copy are not relevant
Comment 3 Cor Nouws 2013-10-11 07:29:07 UTC
Appologies for setting severity to Normal, while it rightfully was set to Minor initially!
Comment 4 Mike Kaganski 2013-10-14 13:17:07 UTC
Miklos, adding you as you suggested in c#9 of Bug 68291.
Comment 5 QA Administrators 2015-04-01 14:41:21 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2015-04-23 13:16:12 UTC
Repro still.

Win 7 Pro 64-bit Version: 5.0.0.0.alpha1+ (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: fi_FI
Comment 7 Mike Kaganski 2015-05-10 16:41:48 UTC
Submitted patch to gerrit: https://gerrit.libreoffice.org/15697
Comment 8 Miklos Vajna 2015-05-11 18:07:33 UTC
Thanks, will have a look at the patch.
Comment 9 Miklos Vajna 2015-05-11 21:36:29 UTC
See also bug 90260 (that's how we almost managed to step on each others legs with Mike).
Comment 10 Commit Notification 2015-05-12 10:51:55 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ddd9f9ff45f61013ea18763eca4c68aedce6caa

tdf#70318: don't forget to clean up second fake paragraph

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Miklos Vajna 2015-05-12 10:54:58 UTC
Hi Mike,

I've now pushed what I *think* to be correct, but I may have overlooked something. Please submit a follow-up patch if you're not happy with what's in master -- the only thing I plan to do on master around this is adding a unit test for bug 90260, so that *that* document is imported without a newline.

The rest is up to you, I don't have strong opinion on that. ;-)

Thanks a lot,

Miklos
Comment 12 Mike Kaganski 2015-05-12 13:15:18 UTC
(In reply to Miklos Vajna from comment #11)
Thank you very much! You are absolutely right, and your patch to bug 90260 seem to handle everything brilliantly!
Comment 13 Commit Notification 2015-06-02 08:08:08 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f44ff6044e4ea20a3a40f65b3762fa0171b20e6e&h=libreoffice-4-4

tdf#70318 tdf#90260 writerfilter: pasted RTF documents may contain no \par

It will be available in 4.4.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Harald Koester 2015-09-10 21:51:48 UTC
Checked with versions 4.4.5 and 5.0.1. In both versions the bug is not fixed. Hence set back to NEW.
Comment 15 Buovjaga 2015-09-12 12:11:22 UTC
Yep, it's not fixed.

Win 7 Pro 64-bit, Version: 5.0.1.2 (32-bit)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: fi-FI (fi_FI)
Comment 16 Mike Kaganski 2015-09-29 15:27:50 UTC
Well, it's not actually "not fixed".

Previously, you could copy formatted text from ANY application, e.g. from WordPad, and pasting it as RTF resulted in extra newline appended.

Now, only when you copy from LO, and then paste back to LO as RTF, you get that newline. When the source is another app, everything is as expected.

Tested with Version: 5.0.2.2 (x64)
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: ru-RU (ru_RU)

and with Version: 5.1.0.0.alpha1+
Build ID: e72e8c59fb1103f46b3d0b3e6a2386566068b1a2
Locale: ru-RU (ru_RU)

under Win10x64.

Seems like a part responsible for copy is affected, because the clipboard data already contain that needless newline: pastion from LO to RTF adds that newline, too.
Comment 17 Mike Kaganski 2015-11-01 00:06:57 UTC
A patch is submitted to gerrit:
https://gerrit.libreoffice.org/19718
Comment 18 Commit Notification 2015-11-10 12:37:01 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a6ae84cc296d4d28e9a48a57406e955138c87a80

tdf#70318: Prevent extra empty paragraph in clipboard RTF content

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Harald Koester 2016-02-16 13:11:14 UTC
Checked with versions 5.0.4.2 and 5.1.0.3:
Bug still exists with 5.0.4.2, but in version 5.1.0.3 it's fixed. Hence status set to Resolved Fixed.