Bug 148477 - Some Chinese characters in Calc's Status Bar are missing on Fedora 35
Summary: Some Chinese characters in Calc's Status Bar are missing on Fedora 35
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.6.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2022-04-09 09:04 UTC by Kevin Suo
Modified: 2024-03-05 04:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot in pdf showing the problem (39.69 KB, application/pdf)
2022-04-09 09:04 UTC, Kevin Suo
Details
screenshot (113.05 KB, image/png)
2022-05-02 23:39 UTC, enhua_2008
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2022-04-09 09:04:31 UTC
Created attachment 179422 [details]
screenshot in pdf showing the problem

Steps to Reproduce:
1. Switch to Simplified Chinese UI.
2. Launch Calc, go to the status bar at the bottom.

Current Result:
The Chinese characters for "Sheet 1 of 1", "Selected xx rows, xx columns", "English (USA") are missing, only the numbers are shown.

Expected Result:
The localized Chinese characters for these strings should appear fully in the status bar.

See attached PDF for the problem.

This seems ok when I was using Fedora 34. Several days ago after I upgraded to Fedora 35, I see the problem.

I also see that someone else has reported a similar problem in bug 148470 which is on macOS.

Version: 7.2.6.2 / LibreOffice Community
Build ID: b0ec3a565991f7569a5a7f5d24fed7f52653d754
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Calc: threaded
Fedora 35 x64, Lenovo ThinkPad X1 Carbon Gen 8, Intel® Core™ i5-10210U CPU @ 1.60GHz × 8 , Mesa Intel® UHD Graphics (CML GT2)
Gnome 41.5, reproduced both on X11 and Wayland.

Also in 7.3 branch and master.
Comment 1 Kevin Suo 2022-04-09 09:06:43 UTC
I have bibisected to the following range:
d697e792c5b4 (optimize SalLayoutGlyphs for the common case, 2021-03-16)
7439cabc643d (make SalLayoutGlyphs work with MultiSalLayout, 2021-03-16)
9d02d86e8a91 (do not disable Writer font caching on zoom mismatch, 2021-03-12)

Adding Luboš Luňák to cc: would you please take a look? Thanks.
Comment 2 Caolán McNamara 2022-05-02 20:30:41 UTC
FWIW if in vcl/source/window/status.cxx I set pGlyphs = nullptr; before line 404 Size aTextSize(rRenderContext.GetTextWidth... then it renders ok
Comment 3 enhua_2008 2022-05-02 23:36:13 UTC
If in vcl/source/window/status.cxx I set pGlyphs = nullptr; before line 404 Size aTextSize(rRenderContext.GetTextWidth...  on macOS the problem is basically solved except the "Edit Mode" area, maybe because the width is not suitable.
Comment 4 enhua_2008 2022-05-02 23:39:21 UTC
Created attachment 179894 [details]
screenshot
Comment 5 enhua_2008 2022-05-02 23:41:39 UTC
(In reply to Caolán McNamara from comment #2)
> FWIW if in vcl/source/window/status.cxx I set pGlyphs = nullptr; before line
> 404 Size aTextSize(rRenderContext.GetTextWidth... then it renders ok
On macOS the problem is basically solved except the "Edit Mode" area, maybe because the width is not suitable. The screenshot to see https://bug-attachments.documentfoundation.org/attachment.cgi?id=179894
Comment 6 enhua_2008 2022-05-02 23:54:06 UTC
(In reply to Caolán McNamara from comment #2)
> FWIW if in vcl/source/window/status.cxx I set pGlyphs = nullptr; before line
> 404 Size aTextSize(rRenderContext.GetTextWidth... then it renders ok
For Impress and draw, the "slide 1 of 1" area is not wide enough to display Chinese characters.
Comment 7 Caolán McNamara 2022-05-03 11:33:49 UTC
I think our problem here is the MultiSalLayout. we start with a GenericSalLayout with 11 glyphs, where there are 6 missing and end with a MultiSalLayout with two sub GenericSalLayouts, the orig with 11 glyphs with 6 missing, and another with 6 glyphs. Then we call MultiSalLayout::ImplAdjustMultiLayout which calls mpLayouts[0]->Simplify( true ) so we now have a MultiSalLayout with two sub GenericSalLayouts, the orig now with 5 glyphs and another with 6 glyphs. We cache that SalLayout and when we go to reuse it and get level 0 there are no missing glyphs so we just render that level and the fallback level isn't used and end with missing glyphs
Comment 8 Commit Notification 2022-05-04 03:59:37 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/22191901bc91535121a5e8dc7ee6137233824d36

do not allow reusing already used SalLayoutGlyphs (tdf#148477)

It will be available in 7.4.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 Luboš Luňák 2022-05-04 04:04:07 UTC
*** Bug 148470 has been marked as a duplicate of this bug. ***
Comment 10 enhua_2008 2022-05-04 05:05:36 UTC
(In reply to Commit Notification from comment #8)
> Luboš Luňák committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 22191901bc91535121a5e8dc7ee6137233824d36
> 
> do not allow reusing already used SalLayoutGlyphs (tdf#148477)
> 
> It will be available in 7.4.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.

The status bar's Chinese characters can be displayed, but introduced a new bug, the status bar's state can't be updated now. After type some words, the counts of word is still 0, and the pages number is still 1.
Comment 11 enhua_2008 2022-05-04 05:11:13 UTC
(In reply to Luboš Luňák from comment #9)
> *** Bug 148470 has been marked as a duplicate of this bug. ***

The problem  '⌘' and '⌥' can’t be displayed in toolsbartip for Chinese UI on macOS reported in 14870 has not been resolved.
Comment 12 Luboš Luňák 2022-05-04 05:15:35 UTC
(In reply to enhua_2008 from comment #10)
> The status bar's Chinese characters can be displayed, but introduced a new
> bug, the status bar's state can't be updated now. After type some words, the
> counts of word is still 0, and the pages number is still 1.

https://gerrit.libreoffice.org/c/core/+/133796 should fix that.
Comment 13 enhua_2008 2022-05-04 06:49:59 UTC
(In reply to Luboš Luňák from comment #12)
> (In reply to enhua_2008 from comment #10)
> > The status bar's Chinese characters can be displayed, but introduced a new
> > bug, the status bar's state can't be updated now. After type some words, the
> > counts of word is still 0, and the pages number is still 1.
> 
> https://gerrit.libreoffice.org/c/core/+/133796 should fix that.

I verified that the problem solved.
Comment 14 Commit Notification 2022-05-04 14:32:06 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

do not allow reusing already used SalLayoutGlyphs (tdf#148477)

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