Bug 513883

Summary: Crash when invoking calculator in amount widget
Product: [Applications] kmymoney Reporter: Thomas Baumgart <tbaumgart>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: git (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.2.2
Sentry Crash Report:

Description Thomas Baumgart 2025-12-27 17:27:26 UTC
SUMMARY & STEPS TO REPRODUCE
When entering an amount edit widget in the transaction editor the full amount is selected (highlighted) by default. To reproduce the crash, only select a portion of the value. For example, if the amount is 36.00, only select 36. Then, press e.g. the slash key on the keyboard to divide.

OBSERVED RESULT
The window freezes and the app crashes. 

EXPECTED RESULT
I expect the calculator window to appear with the full amount being loaded.

ADDITIONAL INFORMATION
Highlighting the full amount (dollars and cents) works just fine without crashing.
Comment 1 Thomas Baumgart 2025-12-27 17:37:59 UTC
Git commit 7ed05dc50cf8eea74b720caab8aca69375db6833 by Thomas Baumgart.
Committed on 27/12/2025 at 17:37.
Pushed by tbaumgart into branch 'master'.

Prevent infinite recursion in amount edit widget

When the text in the amount edit widget is only partially selected and a
math operation key is pressed an infinite recursion was caused which
leads to crashes. This change prevents this from happening.
FIXED-IN: 5.2.2

M  +0    -11   kmymoney/widgets/amountedit.cpp

https://invent.kde.org/office/kmymoney/-/commit/7ed05dc50cf8eea74b720caab8aca69375db6833
Comment 2 Thomas Baumgart 2025-12-27 17:38:20 UTC
Git commit 69b68eb735dbf8049e8387ccdf9298362e515ef3 by Thomas Baumgart.
Committed on 27/12/2025 at 17:38.
Pushed by tbaumgart into branch '5.2'.

Prevent infinite recursion in amount edit widget

When the text in the amount edit widget is only partially selected and a
math operation key is pressed an infinite recursion was caused which
leads to crashes. This change prevents this from happening.
FIXED-IN: 5.2.2
(cherry picked from commit 7ed05dc50cf8eea74b720caab8aca69375db6833)

M  +0    -11   kmymoney/widgets/amountedit.cpp

https://invent.kde.org/office/kmymoney/-/commit/69b68eb735dbf8049e8387ccdf9298362e515ef3