Bug 69679 - EDITING: Problem in Copy-Paste when text contains characters with code 0Dh
Summary: EDITING: Problem in Copy-Paste when text contains characters with code 0Dh
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
Depends on:
Blocks: Paste Character
  Show dependency treegraph
Reported: 2013-09-22 16:28 UTC by Ankur Vishwakarma
Modified: 2020-07-05 03:39 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

Java source file (3.99 KB, text/x-java)
2013-09-22 16:28 UTC, Ankur Vishwakarma
result of pasting into Writer in 3.4.2 on WinXP (8.75 KB, application/vnd.oasis.opendocument.text)
2013-09-23 12:55 UTC, sasha.libreoffice
Test case to simply demonstrate the problem (775 bytes, text/plain)
2014-02-06 23:42 UTC, Dale
Test Case with example results (21.80 KB, application/x-zip-compressed)
2014-02-07 06:57 UTC, Dale

Note You need to log in before you can comment on or make changes to this bug.
Description Ankur Vishwakarma 2013-09-22 16:28:33 UTC
Created attachment 86322 [details]
Java source file

Problem description: 

I copy and pasted a java source code to librewriter, but instead of complete code paste only a single statement got pasted.

MS Office 2007 works well in this regard.

tested on Windowx XP SP3 and ubuntu 12.04 LTS.

Steps to reproduce:
1. Open attached java source file in text editor in read-only mode

2. Select all code from source file for copy operation using Ctrl+A and Ctrl+C.

3. Open LibreWriter and Press Ctrl+V to paste the copied source code.

4. You will see the bug then.

Current behavior:

Incomplete paste operation.

Expected behavior:

Complete paste operation

Operating System: All
Version: release
Comment 1 Terrence Enger 2013-09-22 18:08:06 UTC
Examination of Quiz.java shows that carriage-return separates lines.
This could well be the trigger for the problem.

I have not reproduced exactly "only a single statement gets pasted",
but I can get the whole file joined together into one paragraph.
Since the problem description says the problem is the same on Linux,
it is strange that my bad result differs from the reporter's result.
Ankur, can you confirm my understanding that you see a different

When I save the "joined together" document as an .fodt, I see that the
carriage returns are represented as "

How to get the bad result:

(*) Wine Notepad, running on wine, does not recognize the carriage
    returns in its own display, and the paste into Writer gives
    everything run together in one paragraph.

How to get good results:

(*) Writer menu option Insert > File produces good results.

(*) emacs tells me that Quiz.java is a Mac file, and on input it
    converts carriage return to linefeed-only (the Linux convention);
    pasting into Writer works well.

(*) gedit is less forthcoming about what it is doing, but the result
    is good.

My LibreOffice is master commit 95e95e0, fetched 2013-09-19, and
configured with:


Comment 2 sasha.libreoffice 2013-09-23 12:55:56 UTC
Created attachment 86361 [details]
result of pasting into Writer in 3.4.2 on WinXP
Comment 3 sasha.libreoffice 2013-09-23 13:04:19 UTC
Reproduced in 3.4.2 and 3.5.0 in WinXP 32 bit
(therefore not a regression)

In LibreDraw and Calc works correctly.
Possible workaround: paste first into Draw, then select text, copy and paste now into Writer.

IMHO this bug may result in problems with interoperability with MacOS users. There this ODh character is widely used.
Comment 4 Terrence Enger 2013-09-23 13:48:29 UTC
Thank you, Sahsa.  Your result matches the original problem
description and is quite different from mine.

It might help the programmer if you identify the program in which you
did the copy operation.  Mind you, I do not know that different
programs would put different things on the clipboard.

So far, we do not have a report from a Mac user.  That is the other
popular platform for LibreOffice.  As the carriage-return as a line
separator is the Mac convention, it would be surprising if LibreOffice
on the Mac screws up.  Pending that information, I am marking this as
a Windows bug.

Meanwhile, I think I shall ask the discuss list whether my observed
"bad" behavior is in fact a bug.  As ugly as the result is, it is not
entirely unreasonable.

Comment 5 sasha.libreoffice 2013-09-24 05:51:38 UTC
Used notepad and TotalCommander (pressed F3)
Comment 6 Ankur Vishwakarma 2013-09-24 13:52:31 UTC
Hi Terry,

     Sorry firstly; I have the bug on Windows XP SP3 and getting a good result under ubuntu 12.04 LTS.

As explained by you that Inserting a file from menu will give good result doesn't happens on WinXP

(*) Writer menu option Insert > File produces bad results.

I have used MS Notepad and Notepad++, but getting the same bad result in LibreWriter.

Comment 7 Dale 2014-02-06 23:42:30 UTC
Created attachment 93571 [details]
Test case to simply demonstrate the problem

This test file demonstrates that, in a paste operation, all characters following "CR not immediately followed by LF" are discarded until a CR/LF pair is seen.
I observe this behaviour in the two versions I have tested: LO and
Comment 8 Dale 2014-02-07 06:57:09 UTC
Created attachment 93585 [details]
Test Case with example results

Clarifying my previous post, the problem shows up on Windows XP.
I have checked on Linux and the behaviour is different. Specifically the line feeds are being interpreted as expected, but all carriage returns are embeded as "
" (as reported in Comment 1).
I concurr with Comment 4 that this is a Windows bug, although the Linux behaviour is not what most would expect either.
Comment 9 Joel Madero 2015-05-02 15:43:10 UTC Comment hidden (obsolete)
Comment 10 Terrence Enger 2015-05-05 17:07:07 UTC
I no longer have wine available, so cannot do the test which I
reported in comment 2, but here is what I see with LibreOffice running on Windows Vista:

(*) Insert > Document brings in only the first line of Quiz.java.

(*) Copy from emacs 24.3.1 and paste into LibreOffice gives good

(*) Copy from Notepad Version 6.0 (Build 6002: Service Pack 2) gives
    one line, which I am retyping:

        import javax.microedition.midlet.*;","IBM"};

    with the cursor after the ending semicolon.  This is quite
    different from the results with Notepad under wine that I reported
    in comment 2.

    The imported line up to the first semicolon is the first line of
    Quiz.java.  The double-quoted comma appears many places in
    Quiz.java and the remainder of the line appears two places.

    When I save the result in a .fodt, the saved line appears as one
    line, which I am retyping here with added line breaks:

        <text:p text:style-name="P1">
          import javax.microedition.midlet.*;&quot;,&quot;IBM&quot;};

Comment 11 QA Administrators 2016-09-20 09:37:03 UTC Comment hidden (obsolete)
Comment 12 Terrence Enger 2016-12-11 20:39:14 UTC
I still get the results described in comment 11 using
bibisect-win32-5.3 repository commit 479ca41, source hash f8c463b3.
Comment 13 QA Administrators 2018-07-05 02:49:14 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2020-07-05 03:39:05 UTC
Dear Ankur Vishwakarma,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team