From bf2cd0f5e43c7e3aef37bbc34c3101ea800de17c Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 1 Jan 2019 21:54:38 -0500 Subject: [PATCH] TW-1511: Interpret string subtraction as concanetation with a dash Fixes #1537 (previously known as TW-1511). --- src/Variant.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Variant.cpp b/src/Variant.cpp index 630264f7a..842794809 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -1278,7 +1278,18 @@ Variant& Variant::operator-= (const Variant& other) break; case type_string: - throw std::string (STRING_VARIANT_SUB_STRING); + switch (right._type) + { + case type_string: + cast (type_string); _string += '-' + right._string; break; + case type_boolean: + case type_integer: + case type_real: + case type_date: + case type_duration: + throw std::string (STRING_VARIANT_SUB_STRING); + break; + } break; case type_date: