Bug 147279 - DDE link from Pivot Table to Writer loses CR and LF control characters
Summary: DDE link from Pivot Table to Writer loses CR and LF control characters
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.8.1 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-08 08:53 UTC by titanemdg
Modified: 2025-11-25 15:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description titanemdg 2022-02-08 08:53:23 UTC
Description:
When I do DDE link from a pivot table that cell contains CR+LF(windows) or LF(Unix)they become a space in the destination Writer document

Steps to Reproduce:
1.Create a pivot table in a sheet from a database table
2.Copy a cell that have a multi line and CR/LF (or LF unix)
3.Paste it in a Writer document as DDE link
4.Check the cell in the new table: it is flatten and CR/LF becomes a Space characters



Actual Results:
CR/LF becomes a Space character

Expected Results:
Do not modify CR/LF characters


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
If the paste is not a DDE then CR/LF are preserved. Paste in text editor preserves CR/LF
Comment 1 Mike Kaganski 2022-10-08 17:32:23 UTC
Code pointer:

This is done explicitly in ScServerObject::GetData [1]:

> aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );

No idea what could break - looks like there may be opposite expectations in some people, who prefer the current way, or maybe it's simply the code that is used in very different scenarios? Eike, do you have an idea?

[1] https://opengrok.libreoffice.org/xref/core/sc/source/ui/docshell/servobj.cxx?r=8930b1f6#195
Comment 2 Mike Kaganski 2022-10-09 15:26:00 UTC
Reading SwDDETable::ChangeContent [1], it may be even that it can't be changed at all: it seems that the format transferred over DDE is simply a text, where each table line is separated by newline, and each table cell is separated by a tab. And there's no escaping, like use of quotes in CSV.

[1] https://opengrok.libreoffice.org/xref/core/sw/source/core/fields/ddetbl.cxx?r=9fdb06d6#135
Comment 3 Mike Kaganski 2022-10-09 16:54:58 UTC
OTOH, when I enable DDE in Excel (see https://stackoverflow.com/questions/55868217), and put the following formula into a spreadsheet there:

="abc"&CHAR(9)&"def"&CHAR(13)&"ghi"

then run the following VBA from Word:

Sub DDETest()
  ch = DDEInitiate("Excel", "D:\Documents\DDETest.xlsm")
  s = DDERequest(ch, "R1C1")
  DDETerminate ch
  MsgBox s
End Sub

the text arriving from Excel is exactly

"abc	def
ghi"

including the double quotes. It actually looks to me that Excel uses normal TSV, with double quotes according to CSV standard...
Comment 4 Xisco Faulí 2025-03-04 11:33:13 UTC
Hello,
It's been a while since this issue 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 5 Barry L. Kramer 2025-04-05 14:11:16 UTC
Is this related to bug 119928 where I have just added clear (and simpler) instructions?
It seems to be similar and possibly caused by the same underlying issue.
Comment 6 QA Administrators 2025-10-03 03:13:56 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2025-11-25 15:32:55 UTC
Dear titanemdg,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp