https://bugs.documentfoundation.org/show_bug.cgi?id=159052

            Bug ID: 159052
           Summary: line break '\n' is changed to '\r\n' when copy text
                    from shape
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 191791
  --> https://bugs.documentfoundation.org/attachment.cgi?id=191791&action=edit
Example for testing

Open attached document. It has a shape with text. The text has a line break
(shift+enter) between first and second line. To make this distinguishable from
a paragraph end (enter), the paragraphs in the shape and in the text are set to
5mm for paragraph distance after.

Bring the shape to edit mode, then mark the complete shape text and copy it to
clipboard. Leave the shape and paste the clipboard to the text in the document.
Use the format "unformatted text" for pasting.

Error: The line break before the word 'here' is turned into a paragraph end.

The error happens when copying to clipboard. When you use a clipboard viewer
(e.g. FreeClipViewer) you can see, that the characters between the words
'break' and 'here' are 0D 0A, but it should be 0A.

There are two reasons:
With the change from commit 5f6e5cb6 the paragraph end is set to LINEEND_LF in
https://opengrok.libreoffice.org/xref/core/editeng/source/editeng/impedit2.cxx?r=5f6e5cb6#277.
That has the effect, that '/n' is replaced with '/r/n'. I think, that changing
line#277 to use GetSystemLineEnd() instead of LINEEND_LF is necessary. But that
alone does not fix the error.

The next problematic part is in
https://opengrok.libreoffice.org/xref/core/tools/source/stream/stream.cxx?r=2b4094195#1856
Even if the incoming string in rIn has correctly '/n' between the words and
parameter eLineEnd has the (for me correct) '/r/n', the line break '/n' is
converted to a paragraph end '/r/n' in the tmpl_convertLineEnd() method.

But because I don't know what is needed for other OS than Windows, I will not
touch the code there.

I see the problem already in OOo2.3.1, so inherited.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to