Bug 154090 - Pasting a large drawing object from outside a chart into a chart can make it go beyond the chart area.
Summary: Pasting a large drawing object from outside a chart into a chart can make it ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Chart Shapes
  Show dependency treegraph
 
Reported: 2023-03-09 10:14 UTC by Stéphane Guillou (stragu)
Modified: 2023-03-30 13:26 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test document (20.81 KB, application/vnd.oasis.opendocument.text)
2023-03-09 10:14 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-03-09 10:14:00 UTC
Created attachment 185855 [details]
test document

Steps:

1. Open Writer or Calc
2. Insert > Chart (use defaults)
3. Exist chart editing mode
4. Draw a drawing object (e.g. a line) that is wider than the width of the chart area, copy it
5. Enter chart edit mode and paste the drawing object

(or use attachment to directly copy-paste object into chart)

Results:
Object overflows, goes beyond the chart area. This means that at least one of the handle is not reachable, and that the rest of the chart is scaled down to fit the drawing object when exiting edit mode.

Expected:
Drawing object is scaled down to fit the chart area.

Notes:
- Also reproducible with pasting a Fontwork object
- MS Office, when following the same steps, scales down the object so it fits in the chart area.
- We already make it hard to end up with a drawing object bigger than the chart area, by blocking movement when it reaches the edges, and by automatically resetting size values when change by hand.
- If this is fixed, Bug 154065 would probably also be fixed (unless there is another way to end up with an overflowing drawing object)
- We need to consider what to do with files that already have this kind of chart. MS Office removes the overflowing object from the chart at fileopen (tested both ODF and OOXML), which makes this issue a risk of dataloss. I feel like scaling it down is less problematic, and would be consistent with what should happen when pasting it in.

Repro in:

Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group

And in recent master build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 288c0920a8475f9f2c537212e04aa7649192ad8c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

In OOo 3.3, we could already paste the unchanged object in the chart, but the chart would not be squished when exiting edit mode.

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)
Comment 1 V Stuart Foote 2023-03-09 15:09:46 UTC
> Expected:
> Drawing object is scaled down to fit the chart area.

Or the extent of the "chart" needs to expand, so the full set of objects (and things like calculated text placement) is carried into the paste.
Comment 2 V Stuart Foote 2023-03-09 15:13:12 UTC
Seems there would be several ways to adjust things:

Can increase the extent of the "chart"

Can clip/trim the objects that extend beyond base extent of the "chart"

Can scale the object to bring its end points within the "chart"

The least "jarring" would be to extent the extent of the chart and deliver the same draw object(s) with the pasted chart.
Comment 3 Buovjaga 2023-03-30 11:13:42 UTC
Repro

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2ca71b5c6e0374254e7c75c75e54fa6a8caebfde
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 30 March 2023
Comment 4 V Stuart Foote 2023-03-30 13:26:40 UTC
Seems related to bug 145599 and its dupes. Something not fully correct with its tweak?  https://gerrit.libreoffice.org/c/core/+/143526