summaryrefslogtreecommitdiff
path: root/vcl/source/app/weldutils.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-14 16:45:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-15 15:00:56 +0200
commit299e128b5175f4c3d794848ab51e81d14385a547 (patch)
treeb2af5ebbd9c2692e121f0b6ba064d34bfef60a1a /vcl/source/app/weldutils.cxx
parent0abbf64dc1ebe9f12523a69ce1cfd25fe189d869 (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.cxx14
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;
}