Bug 124341 - Calc hangs on Format > Autoformat Styles
Summary: Calc hangs on Format > Autoformat Styles
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords: perf
Depends on:
Blocks: Table-AutoFormat
  Show dependency treegraph
 
Reported: 2019-03-27 08:46 UTC by atype
Modified: 2024-07-31 04:39 UTC (History)
5 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 atype 2019-03-27 08:46:28 UTC
Performing Format > Autoformat Styles and choosing any style on blank document causes Calc hang with high CPU usage.

To trigger the reported bug:
1) Open blank document
2) Edit > Select All
3) Format > Autoformat > Any style

Selecting only part of the document works as intended.
Comment 1 Telesto 2019-03-27 18:29:48 UTC
Repro
Version: 6.3.0.0.alpha0+
Build ID: 20ea90a557b5bc744fd234e3a20ab1db484cf88b
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-03-22_03:21:58
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: threaded

and with 4.4.7.2

-> I leave it unconfirmed of now; not sure if this qualify's
Comment 2 Oliver Brinzing 2019-03-28 17:41:57 UTC
already reproducible with AOO 4.1.5.

possible fix:
a warning could appear in case a huge number cells was selected
Comment 3 Buovjaga 2021-05-03 10:59:27 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2021-05-03 11:04:47 UTC Comment hidden (obsolete)
Comment 5 Mike Kaganski 2024-07-30 05:10:57 UTC
https://gerrit.libreoffice.org/c/core/+/171223
Comment 6 Commit Notification 2024-07-31 04:22:32 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/42f44a42b625002c8f0e4e832ec457481d89a54c

tdf#124341: special-case applying autoformat to whole rows

It will be available in 25.2.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 Mike Kaganski 2024-07-31 04:31:45 UTC
Now it should be thousands of times faster for all-sheet case, than for all-columns-except-last (which would still hang). Also, it won't help with the "Simple Grid Columns" format, where the pattern is columnar (and it would likewise fail for a checkerboard pattern).

There's nothing more I can do here. It's not resolver definitively. So let me unassign myself, and keep it NEW for the other improvements, if people have good ideas.
Comment 8 Mike Kaganski 2024-07-31 04:39:12 UTC
An implementation note: this fix assumes, that when a user selects whole rows (and the whole sheet as a special case for that), then the user doesn't need the rightmost specially formatted column (which in this case would be column XFD). This would change e.g. how the "Default" format looks (see its "Total" rightmost column, which would not appear in whole-rows selection now), and for all the formats with outer border (because that border is defined as special formatting of outer cells, including rightmost column), so they would loose the right border. Hope that is a sane assumption, that shouldn't break any workflow in practice.