diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-14 16:45:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-15 15:00:56 +0200 |
commit | 299e128b5175f4c3d794848ab51e81d14385a547 (patch) | |
tree | b2af5ebbd9c2692e121f0b6ba064d34bfef60a1a /vcl/source/app/weldutils.cxx | |
parent | 0abbf64dc1ebe9f12523a69ce1cfd25fe189d869 (diff) |
replace TimeSpinButton with FormattedSpinButton
with a TimeFormatter rather than have duplicate functionality
Change-Id: I99f1f2aabee5f81485f97755ba3675870317cfb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98791
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app/weldutils.cxx')
-rw-r--r-- | vcl/source/app/weldutils.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx index 21161e396db8..9efab321e91d 100644 --- a/vcl/source/app/weldutils.cxx +++ b/vcl/source/app/weldutils.cxx @@ -346,6 +346,8 @@ TimeFormatter::TimeFormatter(weld::FormattedSpinButton& rSpinButton) void TimeFormatter::Init() { + DisableRemainderFactor(); //so with hh::mm::ss, incrementing mm will not reset ss + SetOutputHdl(LINK(this, TimeFormatter, FormatOutputHdl)); SetInputHdl(LINK(this, TimeFormatter, ParseInputHdl)); @@ -407,6 +409,18 @@ void TimeFormatter::SetExtFormat(ExtTimeFieldFormat eFormat) ReFormat(); } +void TimeFormatter::SetDuration(bool bDuration) +{ + m_bDuration = bDuration; + ReFormat(); +} + +void TimeFormatter::SetTimeFormat(TimeFieldFormat eTimeFormat) +{ + m_eFormat = eTimeFormat; + ReFormat(); +} + TimeFormatter::~TimeFormatter() = default; } |