Bug 151842 - Font "Base size" reverts to sm config default of 12pt after reloading any formula (OLE object and standalone document)
Summary: Font "Base size" reverts to sm config default of 12pt after reloading any for...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0
Keywords: bibisected, bisected, filter:odf, regression
Depends on:
Blocks:
 
Reported: 2022-10-31 11:56 UTC by Mike Kaganski
Modified: 2022-12-02 12:58 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
ODF Formula with a Size {} value and UI Base size (6.69 KB, application/vnd.oasis.opendocument.formula)
2022-12-01 17:07 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-10-31 11:56:13 UTC
Since commit 9b7600f547cec9ed1bacca3a1b995b3c33fd5723
  Author dante <dante19031999@gmail.com>
  Date   Wed May 11 12:08:52 2022 +0200
    Connect new import / export to starmath

the custom font size is lost when saving and reloading the formula document.

1. Create a new Math document;
2. Set Format->Font Size->Base size to some custom value, e.g. 112;
3. Type something as the formula text, e.g. "123";
4. Save as ODF and reload.

=> the font base size resets to 12, the formula text is small again.

This affects also Math OLE objects: inserting a formula to Writer document, configuring the font size, saving Writer document, reloading it, and entering the formula resets its custom font size, and changes the object rectangle size.
Comment 1 Mike Kaganski 2022-11-25 13:30:39 UTC
Note that this is a data loss. Also other formula properties are lost: e.g., borders.
Comment 2 csyu.279 2022-11-27 18:20:25 UTC
I was able to reproduce the bug in the unstable build: 
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5a1f41a0d3aab15c113651f2edc9d4137ae99063
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

However I was unable to reproduce the bug in the stable build:
Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 3 Miklos Vajna 2022-11-30 13:56:13 UTC
Given that it seems Dante isn't really active today and this is towards some long-term goal, perhaps the best is to revert it for now (if that's reasonably straightforward).
Comment 4 Xisco Faulí 2022-12-01 15:33:41 UTC
(In reply to Miklos Vajna from comment #3)
> Given that it seems Dante isn't really active today and this is towards some
> long-term goal, perhaps the best is to revert it for now (if that's
> reasonably straightforward).

Done in https://gerrit.libreoffice.org/c/core/+/143534
Comment 5 V Stuart Foote 2022-12-01 17:07:34 UTC
Created attachment 183946 [details]
ODF Formula with a Size {} value and UI Base size

Confirming an issue

When using the Size {} notation --XML mystyle "mathsize"-- to set node size persists. As does using the 'Font Size...' dialog to set the "Base size:" value  

It is recorded to ODF.

   <config:config-item config:name="BaseFontHeight" config:type="short">80</config:config-item>

And it is only on reopening in a master against 7.5 that the default reasserts. The formula opens correctly on 7.4.3 setting expected Base size.

=-testing-=

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 958c08ad86d56839faf28a02097500bad7b1eb76
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 6 V Stuart Foote 2022-12-01 17:26:04 UTC
@Xisco Not clear simple reversion of that one commit is the best thing here.

There were a lot of *additional* changes to the sm import and export framework around

https://gerrit.libreoffice.org/c/core/+/120753

It is exporting correctly. Maybe better to let it ride, and tweak the glitch in the importer?
Comment 7 Xisco Faulí 2022-12-01 20:30:12 UTC
(In reply to V Stuart Foote from comment #6)
> @Xisco Not clear simple reversion of that one commit is the best thing here.
> 
> There were a lot of *additional* changes to the sm import and export
> framework around
> 
> https://gerrit.libreoffice.org/c/core/+/120753
> 
> It is exporting correctly. Maybe better to let it ride, and tweak the glitch
> in the importer?

yes, reverting the issue fixes the issue.
I think for now it's better to revert it, I can always be reintroduced again in the future
Comment 8 Commit Notification 2022-12-02 10:36:53 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9939ffb9b87e536b3217232b732218e82126ad6c

tdf#151842: Revert "Connect new import / export to starmath"

It will be available in 7.5.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 9 Commit Notification 2022-12-02 12:58:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/47d549c015d53b84b4f98c144c1b49378d027a4d

tdf#151842: starmath_import: Add unittest

It will be available in 7.5.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.