summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-12-27 14:02:17 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-27 17:13:55 +0100
commitd77d0d8e2fabc9dfc9eef3e532c31351632fb7b7 (patch)
tree211494cc895674decf26a8e99059f286d9f9a18f /svtools
parent3b35f1d985d2cd230c0676d01d3f2518acb1e50c (diff)
svtools: Simplify DoubleNumericField with std::unique_ptr
Change-Id: I25df3a06afa5e1eb2fa282f2be2ae1ea69aa0ab5 Reviewed-on: https://gerrit.libreoffice.org/47077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/fmtfield.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 3b47e08c938b..20770f95569b 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -1007,16 +1007,13 @@ void FormattedField::UseInputStringForFormatting()
}
-DoubleNumericField::~DoubleNumericField()
+DoubleNumericField::DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
+ : FormattedField(pParent, nStyle)
{
- disposeOnce();
+ ResetConformanceTester();
}
-void DoubleNumericField::dispose()
-{
- delete m_pNumberValidator;
- FormattedField::dispose();
-}
+DoubleNumericField::~DoubleNumericField() = default;
void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
{
@@ -1052,8 +1049,7 @@ void DoubleNumericField::ResetConformanceTester()
cSeparatorDecimal = sSeparator[0];
}
- delete m_pNumberValidator;
- m_pNumberValidator = new validation::NumberValidator( cSeparatorThousand, cSeparatorDecimal );
+ m_pNumberValidator.reset(new validation::NumberValidator( cSeparatorThousand, cSeparatorDecimal ));
}
DoubleCurrencyField::DoubleCurrencyField(vcl::Window* pParent, WinBits nStyle)