Bug 63428 - LibreOffice crashes when pasting a text with annotations copied from "Scrivener"
Summary: LibreOffice crashes when pasting a text with annotations copied from "Scrivener"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: Other macOS (All)
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: BSA target:4.2.0 target:4.1.2
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-11 14:37 UTC by davent
Modified: 2013-08-12 13:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
mac debug information copy/paste scrivener/lo (76.48 KB, text/plain)
2013-04-14 16:53 UTC, davent
Details
contains pasteboard data (974 bytes, application/rtf)
2013-06-10 19:09 UTC, davent
Details
Decoded attachment (480 bytes, application/rtf)
2013-08-09 15:39 UTC, Urmas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description davent 2013-04-11 14:37:49 UTC
Problem description: 

LibreOffice crashes when pasting a text with annotations copied from "Scrivener".

Steps to reproduce:
1. Install and open "Scrivener" 
http://en.wikipedia.org/wiki/Scrivener_%28software%29
http://www.literatureandlatte.com/scrivener.php
2. Create a new project 
3. Create a new text 
4. Write something, e.g. "hello"
5. Go to Format > Comment
6. Write something, e.g. "crash"
7. Select the first text ("hello")
8. Cmd+C
9. Open a new document in LibreOffice Writer
10.Cmd+V


Current behavior:
Libreoffice crahes

Expected behavior:
The Writer document contains a commented text.
              
Operating System: Mac OS X
Version: 4.0.2.2 release
Comment 1 Julien Nabet 2013-04-11 19:35:31 UTC
davent: could you attach the debug info in a file and attach it by using this link https://bugs.freedesktop.org/attachment.cgi?bugid=63428&action=enter
About debug info, see https://wiki.documentfoundation.org/BugReport#How_to_get_debug_information_on_Mac_OS_X
Comment 2 davent 2013-04-14 16:53:42 UTC
Created attachment 77952 [details]
mac debug information copy/paste scrivener/lo

voilà.
Comment 3 Julien Nabet 2013-05-04 06:38:01 UTC
davent: thank your for feedback and sorry for the delay. I update the status to NEW since you attached a bt.

Miklós: one for you? (I see rtf part in bt)
Comment 4 Miklos Vajna 2013-06-06 08:21:54 UTC
davent,

Thanks for the trace. I don't have OSX, so I can't reproduce the bug. In worst case, can try to construct some blind fix based on the backtrace, but let's try something else before doing so.

Please start LO using:

SW_DEBUG_RTF_PASTE_TO=$(pwd)/paste.rtf /Applications/LibreOffice.app/Contents/MacOS/soffice

Then do your steps to reproduce the bug. When the actual paste would happen, it won't happen (LO won't crash), but the above mentioned paste.rtf will be created in the current directory. Please attach that to this bug.

Thanks!
Comment 5 davent 2013-06-09 15:21:59 UTC
hello miklos,

thank you for your reply. 
i tried to follow your steps, but it didn't work. i pasted your command into the terminal, lo starts, but it crashes after pasting the text like always and there is no file called paste.rtf.

what should i do?
Comment 6 Miklos Vajna 2013-06-10 07:18:41 UTC
A different way to get the same info is to use pbpaste:

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pbpaste.1.html

One more way is described here:

http://stackoverflow.com/questions/2545289/getting-rtf-data-out-of-mac-os-x-pasteboard-clipboard

Hopefully one way to will work. ;)
Comment 7 davent 2013-06-10 19:09:14 UTC
Created attachment 80637 [details]
contains pasteboard data

i got this file.
Comment 8 davent 2013-08-09 10:21:25 UTC
is the file ok?
Comment 9 Julien Nabet 2013-08-09 11:32:50 UTC
davent: I've got a long chain like  this:
"data RTF 7B5C727466315C616E73695C616E7369637067313235325C636F636F61727466313138375C636F636F6173756..." and that's all.

Could you copy paste information in a simple txt file?
Comment 10 Urmas 2013-08-09 15:39:32 UTC
Created attachment 83896 [details]
Decoded attachment
Comment 11 Miklos Vajna 2013-08-09 15:57:24 UTC
Thanks, confirmed the crash using:

SW_DEBUG_RTF_PASTE_FROM=/path/to/test.rtf ./soffice

and typing "foobar", copying, then pasting it as RTF.
Comment 12 Julien Nabet 2013-08-09 15:58:32 UTC
Comment on attachment 83896 [details]
Decoded attachment

Mimetype fixed
Comment 13 Commit Notification 2013-08-12 10:40:22 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

fdo#63428 writerfilter: fix paste of commented text ranges



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 Miklos Vajna 2013-08-12 12:44:00 UTC
-4-1 review: https://gerrit.libreoffice.org/5368
Comment 15 Commit Notification 2013-08-12 13:02:00 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

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

fdo#63428 writerfilter: fix paste of commented text ranges


It will be available in LibreOffice 4.1.2.

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.