Bug 170567 - Calc hangs when saving a new document which has cells pasted from Excel and the first row is empty
Summary: Calc hangs when saving a new document which has cells pasted from Excel and t...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.2.0.0 beta1+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.8.0 target:26.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-02 13:01 UTC by devseppala
Modified: 2026-02-10 11:32 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Video showing exact steps for getting Calc hang after copy paste from Excel (10.40 MB, video/webm)
2026-02-02 13:44 UTC, devseppala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devseppala 2026-02-02 13:01:02 UTC

    
Comment 1 devseppala 2026-02-02 13:42:29 UTC
Calc hangs when saving a new speadsheet document that has cells pasted from Excel and the first row is empty.

Steps to reproduce:

1. Open Excel and create a new spreadsheet document
2. Insert some data to cells "1", "2", "3", "4"
3. Copy the range
4. Open Calc and create a new spreadsheet document
5. paste the cells to anywhere but the first row
6. Try to save the Calc document
--> LO hangs/crashes

This seems to have started 26.2.0.0.beta1, but there it crashes even if cells are pasted to first row. On LO LO 26.2.0.1 the paste operation even refuses to complete ocasionally. LO 24.8.4 is completely free from this issue.

On LO 26.2.0.3 saving process does not hang or crash if the first row has some data typed in or the cell are pasted to the first row.

Watch the screencast I will attach to this report.

Version: 26.2.0.3 (X86_64)
Build ID: 620(Build:3)
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: fi-FI (fi_FI); UI: en-GB
Calc: CL threaded
Comment 2 devseppala 2026-02-02 13:44:29 UTC
Created attachment 205321 [details]
Video showing exact steps for getting Calc hang after copy paste from Excel

Video showing exact steps for getting Calc 26.2.0.3 hang after copy paste from Excel
Comment 3 Mike Kaganski 2026-02-02 18:59:43 UTC
Reproducible.
The hang is in ScXMLExport::ExportFormatRanges, which gets empty pRowFormatRanges, and doesn't advance the loop.
Comment 4 devseppala 2026-02-02 19:26:02 UTC
(In reply to Mike Kaganski from comment #3)
> Reproducible.

YESSS!! We are finally on the same page, thank you Mike!
Comment 5 Mike Kaganski 2026-02-03 15:03:08 UTC
https://gerrit.libreoffice.org/c/core/+/198609
Comment 6 Commit Notification 2026-02-03 17:56:33 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/17fb6ff6d163c7037e1c66d28c229473ab77717e

tdf#170567: Avoid resetting destination document's data

It will be available in 26.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 7 Commit Notification 2026-02-04 20:29:43 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/54e4ab489340480ddf63452deb1d753642ac5026

tdf#170567: Avoid resetting destination document's data

It will be available in 26.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.
Comment 8 devseppala 2026-02-10 11:32:21 UTC
I just installed 26.2.1.1 and tested this fix, saving a Calc document after copy/paste from Excel is working now.