Download it now!
Bug 118466 - EDITING: Clicking the Sum toolbar button (Σ) after using Select All gives unexpected results
Summary: EDITING: Clicking the Sum toolbar button (Σ) after using Select All gives une...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-30 02:58 UTC by Raymond Wu Won
Modified: 2020-04-30 21:59 UTC (History)
4 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 Raymond Wu Won 2018-06-30 02:58:31 UTC
Description:
The toolbar button for Sum (Σ) should sum up only the contents of the filled-cells and output to an adjacent area instead of the extreme corners for the entire worksheet.

This operation as currently implemented also takes longer than is necessary because instead of summing only the contents of a few cells, it tries to work on the entire sheet (1023 columns x 1048575 rows).

Steps to Reproduce:
1. Enter in 1 and 1 in separate rows in a new sheet (Cells A1 and A2).

2. Select All using any method (Edit > Select All / Ctrl+A / Cmd+A / Ctrl+Shift+Space).

3. Click the Sum button (Σ) in the toolbar (to the left of the Formula Input line).

Actual Results:
- Calc will try to work on the entire sheet.

- Outputs will be entered into each corner of the sheet (use Ctrl+Arrow or Cmd+Arrow to jump to the end of the sheet): Cells AMJ1, AMJ2, AMJ1048576 and A1048576.

- The operation will take a long time and force one CPU core to be at 100% for about 12 seconds in 6.1.0.0.beta2 and 18 seconds in 6.0.5.2 with an Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz) (as reported by lscpu).

- It will appear to the user as if LibreOffice Calc has frozen.

Expected Results:
In this example the calculation should only be applied to the filled cells and result should output to Cell A3 only.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Tested with LibreOffice 6.0.5.2 and 6.1.0.0.beta2 on both Fedora 28 and macOS 10.13.5 - I believe the behaviour in Windows will be the same (to be confirmed).

While the user will quickly learn to not press the Sum after a Select All again, Gnumeric and Excel both correctly lead the user to summing and outputting to A3. Interestingly, Google Sheets and Apple Numbers also have less desirable outcomes (but no CPU spikes).

With Calc, the user might think Calc has hung and might forcibly terminate it - potentially leading to data loss.

A previous version on Mac (I believe 6.0.1) was also tested and showed completely different totals - so this may or may not be of interest.
Comment 1 Buovjaga 2018-07-13 19:42:09 UTC
Reproduced already with 3.3.0. Seems like a relevant thing to change.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: bd394492c165d27c96a44495d9ca694a242acb8f
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on July 11th 2018

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Jean-Baptiste Faure 2018-07-22 20:50:19 UTC
Not sure if that is a bug. Instead of selecting all cells, try to select only A5:C5 and press the sum button. The result is the sum at end of each row and each column of the range.

Help for LO 6.0 says:
Inserts the sum of a cell range into the current cell, or inserts sum values into selected cells. Click in a cell, click this icon, and optionally adjust the cell range. Or select some cells into which the sum values will be inserted, then click the icon.
https://help.libreoffice.org/6.0/en-US/text/scalc/main0206.html

Best regards. JBF
Comment 3 QA Administrators 2019-07-30 03:14:16 UTC Comment hidden (obsolete)
Comment 4 Roman Kuznetsov 2020-04-30 21:59:03 UTC
(In reply to Jean-Baptiste Faure from comment #2)
> Not sure if that is a bug. Instead of selecting all cells, try to select
> only A5:C5 and press the sum button. The result is the sum at end of each
> row and each column of the range.
> 
> Help for LO 6.0 says:
> Inserts the sum of a cell range into the current cell, or inserts sum values
> into selected cells. Click in a cell, click this icon, and optionally adjust
> the cell range. Or select some cells into which the sum values will be
> inserted, then click the icon.
> https://help.libreoffice.org/6.0/en-US/text/scalc/main0206.html
> 
> Best regards. JBF

I agree with Jean-Baptiste, it is absolutely right behavior in Calc