Bug 97591 - Clipboard contains wrong target for RTF
Summary: Clipboard contains wrong target for RTF
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: All All
: medium minor
Assignee: Oliver Specht (CIB)
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-05 11:56 UTC by qa-admin@libreoffice.org
Modified: 2016-12-26 04:47 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Output of xclip (targets + content) (2.17 KB, text/plain)
2016-02-05 11:58 UTC, qa-admin@libreoffice.org
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qa-admin@libreoffice.org 2016-02-05 11:56:59 UTC
Hi,

short: Clipboard contains RTF as text/richtext which should be text/rtf or application/rtf.

long:

I'm using Libre Office Writer [Version: 4.2.8.2 Build ID:
420m0(Build:2)] and basically want to copy text as RTF to test my
application against input from Libre Office.

My app understands text/rtf. However when copying from LOW my app does
not import anything. Using

xclip -out -primary -t TARGETS

I see that the target text/richtext is available. I did not know
anything about this before so I started searching for it. My current
result is that text/richtext is basically text/enriched which is
something like HTML made for mails and different to text/rtf which is
made by Microsoft. Please correct me if I'm wrong, the whole mail builds
on that knowledge.

Now when accessing the data in my clipboard via

xclip -out -primary -t text/richtext

I get the rtf content. I think this a bug in Libre Office Writer and it should fill the clipboard with text/rtf instead of text/richtext. Unfortunately I don't run the latest release .. so this might be fixed.

See:
https://en.wikipedia.org/wiki/Rich_Text_Format
https://en.wikipedia.org/wiki/Enriched_text
https://tools.ietf.org/html/rfc1341
https://tools.ietf.org/html/rfc1521

I'm working under Ubuntu. And this is the end of the description, following the
full output of the xclip command (which could also be a source of evil
;-) ):


christian.roesch@...:~$ xclip -out -primary -t TARGETS
text/plain;charset=utf-8
text/plain;charset=UTF-8
UTF-8
UTF8_STRING
COMPOUND_TEXT
STRING
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed
Source (XML)"
text/richtext
text/html
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star
Object Descriptor
(XML)";classname="8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";typename="LibreOffice
4.2 Text
Document";viewaspect="1";width="16999";height="2995";posx="0";posy="0"
MULTIPLE

christian.roesch@...:~$ xclip -out -primary -t text/richtext
{\rtf1\ansi\deff3\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New
Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0
Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New
Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt
Arial};}{\f5\fnil\fprq2\fcharset0 Droid Sans
Fallback;}{\f6\fswiss\fprq0\fcharset128
FreeSans;}{\f7\fnil\fprq2\fcharset0 FreeSans;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af5\langfe2052\dbch\af7\alang1081\fs24\lang1033
Normal;}
{\s15\sbasedon0\snext15\noline\dbch\af6 Index;}
{\s16\sbasedon0\snext16\sb120\sa120\noline\i\dbch\af6\afs24\ai\fs24
Caption;}
{\s17\sbasedon18\snext17\sl288\slmult1\sb0\sa140\dbch\af6 List;}
{\s18\sbasedon0\snext18\sl288\slmult1\sb0\sa140 Text Body;}
{\s19\sbasedon0\snext18\sb240\sa120\keepn\dbch\af5\dbch\af7\afs28\loch\f4\fs28
Heading;}
}{\info{\comment LibreOffice}{\vern67241986}}\deftab709

{\*\pgdsctbl
{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0
Default Style;}}
\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pgndec\pard\plain
\s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af5\langfe2052\dbch\af7\alang1081\fs24\lang1033{\b\ab\rtlch
\ltrch\loch
EXAMPLE}
\par }
Comment 1 qa-admin@libreoffice.org 2016-02-05 11:58:41 UTC
Created attachment 122406 [details]
Output of xclip (targets + content)
Comment 2 MM 2016-02-05 22:01:34 UTC
V4.2.8 is old and unsupported. You might wanna try a newer version and see if it solves your problem.
Comment 3 qa-admin@libreoffice.org 2016-02-08 08:35:53 UTC
Problem also exists in latest downloadable version:

Version: 5.0.4.2
Build ID: 2b9802c1994aa0b7dc6079e128979269cf95bc78
Locale: en-US (en_US.UTF-8)
Comment 4 Buovjaga 2016-02-11 10:11:04 UTC
Confirmed with xclip.

Adding needAdvice as we need some insight from developers.

Ubuntu 15.10 64-bit 
Version: 5.2.0.0.alpha0+
Build ID: a6f876d45bd4e41a7143594a6cb11b6893a0f620
CPU Threads: 2; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF-dbg, Branch:master, Time: 2016-02-11_00:43:46
Locale: en-US (en_US.UTF-8)
Comment 5 Commit Notification 2016-03-10 10:13:55 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97591: mark RTF clipboard format as text/rtf

It will be available in 5.2.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 6 Xisco Faulí 2016-09-19 16:47:53 UTC Comment hidden (obsolete)