From eb33ef931a635d2d706e2ec4abec3f5a7a24674a Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Wed, 14 Oct 2015 14:46:31 +0200 Subject: tdf#93390 correctly handle back-and-forth between numeric and text value Change-Id: I06711afd5d668816608661f0fe433efd93fef99e --- include/svtools/fmtfield.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx index ea9ba48793a5..6426772295cd 100644 --- a/include/svtools/fmtfield.hxx +++ b/include/svtools/fmtfield.hxx @@ -66,10 +66,11 @@ protected: bool m_bStrictFormat : 1; - bool m_bValueDirty : 1; bool m_bEnableEmptyField : 1; bool m_bAutoColor : 1; bool m_bEnableNaN : 1; + enum valueState { valueDirty, valueString, valueDouble }; + valueState m_ValueState; double m_dCurrentValue; double m_dDefaultValue; @@ -119,7 +120,7 @@ public: void EnableEmptyField(bool bEnable); // If disabled, the value will be resetted to the last valid value on leave - void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_bValueDirty = true; } + void SetDefaultValue(double dDefault) { m_dDefaultValue = dDefault; m_ValueState = valueDirty; } // If the current String is invalid, GetValue() returns this value double GetDefaultValue() const { return m_dDefaultValue; } -- cgit