Bug 127251 - Copy from Calc to Writer loses formatting if there is a chr(10) in a cell
Summary: Copy from Calc to Writer loses formatting if there is a chr(10) in a cell
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-31 12:15 UTC by Mike Sapsard
Modified: 2020-05-11 14:18 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Calc spreadsheet with macro (72.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-08-31 12:18 UTC, Mike Sapsard
Details
Simple macro that shows correct working with 6.3.1.1 (11.32 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-08-31 13:59 UTC, Mike Sapsard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Sapsard 2019-08-31 12:15:24 UTC
Description:
A macro is needed to add formatting to cells copied within Calc (because formuli cannot transfer formatting). Usually such a cell can be copied from Calc to Writer. However, if there is a chr(10) or chr(13) line break in the cell the formatting is not copied into Writer.

Steps to Reproduce:
1.Run macro in uploaded Calc file.
2.Copy result and paste into Writer table or page.
3.

Actual Results:
All formatting in pasted cells is lost

Expected Results:
Formatting should have been copied.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Mike Sapsard 2019-08-31 12:18:57 UTC
Created attachment 153777 [details]
Calc spreadsheet with macro

Demo of chr(10) and chr(13) bug preventing transfer of formatting from Calc to Writer.
Comment 2 Mike Kaganski 2019-08-31 12:37:14 UTC
Please be more specific what needs to be done to reproduce.

Currently I am unable to reproduce using Version: 6.3.1.1 (x64)
Build ID: e979878b49a48dab15ebe528f238b88125e32c65
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

like this:
1. Opened the attachment 153777 [details], accepted macros
2. Switched to sheet "Digest Output"
3. Made sure that Tools->Forms->Design Mode is disabled; clicked "Bold Names and Places" buton; waited and closed final message box.
4. Single-clicked A3 having the following text:
> 003  Antiques and Collectables 
> St Johns Church Hall, Boxmoor, HH
where whole first line, "Boxmoor", and "HH" are bold
5. Ctrl+C
6. Switched to Writer; pasted as RTF.

It transferred the bold fine.
Comment 3 Mike Sapsard 2019-08-31 12:42:11 UTC
I'll update LO and report back.
Comment 4 Mike Sapsard 2019-08-31 13:56:42 UTC
I still have the problem with the file I sent in, when using 6.3.1.1. (I accidentally sent the wrong one.) However, with 6.3.1.1 the simple second attachment works perfectly when pasted as RTF.
Comment 5 Mike Sapsard 2019-08-31 13:59:24 UTC
Created attachment 153781 [details]
Simple macro that shows correct working with 6.3.1.1

This one works on my PC, with 6.3.1.1, so I'll try changing a few things in my working file.
Comment 6 Jean-Baptiste Faure 2020-03-31 20:04:24 UTC
I did the same test as Mike and obtained the same result.
Some thing is weird: in Writer the font for the bold part of the second line is Lohit Devanagari instead of Liberation.

Version : 7.0.0.0.alpha0+
Build ID : 90c807bfd1fe65e3c94199fd1cd47df711a47d42
Threads CPU : 4; OS : Linux 4.15; UI Render : par défaut; VCL: gtk3; 
Ubuntu_18.04_x86-64
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded

Best regards. JBF
Comment 7 raal 2020-04-10 05:58:13 UTC
tested with Version: 7.0.0.0.alpha0+
Build ID: 95dbfd517240666e5b9a9fd7ac1d47d799235a62
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

Tested ctrl+c, ctrl+v and paste as RTF.
Formatting is correct, only font of words "Boxmoor, HH" is Lohit Devanagari
Comment 8 Xisco Faulí 2020-05-11 13:59:57 UTC
Hello Mike,
A new major release of LibreOffice is available since this bug was reported.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 9 Mike Sapsard 2020-05-11 14:18:23 UTC
It works in 6.4.3.
The cut and paste operations are now very good.