Bug 154938 - Math Formulas inserted into Calc documents are stretched
Summary: Math Formulas inserted into Calc documents are stretched
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.0 beta1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Formula
  Show dependency treegraph
 
Reported: 2023-04-20 14:45 UTC by Rafael Lima
Modified: 2024-04-01 23:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of a formula in Calc (18.84 KB, image/png)
2023-04-20 14:45 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-04-20 14:45:24 UTC
Created attachment 186816 [details]
Screenshot of a formula in Calc

In Calc, when you insert a Math Formula into the document the formula is stretched and is using the wrong aspect ratio.

Steps to reproduce:
1) Create a new Calc document
2) Go to Insert - OLE Object - Formula Object
3) Create any formula, f.i. a+b=10
4) Notice that it is stretched

This problem only happens in Calc. In other modules the formula is rendered with the correct aspect ratio.

System info

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.5.2~rc2-0ubuntu0.22.10.1~lo1
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-04-20 17:00:14 UTC
Reproduced in:

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

Started in 7.4.

Bibisected with linux-64-7.4 to first bad commit 85498c936db1e2b64e77a1ac02a8eac791fe2f31 which points to core commit:

commit 96de6dee60aaf2f0d332291fa3b0ad7bb8b7127c
author	Rafael Lima <rafael.palma.lima@gmail.com>	Fri May 13 14:02:14 2022 +0100
committer	Mike Kaganski <mike.kaganski@collabora.com>	Tue May 17 13:37:46 2022 +0200
tdf#65067 Remove excessive spacing from Formula objects
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134185

Before the commit, width allocated to formula fit inside the cell, just enough for formula. After the commit, width is more than needed for the formula, and formula is stretched to fit inside it.

I won't copy you in I guess :)
Comment 2 Rafael Lima 2023-04-20 17:16:50 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> I won't copy you in I guess :)

Cool... my first regression ;-)

I'll look into it.
Comment 3 Rafael Lima 2024-04-01 14:08:21 UTC
I can no longer reproduce this bug in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 805b2e3ca7fdbc0c0e3037d2900c77d7474ac077
CPU threads: 12; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded

It seems to have been fixed along the way. Stéphane, can you confirm?
Comment 4 Stéphane Guillou (stragu) 2024-04-01 23:38:12 UTC
Thanks for retesting, Rafael.

I checked with linux-64-24.2 bibisect repo, it was fixed by Szymon.

- master commit is c6619100ed6d0524ac5294c1a9e1467a4371aee0
- which is cherrypicked from co-23.05:

commit 9fefa504be3e5ef28a5ef9a0dab7be7044def3c0
author	Szymon Kłos 	Fri Jul 07 11:54:02 2023 +0200
committer	Mike Kaganski 	Sun Jul 09 08:33:53 2023 +0200
math: set initial formula width to non-zero
After:
commit 96de6dee60aaf2f0d332291fa3b0ad7bb8b7127c
tdf#65067 Remove excessive spacing from Formula objects
Initial size of formula object is 1 (width).
This makes it ugly and hard to resize.
Let's make it bigger when it is empty.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154160

Thanks Szymon!