Issue 119504 - [From Symphony] Calc offers SYLK clipboard format even when a cell's text is >255 chars long -> can't copy from AOO, paste to excel
Summary: [From Symphony] Calc offers SYLK clipboard format even when a cell's text is ...
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: 3.4.0
Hardware: PC Windows, all
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 07:24 UTC by Terry Yang
Modified: 2023-01-14 15:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.13
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Terry Yang 2012-05-29 07:24:58 UTC
Detail Steps:
  1.User new a document with AOO Spreadsheet.
  2.User write a long word in a cell in SpreadSheet.Such as "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjaaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjaaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee123456".This word's length is 256.
  3.User select the cell, and click Ctrl+C.  Attention:Don't doubleclick to select the cell's content.
  4.User open ms excel, new a sheet. Select one cell, then click Ctrl+V.


Problem occurred:
  Nothing happened. The selected cell's content can not be pasted to Excel's cell.

Additional attention:
  If the same operation from Excel to AOO, everything is OK.
Comment 1 damjan 2023-01-14 15:36:40 UTC
Also present in 4.1.13, probably all other versions.

If you press F2, and Ctrl+A to select the cell's text, and then Ctrl+C to copy, it pastes fine in Excel. Only if you Ctrl+C the cell itself, is there a 255 character limit when pasting.

The cause can be determined by Excel's "Paste special", and trying each different format:

"Text" pastes all 256 characters correctly.
"Unicode Text" pastes all 256 characters correctly.
"HTML" pastes all 256 characters correctly.
"DIF" pastes all 256 characters correctly.
"SYLK" BREAKS, pasting nothing if there are > 255 characters!!!

According to Wikipedia's page:
https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK)

"Each line of a SYLK input file must be no longer than 260 characters. Otherwise, Microsoft Excel will issue an error message and skip loading the overlong line."

and

".slk file exports opened with Excel have a limit of 255 characters in a cell."


So the problem is that Calc is offering the SYLK clipboard format to Excel even for data which cannot be safely transferred using that format.

I wonder why it works when you select the text directly (F2 and Ctrl+A), possibly it goes through a different code path that is smarter and doesn't offer SYLK.



Workaround: use Excel's "Paste Special" and paste in a format other than SYLK.
Comment 2 damjan 2023-01-14 15:50:41 UTC
Oh and the reason pasting > 255 chars works when you F2 and Ctrl+A Ctrl+C instead, is that only "Text" and "Unicode Text" clipboard formats are offered by Calc, SYLK isn't.