Bug 99467 - Pasting text from Java app not working correctly (GTK3)
Summary: Pasting text from Java app not working correctly (GTK3)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Caolán McNamara
QA Contact:
URL:
Whiteboard: target:5.4.0 target:5.3.4
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2016-04-23 10:59 UTC by vedyimyn
Modified: 2017-05-02 13:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
A simple Java app for testing purposes (with sources) (82.27 KB, application/zip)
2016-04-29 16:50 UTC, vedyimyn
Details
comparison GTK3 and GTK (27.26 KB, image/png)
2017-05-01 20:17 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vedyimyn 2016-04-23 10:59:41 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36
Build Identifier:  5.1.2.2.0+

I cannot paste text properly from any Java app (from a textarea to a cell in a spreadsheet). Instead of my text I get "��" in a cell.

The problem occurs when the Java app features Swing or AWT text areas. Pasting from JavaFX components works correctly.

Reproducible: Always

Steps to Reproduce:
1. Run any Java app containing a text area (not a JavaFX one).
2. Type a text in the text area.
3. Paste it into any cell in a spreadsheet.
Actual Results:  
I see two question marks pasted into the cell: �� (exactly these).

Expected Results:  
I expect to see the text I wrote pasted exactly as I wrote it.

[Information automatically included from LibreOffice]
Locale: pl
Module: SpreadsheetDocument

OS: Debian Stretch 64bit
Java version: 8u77+8u77arm-1~webupd8~4 (pasted from the package manager)

There is an easy workaround: I usually paste my text from the Java app to Gedit and from there to the spreadsheet.

Pasting from Java app to the Writer causes similar problem. I believe it's linked to the one I describe.


Reset User Profile?No
Comment 1 raal 2016-04-23 19:31:54 UTC
ctrl+shift+v  works?
Comment 2 vedyimyn 2016-04-23 21:58:34 UTC
(In reply to raal from comment #1)
> ctrl+shift+v  works?

It doesn't. I get a dialog box in which I read:
Source: Source unknown
One option below: unformatted text.

After I press "Ok" the two question marks (��) are pasted.
Comment 3 raal 2016-04-29 09:41:47 UTC
Please find some java app which we can use for testing.
Comment 4 vedyimyn 2016-04-29 16:50:31 UTC
Created attachment 124736 [details]
A simple Java app for testing purposes (with sources)
Comment 5 vedyimyn 2016-04-29 16:56:54 UTC
(In reply to vedyimyn from comment #4)
> Created attachment 124736 [details]
> A simple Java app for testing purposes (with sources)

Unfortunately I don't remember the source of the app.

The bug occurs with this one for sure, I've just checked it.
Comment 6 raal 2016-04-29 18:12:26 UTC
Thanks for the app. I can not reproduce with Version: 5.2.0.0.alpha0+
Build ID: 170a473597534cf59887b1d817538322e7039862
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-04-19_00:41:06
Ubuntu
Comment 7 Buovjaga 2016-05-06 13:34:29 UTC
Works ok here as well.

jre8-openjdk 8.u92-1

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha1+
Build ID: 540fee2dc7553152914f7f1d8a41921e765087ef
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on April 30th 2016

64-bit, KDE Plasma 5
Build ID: 5.1.2.2 Arch Linux build-1
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Comment 8 thackert 2016-12-17 13:26:10 UTC
Hello  vedyimyn, *,
thank you very much for reporting this bug :) I can confirm it with

OS: Debian Testing AMD64
LO: Version: 5.2.4.1
Build-ID: 1:5.2.4~rc1-1
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
(Debian's own version)

but not with

LO: Version: 5.1.6.2
Build-ID: 07ac168c60a517dba0f0d7bc7540f5afa45f0909
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

nor

LO: Version: 5.2.0.4
Build-ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE.UTF-8)

nor

Version: 5.2.3.3
Build-ID: d54a8868f08a7b39642414cf2c8ef2f228f780cf
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

nor Version: 5.2.4.1
Build-ID: 9b50003582f07ac674d6451e411e9b77cccd2b22
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; VCL: gtk2; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

nor

Version: 5.3.0.0.beta2
Build-ID: a7e30712ad6d8bc9286007b37aa581983e0caba3
CPU-Threads: 4; BS-Version: Linux 4.5; UI-Render: Standard; VCL: gtk2; Layout-Engine: neu; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
(all parallel installed versions from our project, following the instructions from https://wiki.documentfoundation.org/Installing_in_parallel/Linux and with de_DE lang- as well as helppack)

so it seems only related to Debian's version. @vedyimyn: have you tested it with one of our versions and does this bug appear there, too? If so, feel free to change the status back to "UNCONFIRMED". Otherwise it would be nice if you could report this to Debian's own bugtracker at https://bugs.debian.org/libreoffice and close this one ... ;)
HTH
Thomas.
Comment 9 Xisco Faulí 2017-05-01 20:14:37 UTC
I've just reproduced it on Ubuntu.

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

and

Version: 5.4.0.0.alpha0+
Build ID: 597a2f5d5bd37443262b0775b8439bc3502aef1b
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; 
Locale: es-ES (ca_ES.UTF-8); Calc: group

but not in

Version: 5.4.0.0.alpha0+
Build ID: 597a2f5d5bd37443262b0775b8439bc3502aef1b
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk2; 
Locale: es-ES (ca_ES.UTF-8); Calc: group


it seems to be only related to GTK3
Comment 10 Xisco Faulí 2017-05-01 20:17:17 UTC
Created attachment 132993 [details]
comparison GTK3 and GTK
Comment 11 Commit Notification 2017-05-02 11:16:45 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#99467 pasting text from java apps to gtk3 gives bad results

It will be available in 5.4.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 12 Caolán McNamara 2017-05-02 11:17:40 UTC
backport to 5-3 in gerrit
Comment 13 Commit Notification 2017-05-02 13:12:12 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a090322721222c98f7ccd194eac84e5a76579f8e&h=libreoffice-5-3

Resolves: tdf#99467 pasting text from java apps to gtk3 gives bad results

It will be available in 5.3.4.

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.