diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-27 11:47:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-27 14:11:19 +0200 |
commit | a9c0dcc13d99d9f768f64c877920280e4411756b (patch) | |
tree | 3502e2cf975b40270469d23f338dc5fb11bcc1ed /vcl | |
parent | 574c57090642347980d2395e1e183cc7b5c171ad (diff) |
no GtkSpinButtons with :pattern hack exist anymore
Change-Id: I9d622890b3f8e58d6b634014f242e7cd9016d507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94937
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/builder.cxx | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 8410e67871a3..21ced1163496 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -2014,52 +2014,20 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & else if (name == "GtkSpinButton") { OUString sAdjustment = extractAdjustment(rMap); - OUString sPattern = BuilderUtils::extractCustomProperty(rMap); - OUString sUnit = extractUnit(sPattern); WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_BORDER|WB_3DLOOK|WB_SPIN|WB_REPEAT; - if (sPattern.isEmpty()) + if (m_bLegacy) { - SAL_INFO("vcl.builder", "making numeric field for " << name << " " << sUnit); - if (m_bLegacy) - { - connectNumericFormatterAdjustment(id, sAdjustment); - xWindow = VclPtr<NumericField>::Create(pParent, nBits); - } - else - { - connectFormattedFormatterAdjustment(id, sAdjustment); - VclPtrInstance<FormattedField> xField(pParent, nBits); - xField->SetMinValue(0); - xWindow = xField; - } + connectNumericFormatterAdjustment(id, sAdjustment); + xWindow = VclPtr<NumericField>::Create(pParent, nBits); } else { - if (sPattern == "hh:mm") - { - connectTimeFormatterAdjustment(id, sAdjustment); - SAL_INFO("vcl.builder", "making time field for " << name << " " << sUnit); - xWindow = VclPtr<TimeField>::Create(pParent, nBits); - } - else if (sPattern == "yy:mm:dd") - { - connectDateFormatterAdjustment(id, sAdjustment); - SAL_INFO("vcl.builder", "making date field for " << name << " " << sUnit); - xWindow = VclPtr<DateField>::Create(pParent, nBits); - } - else - { - connectNumericFormatterAdjustment(id, sAdjustment); - FieldUnit eUnit = detectMetricUnit(sUnit); - SAL_INFO("vcl.builder", "making metric field for " << name << " " << sUnit); - VclPtrInstance<MetricField> xField(pParent, nBits); - xField->SetUnit(eUnit); - if (eUnit == FieldUnit::CUSTOM) - xField->SetCustomUnitText(sUnit); - xWindow = xField; - } + connectFormattedFormatterAdjustment(id, sAdjustment); + VclPtrInstance<FormattedField> xField(pParent, nBits); + xField->SetMinValue(0); + xWindow = xField; } } else if (name == "GtkLinkButton") |