Bug 82812 - Calc not responding for a while when trying to print - detect blocks of empty rows
Summary: Calc not responding for a while when trying to print - detect blocks of empt...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Keywords: perf
Depends on:
Blocks: Print-Dialog
  Show dependency treegraph
Reported: 2014-08-19 11:35 UTC by abma
Modified: 2019-08-26 08:58 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

document crashing calc when printing (17.46 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-08-19 11:35 UTC, abma
Screenshot with print dialog and one object in background. (217.93 KB, image/png)
2014-08-19 16:42 UTC, m.a.riosv

Note You need to log in before you can comment on or make changes to this bug.
Description abma 2014-08-19 11:35:42 UTC
Created attachment 104886 [details]
document crashing calc when printing

when printing the document, LO crashes!

to reproduce
file -> print

the print dialog never shows up!
Comment 1 sophie 2014-08-19 12:48:15 UTC
Hi, confirmed with and on Ubuntu 14.04 x64, I don't have a crash, but the dialog doesn't show up and I've to kill soffice. Set as new. Sophie
Comment 2 m.a.riosv 2014-08-19 16:42:38 UTC
Created attachment 104904 [details]
Screenshot with print dialog and one object in background.

Version: Build ID: 5fdddf655fba363e34f755715238d0943a44857e

Maybe the problem is with a lot of Draw objects all with the same name. In the last columns of the sheet. Deleting those objects works fine.

Doesn't crash for me, take like a minute with a high cpu usage to show the dialog.

Not clear for me it is a bug, can be the needed time to compose the preview that is showed in print dialog with such objects involved.
Comment 3 Caolán McNamara 2015-02-06 14:04:36 UTC
caolanm->erack: there is nothing in the document except a little at the top left and then some stuff at A1048523. And ScPrintFunc::CalcPages does a mega loop from 0 to 1048523 over every row. Is there no better way to loop over those in terms of some sparse array where the vast empty range can be collapsed together ?
Comment 4 Eike Rathke 2015-02-10 12:33:59 UTC
Ouch.. certainly there is a way to detect blocks of empty rows asking the column storage. The logic of when and how to include empty rows if requested and exclude hidden rows would have to remain though, but maybe the algorithm could be improved.
Comment 5 abma 2015-07-16 15:07:10 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2016-09-20 10:18:36 UTC Comment hidden (obsolete)
Comment 7 abma 2016-09-20 13:24:54 UTC still crashes.
Comment 8 Xisco Faulí 2017-02-28 12:43:39 UTC
Issue reproducible in

Id. de compilación: 7074905676c47b82bbcfbea1aeefc84afe1c50e1
Subpr. de CPU: 1; Versión de SO: Windows 6.1; Repr. de IU: predet.; Motor de trazado: HarfBuzz; 
Configuración regional: es-ES (es_ES); Calc: group


Build ID: bd8c68c99cce51a3368d8ddfd6e11dccb72d8f49
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 9 QA Administrators 2018-07-27 02:42:17 UTC Comment hidden (obsolete)
Comment 10 Timur 2018-08-16 12:53:54 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2019-08-19 07:01:42 UTC Comment hidden (obsolete)
Comment 12 Timur 2019-08-26 07:30:15 UTC Comment hidden (obsolete)
Comment 13 Timur 2019-08-26 08:58:22 UTC
First when I tried Print with 6.4+ in Windows, it was slow but it did print in the end. So I'll change "hangs" to "not responding".
Looking at comments 2, 3, 4 I'll change "Major" to "Enhancement".