From c422404020a3a80666c62b633ac569060939ae16 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:58:24 +0100 Subject: [PATCH] Core: workaround for Building US unit system bug (#25288) * Core: workaround for Building US unit system bug Fixes #11345 This workaround should hopefully fix the Building US unit system bug at the level of the InputField code. This is the most feasible solution given that we are currently in the v1.1 feature freeze. I use the word "hopefully" because I have not compiled and tested the code. But replacing `+` with `--` works in Python examples. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typo in comment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Gui/InputField.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 1d1ec67866..6ff5b3128f 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -769,6 +769,12 @@ void InputField::fixup(QString& input) const if (localePlus != asciiPlus) { input.replace(localePlus, asciiPlus); } + + // workaround for improper handling of plus sign + // in Building US unit system + // https://github.com/FreeCAD/FreeCAD/issues/11345 + QString asciiMinusMinus(QStringLiteral("--")); + input.replace(asciiPlus, asciiMinusMinus); } QValidator::State InputField::validate(QString& input, int& pos) const