Bug 144730 - LO Writer 'Convert to metric' and 'Convert to non-metric' do not work
Summary: LO Writer 'Convert to metric' and 'Convert to non-metric' do not work
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-26 01:49 UTC by Eek! A Bug. Kill it!
Modified: 2021-09-26 16:49 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eek! A Bug. Kill it! 2021-09-26 01:49:18 UTC
Description:
Neither the ‘Convert to metric’ nor the ‘Convert to non-metric’ functions listed under the ‘Others’ category of Tools > Options… > Language Settings > English Sentence Checking works. 

This is in addition to the already documented problem of the ‘Parentheses’ function not working under the ‘Grammar checking’ category on the same page (failing to catch certain combinations of missing or extra parentheses or quotation marks.

Steps to Reproduce:
1. Select one of the convert functions
2. Enter a value in a Writer document then a space or enter

Actual Results:
No conversion takes place.

Expected Results:
Conversion either to or from metric depending on setting in step 1 above.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Julien Nabet 2021-09-26 11:02:35 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

After some debug, I found that it's due to the fact that dict-en/pythonpath/lightproof_impl_en.py
uses CONVERT_ADD
but this function has been removed with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=ced79363cc30f225e766195ace4f892754fc85a0
Resolves: tdf#69539 UI rename CONVERT to CONVERT_OOO, CONVERT_ADD to CONVERT
... with same syntax but different semantics that was even more confusing.

Same problem for Hungarian and Portuguese from Brazil.
Comment 2 Commit Notification 2021-09-26 11:12:36 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/dictionaries/commit/5d9d7d50c9000119abd7b89fe0f48a41cc6a2502

tdf#144730: Replace CONVERT_ADD to CONVERT to fix metric/non metric conversions
Comment 3 Julien Nabet 2021-09-26 11:15:45 UTC
Argh, I directly pushed on dictionaries repo not put in gerrit.
Sorry for this.
Comment 4 Julien Nabet 2021-09-26 11:31:09 UTC
I don't know how to cherry-pick this to 7.2 branch.
Let's put this one to FIXED anyway.

Eek: in LO profile (see https://wiki.documentfoundation.org/UserProfile#Windows), search lightproof_impl_en.py
Line 329, replace:
m = calc("CONVERT_ADD", (float(eval(mnum.replace(remove, "").replace(decimal, ".").replace(u"\u2212", "-"))), min, mout))

by
m = calc("CONVERT", (float(eval(mnum.replace(remove, "").replace(decimal, ".").replace(u"\u2212", "-"))), min, mout))
Comment 5 Julien Nabet 2021-09-26 11:33:06 UTC
For the parenthesis bug, please submit a new bugtracker unless there's an existing one.
Comment 6 V Stuart Foote 2021-09-26 14:32:32 UTC
(In reply to Julien Nabet from comment #5)
> For the parenthesis bug, please submit a new bugtracker unless there's an
> existing one.

That is bug 143750
Comment 7 Eek! A Bug. Kill it! 2021-09-26 15:43:01 UTC
(In reply to Julien Nabet from comment #4)
> I don't know how to cherry-pick this to 7.2 branch.
> Let's put this one to FIXED anyway.
> 
> Eek: in LO profile (see
> https://wiki.documentfoundation.org/UserProfile#Windows), search
> lightproof_impl_en.py
> Line 329, replace:
> m = calc("CONVERT_ADD", (float(eval(mnum.replace(remove,
> "").replace(decimal, ".").replace(u"\u2212", "-"))), min, mout))
> 
> by
> m = calc("CONVERT", (float(eval(mnum.replace(remove, "").replace(decimal,
> ".").replace(u"\u2212", "-"))), min, mout))

 
Thanks Julien for all the effort you put into working on this. I should have included the bug report number for the affiliated issue of the parenthesis bug, but as V Stuart Foote already replied, it is bug 143750.
Comment 8 Julien Nabet 2021-09-26 16:49:49 UTC
Thank you V Stuart Foote!

No pb Eek! :-)