summaryrefslogtreecommitdiff
path: root/vcl/source/control/field.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/field.cxx')
-rw-r--r--vcl/source/control/field.cxx32
1 files changed, 17 insertions, 15 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index fbf7f39665dd..10e94020debe 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1657,10 +1657,7 @@ MetricField::MetricField( Window* pParent, const ResId& rResId ) :
SpinField( WINDOW_METRICFIELD )
{
if (Dialog::replace_buildable(pParent, rResId.GetId(), *this))
- {
- SetField( this );
return;
- }
rResId.SetRT( RSC_METRICFIELD );
WinBits nStyle = ImplInitRes( rResId ) ;
@@ -1672,28 +1669,33 @@ MetricField::MetricField( Window* pParent, const ResId& rResId ) :
Show();
}
-bool MetricField::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+void MetricField::take_properties(Window &rOther)
{
- if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("format")))
+ if (!GetParent())
{
- maCustomUnitText = rtl::OStringToOUString(rValue, RTL_TEXTENCODING_UTF8);
- meUnit = FUNIT_CUSTOM;
+ SpinField::ImplInit(rOther.GetParent(), rOther.GetStyle());
+ SetField( this );
}
- else
- return SpinField::set_property(rKey, rValue);
- return true;
-}
-void MetricField::take_properties(Window &rOther)
-{
- MetricField &rOtherField = static_cast<MetricField&>(rOther);
+ SpinField::take_properties(rOther);
+ MetricField &rOtherField = static_cast<MetricField&>(rOther);
maCustomUnitText = rOtherField.maCustomUnitText;
maCurUnitText = rOtherField.maCurUnitText;
mnBaseValue = rOtherField.mnBaseValue;
meUnit = rOtherField.meUnit;
+}
- SpinField::take_properties(rOther);
+bool MetricField::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+{
+ if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("format")))
+ {
+ maCustomUnitText = rtl::OStringToOUString(rValue, RTL_TEXTENCODING_UTF8);
+ meUnit = FUNIT_CUSTOM;
+ }
+ else
+ return SpinField::set_property(rKey, rValue);
+ return true;
}
void MetricField::ImplLoadRes( const ResId& rResId )