diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-10-14 14:46:31 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-10-20 17:11:28 +0000 |
commit | 43769b7aebd6e89c5d9260b244e34d0858e99216 (patch) | |
tree | 2e45d094d753e7ea6ac9d982cee98ab6cd6a1d3b /include | |
parent | 0fff374fc0e9d3ea76d0aa0a0466467078f0519d (diff) |
tdf#93390 correctly handle back-and-forth between numeric and text value
Change-Id: I06711afd5d668816608661f0fe433efd93fef99e
Reviewed-on: https://gerrit.libreoffice.org/19372
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/fmtfield.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx index 562cf5ca14f5..bea0168b52f3 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; @@ -121,7 +122,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; } |