Bug 101895 - Paragraph dialog units shown as "ch" and "lines" when "Enable char unit" is enabled by default
Summary: Paragraph dialog units shown as "ch" and "lines" when "Enable char unit" is e...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: CJK Paragraph-Dialog Paragraph-Spacing Paragraph-Indent
  Show dependency treegraph
 
Reported: 2016-09-04 16:35 UTC by Joel Madero
Modified: 2023-08-22 18:59 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (48.64 KB, image/png)
2016-09-04 17:22 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Madero 2016-09-04 16:35:57 UTC
Version: 5.3.0.0.alpha0+
Build ID: c36489be617be3e8ca25612d29afb221bc7ae6c1
CPU Threads: 2; OS Version: Linux 3.16; UI Render: default; 
Locale: en-US (en_US.UTF-8); Calc: group

Repro Steps:
1. Open writer;
2. Format -> Paragraph

Observed: 

Notice that units are now "ch" by default instead of the units you generally use/expect with your system. Through 5.2 my default units are American Standard so I would see just 0.00" (" represents "inches"). I have no idea how how to equate "ch" to inches.

Expected: Units would be based on locale and be consistent with other settings. I just checked MS Office 2010 and it bases indent on system units so I see inches - zero clue how I'd know if interop was right if I imported something from Word that I knew was 1.25" and converted to some X ch


ALSO: This might be a separate bug but I was told to keep it in one

Repro Steps:
Same as above

Observed: "Above the line" and "below the line" now measured in "lines"

Expected: Either stick with metrics of system (again for me inches)_or move to "pt" which is what Word apparently does.

These two issues make interop quite tedious
Comment 1 m_a_riosv 2016-09-04 17:04:27 UTC
I can't reproduce
Win10x64
Version: 5.3.0.0.alpha0+
Build ID: ea9a90d83d92076d41abfd31a1fd3a5d84b6ba92
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-08-26_06:19:43
Locale: es-ES (es_ES); Calc: CL

The same as in 5.2 'cm'

Maybe it's a erroneous string for inches.

Is it right in Menu/Tools/Options/LibreOffice writer/General - Measurement units?
Comment 2 Yousuf Philips (jay) (retired) 2016-09-04 17:21:31 UTC
Reproduced and is only in master.

Version: 5.3.0.0.alpha0+
Build ID: f7513f0f53f2d074c08610a68fb787bb379c31d4
CPU Threads: 2; OS Version: Linux 3.19; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-09-02_23:58:05
Locale: en-US (en_US.UTF-8); Calc: group
Comment 3 Yousuf Philips (jay) (retired) 2016-09-04 17:22:21 UTC
Created attachment 127147 [details]
screenshot
Comment 4 V Stuart Foote 2016-09-05 03:33:23 UTC
Can not reproduce on Windows 10 Pro 64-bit en-US with
Version: 5.3.0.0.alpha0+
Build ID: 696e83b663d4f3e00f23947613f9f3916a4dd14d
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-09-03_10:21:32
Locale: en-US (en_US); Calc: CL

Seems to be Linux only then... on Windows the units are my default inches--and as set in Tools -> Options ->  LibreOffice Writer -> General: Settings--"Measurement unit" == "Inch"
Comment 5 Aron Budea 2016-09-05 04:27:16 UTC
I've been checking in Windows, and it definitely occurs, and not only in 5.3 master build, but all back to 3.3.0.

There's a checkbox right below "Measurement unit": "Enable char unit", that controls the behavior, if checked, you will see character/line units in Paragraph dialog.
Comment 6 Aron Budea 2016-09-05 04:49:43 UTC
Hm, there's no such checkbox in Linux.
Adjacent checkbox is missing as well: "Use square page mode for text grid".
Comment 7 Yousuf Philips (jay) (retired) 2016-09-05 12:33:15 UTC
On linux i see both checkboxes in the options dialog in a profile i've been using for only 1 month and that i never modified the measurement unit in. With a blank profile, both checkboxes are gone.
Comment 8 Maxim Monastirsky 2016-09-05 12:47:00 UTC
(In reply to Aron Budea from comment #5)
> There's a checkbox right below "Measurement unit": "Enable char unit", that
> controls the behavior, if checked, you will see character/line units in
> Paragraph dialog.

(In reply to Aron Budea from comment #6)
> Hm, there's no such checkbox in Linux.
> Adjacent checkbox is missing as well: "Use square page mode for text grid".

Both checkboxes depend of CJK features to be enabled (Language Settings > Languages > Asian). Also you need to close & reopen the options dialog for this setting to take effect.
Comment 9 V Stuart Foote 2016-09-05 13:29:05 UTC
The "Enable char unit" and "Use square page mode for text grid" only appear if the checkbox for Tools -> Options -> Language Settings -> Languages "Default language for the document" includes a check of the Asian list.

Controlling attribute in source is IsAsianTypographyEnabled()

If no Asian language support is enabled--the two check boxes are hidden, and do not assert. 

And if an Asian language is selected--the ch / line settings in Paragraph dialog will only assert if the "Enable char unit" checkbox is selected.

Seems by default our user configuration includes selections enabling Asian and CTL--and that the checkbox for "Enable char unit" and "Use square page mode for text grid" are set active by default for builds after 3.4.6

Verified the checkbox setting, and the ch / line behavior of the Paragraph dialog "Indents and Spacing" on Windows builds 5.2.1, 5.1.5, 4.4.6, 4.3.6, 4.2.6, 4.1.6, 4.0.6, 3.6.5, 3.5.7

Through the 3.4.6 release the "Enable char unit" was not checked by default and the Paragraph dialog Indents and Spacing is not affected.
Comment 10 V Stuart Foote 2016-09-05 13:33:15 UTC
So, default is wrong--but simple work around uncheck the "Enable char unit" (Tools -> Options -> LibreOffice Writer -> General) when you are not composing in an Asian script.
Comment 11 Yousuf Philips (jay) (retired) 2016-09-05 17:15:14 UTC
Glad we were able to track down the issue, but curious why Joel enabled that checkbox. I enable it for QA work i'm doing. So the question comes down to whether it being on by default is what CJK users want by default.
Comment 12 V Stuart Foote 2016-09-05 17:36:57 UTC
I believe both character spacing and square page grid are preferred settings for composing with logograms (Hànzì, Kanji, Hanja) in CJK Asian scripts being used while editing. Otherwise, IIUC both character and grid should be disabled for text composition using phonograms/alphabets.

On Windows at least, both are set on by default with a default user profile that includes Asian (CJK) and Complex Text Language (CTL) scripts, so that unexpectedly causes issue with spacings in the Paragraph dialog--even though a CJK script is not actually being used for the paragraph.
Comment 13 Yousuf Philips (jay) (retired) 2016-09-05 18:03:07 UTC
Yes it seems that if CJK and CTL are both enabled, "Enable char unit" is enabled and if only CJK is enabled, "Enable char unit" isnt enabled. So this seems to be the route of the bug.
Comment 14 Joel Madero 2016-09-15 02:24:47 UTC
I didn't enable anything and had never seen this behavior before a recent master build. This was seen with a fresh profile.
Comment 15 Aron Budea 2018-01-17 17:05:51 UTC
Minding the settings mentioned above, this occurs in 3.3 as well, adjusting earliest version and removing regression-related keywords.
Comment 16 QA Administrators 2019-01-19 03:54:21 UTC Comment hidden (obsolete)
Comment 17 QA Administrators 2021-01-19 04:11:01 UTC Comment hidden (obsolete)
Comment 18 Kevin Suo 2022-11-15 09:38:14 UTC
I do not see this issue on current master (and 7.4), could someone retest?
Comment 19 Mike Kaganski 2022-11-15 09:54:19 UTC
I do not know *what* the issue here is. (Although I believe I have my own definition of the issue here ;))

So, with Version: 7.4.3.1 (x64) / LibreOffice Community
Build ID: 3793858a34d8fef5b92f8fee233f97766f05e281
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

the following is reproducible:

1. Start with a clean profile;
2. Set up a non-Asian locale and UI (e.g., both en-US), and check the "Asian" checkbox under Options->Language Settings->Languages (no CTL, unlike comment 13 told);
3. Restart LibreOffice (just to make sure it all indeed has applied), start Writer, and look at Options->Writer->General.

=> [x] "Enable char unit" is checked.

4. Exit Options, and open paragraph properties on Idents and Spacing tab

=> ch and line are used as measurement units there.

IMO, the problem is, that the char unit is enabled and used whenever Asian is enabled in language settings, regardless of the locale.

I believe that even if the unit may be not shown when Asian is disabled there (maybe it makes sense?), it must not have any separate controls in options, and when added, it should be added as an option to respective places (like "Measurement unit" drop down under Options->Writer->General, or the units selectable when you right-click the rulers); it may be the default in some locales (just as inches are default when your locale is en-US); but otherwise, it must not be intrusive like it's now (it must not replace normal configured units in every locale).
Comment 20 Caolán McNamara 2023-08-22 12:13:25 UTC
Historically I think the idea was that only people in CJK locales would install a CJK langpack and so CJK features would only appear in that case and this sort of worked out ok.

Seeing as we typically default to showing inches or cm based on SvtSysLocaleOptions::GetRealLanguageTag I think it makes sense to go that direction and show ch[ar] + inches if that locale is a CJK one and this toggle is also on.
Comment 21 Caolán McNamara 2023-08-22 12:23:46 UTC
https://gerrit.libreoffice.org/c/core/+/155948 for that idea
Comment 22 Commit Notification 2023-08-22 18:47:16 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101895 don't unconditionally default to ch[ar]/line

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 23 Caolán McNamara 2023-08-22 18:59:12 UTC
Hopefully that makes thing work out of the box for practically everyone.