Bug 81134 - EDITING: Chart size not retained when chart has empty data set
Summary: EDITING: Chart size not retained when chart has empty data set
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: low minor
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Chart
  Show dependency treegraph
Reported: 2014-07-10 00:27 UTC by Yousuf Philips (jay) (retired)
Modified: 2019-05-14 22:52 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

how it looks when you select the chart though its mini version is visible (83.09 KB, image/png)
2014-07-10 00:27 UTC, Yousuf Philips (jay) (retired)

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-07-10 00:27:26 UTC
Created attachment 102507 [details]
how it looks when you select the chart though its mini version is visible

Starting with LibO 4.0, if you create a chart, its default size is not retained after leaving the wizard, even though if you click in that area, it shows its size as if it was still there.
Comment 1 Joel Madero 2014-07-10 02:15:19 UTC
This only affects charts with empty data sets so really not a big deal. None the less a valid bug report :)
 ba6eb41acb8df58f3009920f8ab8b32a3e1b764e is the first bad commit
commit ba6eb41acb8df58f3009920f8ab8b32a3e1b764e
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Tue Dec 11 01:59:31 2012 +0000

    commit ae4e4a11d4300f7448cb6bd170fcb034542caddc
    Author:     Rene Engelhard <rene@debian.org>
    AuthorDate: Tue Nov 6 21:24:32 2012 +0100
    Commit:     Rene Engelhard <rene@debian.org>
    CommitDate: Tue Nov 6 21:24:32 2012 +0100
        Change-Id: I2c7968194afbcf74967cd16c639dce7de858a513

:100644 100644 c09b92a8ddf24b8738a7cd3a695ae1e4482d354c 6b13afd13f023cedac65a896318de4aa55dead27 M	autogen.log
:100644 100644 bcee1e11bd693642ca5a6330175b58082e5dcdd0 54d2377f5b3afd6ed668b3e24cb877c289119ec5 M	ccache.log
:100644 100644 75677cef16786d2cc95c0d8f301482278ca055c3 d18a6ebcd3b8537c3dd3dbc16e862fb6370ecb8a M	commitmsg
:100644 100644 83b4ecc0ecb3e031c804d49f45f854e95d5cc961 d482c00e5fff6081c6b87b637fd9ffaf3e1e2c6c M	dev-install.log
:100644 100644 91437b9974ffada7e049273419bb8c66c91c0539 abf45ab9609c77a5ab952aa310eafe8c2ffaf85c M	make.log
:040000 040000 45c0bab8b669778ab523c8f65a25e8c9afde604a f4bfa15b2f72d3df5675b07bcf32254a819b9d19 M	opt

# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# bad: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect bad e02439a3d6297a1f5334fa558ddec5ef4212c574
# good: [8f4aeaad2f65d656328a451154142bb82efa4327] source-hash-1885266f274575327cdeee9852945a3e91f32f15
git bisect good 8f4aeaad2f65d656328a451154142bb82efa4327
# bad: [9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02] source-hash-8600bc24bbc9029e92bea6102bff2921bc10b33e
git bisect bad 9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02
# good: [51b63dca7427db64929ae1885d7cf1cc7eb0ba28] source-hash-806d18ae7b8c241fe90e49d3d370306769c50a10
git bisect good 51b63dca7427db64929ae1885d7cf1cc7eb0ba28
# bad: [d65a58c31c8da044ef66ae4517fa2fe74cec0019] source-hash-2e053cf5ea4d93a2e1845e795a9c7fe1e08c84af
git bisect bad d65a58c31c8da044ef66ae4517fa2fe74cec0019
# bad: [79e02001f27d33b3b478324ab6fba5683413b4d9] source-hash-b6c016da23d309b4ac7d154bc33a22397974ed73
git bisect bad 79e02001f27d33b3b478324ab6fba5683413b4d9
# bad: [183a576d94de9a9439d580c8b81f335ab57cdbdc] source-hash-a599f5b4b51848e3b397d471c9d12b373caadcef
git bisect bad 183a576d94de9a9439d580c8b81f335ab57cdbdc
# good: [fae90325861bbddd2af90937d29d91637c96661a] source-hash-4316e643ef345b0f673b4a03a80a4b7cb3185588
git bisect good fae90325861bbddd2af90937d29d91637c96661a
# bad: [e5973caebe5b9637f93a4da008d76b33b9d5ff6a] source-hash-683758efb22d08a4cf211a6d985148f513da2a90
git bisect bad e5973caebe5b9637f93a4da008d76b33b9d5ff6a
# bad: [ba6eb41acb8df58f3009920f8ab8b32a3e1b764e] source-hash-ae4e4a11d4300f7448cb6bd170fcb034542caddc
git bisect bad ba6eb41acb8df58f3009920f8ab8b32a3e1b764e
# first bad commit: [ba6eb41acb8df58f3009920f8ab8b32a3e1b764e] source-hash-ae4e4a11d4300f7448cb6bd170fcb034542caddc
Comment 2 Cor Nouws 2014-07-10 05:45:18 UTC
Didn't I see a commit to repair this lately ??
Comment 3 Markus Mohrhard 2014-12-28 00:23:58 UTC
Do you mean that there is no data in the cells or that you made sure that the data range is an empty string?
Comment 4 Yousuf Philips (jay) (retired) 2014-12-28 07:46:15 UTC
I just clicked the chart button to see what it would do and pressed okay in the wizard to see what the result would be.
Comment 5 Matthew Francis 2015-01-04 06:09:12 UTC
This appears to have been fixed, and broken again since the bibisect range mentioned above. The most recent commit which broke it was the below.

Before this commit, the chart also shows sample data, whereas after it shows only a blank frame (until deselected, when the bug occurs).

commit ca843915505ed6fe6eee2639840cb1ad03a83992
Author: Markus Mohrhard <markus.mohrhard@collabora.co.uk>
Date:   Sun Jun 22 23:54:44 2014 +0200

    accept also one cell chart ranges for external data provider, fdo#79772
    Change-Id: I2078205b0aecdea13e342c4a625b82a70df0fb4f

(In case of any confusion, the reproduction steps for this are:
1. Create a blank spreadsheet
2. Click on the Chart icon
3. Click Finish
4. Click outside the chart to deselect it)
Comment 6 Robinson Tryon (qubit) 2015-12-13 11:11:03 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2016-09-26 16:00:05 UTC
Adding Cc: to Markus Mohrhard
Comment 8 Xisco Faulí 2017-09-29 08:49:50 UTC Comment hidden (obsolete)
Comment 9 Yousuf Philips (jay) (retired) 2017-10-22 19:46:15 UTC
Still present.

Build ID: 118a0a3734a3f794c67a9d7d4376d8ed78a96fee
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 10 QA Administrators 2018-10-23 02:48:08 UTC Comment hidden (obsolete)
Comment 11 Aron Budea 2019-04-19 14:27:59 UTC
Still occurs.

Build ID: daaef8cbe4d3a67996c6410c24eca19ecf0a810e
CPU threads: 16; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 12 Aron Budea 2019-04-26 15:44:40 UTC
Turns out the empty chart is still supposed to have the axes and markers, too.

The original regression is likely from this commit:
author		Michael Meeks <michael.meeks@suse.com>	2012-10-09 12:22:23 +0100
committer	Michael Meeks <michael.meeks@suse.com>	2012-11-06 11:58:16 +0000
commit 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70 (patch)
tree cfca2fb5cd4676d7d55648fe11105753c2178d5d
parent eff92f2501cf070cd912508b2ccc3c0108d0327c (diff)
"re-base on ALv2 code. Includes (at least) relevant parts of:"

In particular:
"fix for #118525#: Using primitives for chart sub-geometry visualisation"

Proposed patch: https://gerrit.libreoffice.org/71361/

The problem is that sizes are converted to tools::Rectangle, and 0 size becomes a special RECT_EMPTY value (-32767). This -32767 value isn't converted back, and the chart area instead of spanning from [0, 0] to [16000, 9000] becomes spanning from [-32767, -32767] to [16000, 9000].

A straightforward place to fix it would be in SvxShape::getSize(), but that isn't enough in itself, the area size still remains incorrect.

Instead, the above patch is a small workaround to make empty labels have 1x1 size.
Comment 13 Aron Budea 2019-05-07 10:54:07 UTC
Further bibisect results. This issue was first fixed with the following commit:
author		Muthu Subramanian <sumuthu@suse.com>	2013-07-25 11:19:53 +0530
committer	Muthu Subramanian <sumuthu@suse.com>	2013-07-25 11:28:13 +0530

n#827332: Charts shrink when there are no legends.

And then reintroduced in the following range, with the addition of the empty chart becoming an empty rectangle (builds crash in between):
Comment 15 Aron Budea 2019-05-14 18:09:22 UTC
The size is fixed, but it's still an empty rectangle.

Build ID: 4cac171dd6c82f55624ba6e7185d69bcb5507cb1
CPU threads: 16; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 16 Xisco Faulí 2019-05-14 22:12:09 UTC
(In reply to Aron Budea from comment #15)
> The size is fixed, but it's still an empty rectangle.
> Version:
> Build ID: 4cac171dd6c82f55624ba6e7185d69bcb5507cb1
> CPU threads: 16; OS: Linux 4.15; UI render: default; VCL: gtk3; 
> Locale: en-US (en_US.UTF-8); UI-Language: en-US
> Calc: threaded

That's another problem.

Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

I can reproduce this bug but not the one you're mentioning... I'll report it in a different ticket
Comment 17 Xisco Faulí 2019-05-14 22:52:13 UTC
Reported in bug 125291