Diffusion KCalc cf39d29d737f

Fix chained operations involving inserted numbers

Authored by ovp on Jun 7 2020, 8:00 AM.

Description

Fix chained operations involving inserted numbers

In brief, KCalc uses a stack in CalcEngine for both numbers and operations in order to ensure the correct operation evaluation order (such that 2 + 2 * 2 = 6) and support parentheses. Operations are pushed along with currently displayed numerical values. KCalc also checks whether it should push the operation onto the stack or just replace a pushed one with the new one without changing the associated number (so that 5 + - 3 = 2), and for this it uses a flag changed by calling the CalcEngine::setOnlyUpdateOperation method. Obviously, this flag must be cleared after a number is entered by any method, but it only happens if a number is entered manually. As a result, inserting a number as a whole, whether as a constant or by pasting from the clipboard, results in replacing the preceding operation with the succeeding one without storing the number in question, unless the succeeding operation is = or %.

BUG: 412401

Details

Committed
mschillerJun 7 2020, 8:00 AM
Parents
R353:2bf2d7caecd2: Fix clazy warning
Branches
Unknown
Tags
Unknown