Bug 167580 - Writer table formulas: hide "phd"
Summary: Writer table formulas: hide "phd"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:26.2.0
Keywords: difficultyBeginner, easyHack, skillDesign, topicUI
Depends on:
Blocks:
 
Reported: 2025-07-18 15:50 UTC by Mike Kaganski
Modified: 2025-10-22 15:31 UTC (History)
4 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 Mike Kaganski 2025-07-18 15:50:34 UTC
PHD is curiously documented [1] "Calculates a percentage". Which is actually (from any normal user point of view) is wrong. Which is clear immediately from the example given there: "10 + 15 PHD displays 10.15". Yes, it displays 10.15, and not 11.5, which would happen, if PHD meant "add 15 percent of 10 to 10".

The actual operation performed by PHD is simply "take the value before, and multiply by 0.01" [2]. It is a useless thing, replacement for "/100", and its presence is misleading. Of course, it can't be removed from code, without breaking existing documents; but it can be removed from the UI (and help).

[1] https://help.libreoffice.org/25.2/en-US/text/swriter/02/14020000.html?&DbPAR=WRITER
[2] https://opengrok.libreoffice.org/xref/core/sw/source/core/bastyp/calc.cxx?r=e2af30210fcbfe9e20f893360cf10edfdf22b7e1#1075
Comment 1 Mike Kaganski 2025-07-18 15:52:58 UTC
Examples of real-life confusion:

https://ask.libreoffice.org/t/formulas-and-syntax-in-writer-tables/124522 (where the author seriously claims that PHD does "n × (1 + x/100)" in their tutorial-like document, uploaded for wide reference)

https://ask.libreoffice.org/t/calculate-percentage-in-writer-table/65480 (discussing how to use PHD, exactly because it's counter-intuitive).
Comment 2 Heiko Tietze 2025-07-31 10:23:31 UTC
(In reply to Mike Kaganski from comment #0)
> ...but it can be removed from the UI (and help).
+1
Comment 3 V Stuart Foote 2025-08-05 16:40:17 UTC
+1 to remove from "UI (and Help)" but retain for backward compatibility.
Comment 4 Heiko Tietze 2025-08-14 11:57:01 UTC
We discussed the topic in the design meeting. 

The statement "Expression faulty" is unclear and we should add some explanation (though this might be off-topic here).

It's not clear why this was added in first place; current MSO has no percentage. But since it is a weird function and can be easily replaced with % (perhaps it was introduced as an alternative?), removing the access in the UI should do no harm.

Should be enough to remove the entry from sw/uiconfig/swriter/ui/inputwinmenu.ui
Comment 5 Commit Notification 2025-10-13 14:44:48 UTC
noah committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/30617335d8cb1348e81c79e4f150aa3136a6d708

tdf#167580 Hide phd in Writer table formulas

It will be available in 26.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 6 Commit Notification 2025-10-14 11:28:49 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/69fb7d8b298e1f45dc092518fe995e3027558938

tdf#167580 Drop PHD function in Writer table
Comment 7 nutka 2025-10-22 15:17:42 UTC
Looks good to me — no "phd" in the UI or Help (online/offline).

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 8; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-US (fr_FR); UI: en-US
Calc: threaded