Bug 159049 - Line break is missing in RTF in clipboard when copying text from shape
Summary: Line break is missing in RTF in clipboard when copying text from shape
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:24.8.0 target:24.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-06 18:40 UTC by Regina Henschel
Modified: 2024-01-12 09:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example to reproduce the problem (11.69 KB, application/vnd.oasis.opendocument.text)
2024-01-06 18:40 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2024-01-06 18:40:34 UTC
Created attachment 191789 [details]
Example to reproduce the problem

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 "Rich text format" for pasting.

Error: The line break before the word 'here' is missing.

The error happens when copying to clipboard. When you use a clipboard viewer (e.g. FreeClipViewer) you can see, that the RTF markup has '/sl' instead of '/line'.

The error happens in https://opengrok.libreoffice.org/xref/core/editeng/source/editeng/impedit4.cxx?r=de385412#908
Comment 1 m_a_riosv 2024-01-06 23:18:02 UTC
Reproducible.
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 25276df12abd9d002f7f899900434617b256f745
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 2 Regina Henschel 2024-01-09 20:56:31 UTC
Start is in https://gerrit.libreoffice.org/c/core/+/161842
Comment 3 Commit Notification 2024-01-11 23:13:34 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c994f2491dd4e977f726f53de1953feff17c2227

tdf#159049 use RTF_LINE for EE_FEATURE_LINEBR for copy

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2024-01-12 09:35:29 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/f5431af083eb1cde85505dddf19600a7b8f52020

tdf#159049 use RTF_LINE for EE_FEATURE_LINEBR for copy

It will be available in 24.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.