Bug 150302 - Toggle SameLetterHeights does not work if property not initialized
Summary: Toggle SameLetterHeights does not work if property not initialized
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium minor
Assignee: Matt K
URL:
Whiteboard: reviewed:2022 target:24.2.0
Keywords: difficultyMedium, easyHack
Depends on:
Blocks:
 
Reported: 2022-08-08 12:52 UTC by Regina Henschel
Modified: 2023-07-26 21:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Fontwork shapes for testing (44.59 KB, application/vnd.oasis.opendocument.graphics)
2022-08-08 12:52 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-08-08 12:52:51 UTC
Created attachment 181653 [details]
Fontwork shapes for testing

Open attached file. It contains two Fontwork shapes. Click on such shape. That should open the "Fontwork" toolbar. Click on icon "SameLetterHeights" (=.uno:FontworkSameLetterHeights). 
Error: Nothing happens
Expected: The shape shows the characters vertical stretched to fit the place between the paths.

The property SameLetterHeights corresponds to the ODF attribute draw:text-path-same-letter-heights. If you add the attribute in the file markup, the command works as expected. But the ODF attribute is optional, so it is valid, that it is missing.
Comment 1 Regina Henschel 2022-08-08 13:14:38 UTC
The error is in case SID_FONTWORK_SAME_LETTER_HEIGHTS in impl_execute method in https://opengrok.libreoffice.org/xref/core/svx/source/toolbars/fontworkbar.cxx?r=4c0b033e#242
The else part is missing.
Since the icon has a .uno command, a unit test is possible using the dispatcher.

@Hossein: I think, this can be an EasyHack. Do you agree?
Comment 2 Hossein 2022-08-08 20:26:01 UTC
Reproduced with the latest LO 7.5 dev master:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: cc3e2e7efa35dea85eecdd163de1ca1e71ce01f7
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 3 Hossein 2022-08-08 20:40:38 UTC
(In reply to Regina Henschel from comment #1)
> The error is in case SID_FONTWORK_SAME_LETTER_HEIGHTS in impl_execute method
> in
> https://opengrok.libreoffice.org/xref/core/svx/source/toolbars/fontworkbar.
> cxx?r=4c0b033e#242
> The else part is missing.
> Since the icon has a .uno command, a unit test is possible using the
> dispatcher.
> 
> @Hossein: I think, this can be an EasyHack. Do you agree?

Yes! And thanks for suggesting this issue for an EasyHack.

I've tested your code pointer, and the fix is straightforward. On the other hand, I think it should be marked as difficultyMedium, because one needs to gain a basic understanding of ODF and the draw:text-path-same-letter-heights attribute and change it manually inside <draw:enhanced-geometry> to see its effect, then fix the code and write a test similar to some of those in sd/qa/unit/uiimpress.cxx.

This is the related part of the ODF 1.3 standard for the above attribute:

Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 3: OpenDocument Schema
OASIS Standard - 27 April 2021
19.224 draw:text-path-same-letter-heights
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1417288_253892949
Comment 4 Hossein 2022-08-17 22:34:35 UTC
I've written a blog post around this issue that can be useful for the EasyHackers:

ODF standard and the code – EasyHack
https://dev.blog.documentfoundation.org/2022/08/16/odf-standard-and-the-code-easyhack/
Comment 5 Matt K 2023-07-13 20:48:01 UTC
Fix tracked in https://gerrit.libreoffice.org/c/core/+/154402.  Added Regina and Hossein to the review.
Comment 6 Commit Notification 2023-07-20 14:13:14 UTC
Matt K committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/58a4459627a92958ef133868f72af10d8d56ccad

tdf#150302 Fix FontworkSameLetterHeights button in Draw

It will be available in 24.2.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 7 Hossein 2023-07-26 21:36:01 UTC
Fixed in the latest LO 24.2 dev master:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ec912956903b2657f4a6b67a68c2687e8be32508
CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded