Bug 152087 - chart element selection dropdown text is misaligned (GTK3)
Summary: chart element selection dropdown text is misaligned (GTK3)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.0.6.2 release
Hardware: All All
: low minor
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.4
Keywords: bibisectRequest, regression
Depends on:
Blocks: GTK3 Calc-Toolbars
  Show dependency treegraph
 
Reported: 2022-11-17 15:17 UTC by Stéphane Guillou (stragu)
Modified: 2022-11-21 10:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
issue highlighted in red rectangle (32.81 KB, image/png)
2022-11-17 15:17 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) 2022-11-17 15:17:21 UTC
Created attachment 183645 [details]
issue highlighted in red rectangle

With a specific document, the toolbar dropdown for selecting a chart element doesn't have vertically centered text and arrow, and the expanded list has unnecessary space below the available elements.

Steps:

1. Open attachment 101450 [details]
2. Double-click on the chart to enter chart edit mode
3. Click on a chart element

Actual result:
In the toolbar, the select Chart Element dropdown has uncentered text, and extra unnecessary at the bottom of the choice list.

Expected result: 
Centered text like in default toolbar dropdowns; no empty space.

Note that I couldn't reproduce using a new document, so might have to do with that particular chart. This can also be seen in e.g. Write by copy-pasting the same chart.

Reproduced in:

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

and

Version: 7.0.6.2
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

But not in:

Version: 6.4.7.2
Build ID: 639b8ac485750d5696d7590a72ef1b496725cfb5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Caolán McNamara 2022-11-17 15:47:20 UTC
I think its because of one specific entry with a newline in it:

Data Series 'Val3
Vert-Rouge'

and gtk reserved space for the 2nd line
Comment 2 Stéphane Guillou (stragu) 2022-11-17 15:52:02 UTC
(In reply to Caolán McNamara from comment #1)
> I think its because of one specific entry with a newline in it:
> 
> Data Series 'Val3
> Vert-Rouge'
> 
> and gtk reserved space for the 2nd line

Sounds like it, thanks Caolán. LO 6.4 looks like it used to simply strip the newline, so all names would only take one line. Maybe a better solution would be to replace newlines with spaces.
Comment 3 Caolán McNamara 2022-11-17 16:39:05 UTC
yeah, that's the plan: https://gerrit.libreoffice.org/c/core/+/142896

FWIW the 6.4 era combobox was a vcl one, drawn themed to look like gtk ones. While the 7.0 onwards one is a real gtk one. So there wasn't a specific change to how newlines are handled in comboboxes, but a change in which combobox implementation was used.
Comment 4 Commit Notification 2022-11-17 19:33:44 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e29418c582f15595d804fb499b9635e8545f1506

Resolves: tdf#152087 strip any newlines from the entry

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 5 Caolán McNamara 2022-11-17 19:39:56 UTC
done in trunk, backport to 7-4 in gerrit
Comment 6 Stéphane Guillou (stragu) 2022-11-18 16:42:00 UTC
Fabulous, thanks for the very quick fix, Caolán!

Verified in:

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 45d1fca81991f0d6837c98d6be6fe0d21d566fa5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 7 Commit Notification 2022-11-21 10:23:25 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/8f23544311f6593ad46c503524be2508fd784c71

Resolves: tdf#152087 strip any newlines from the entry

It will be available in 7.4.4.

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.