summaryrefslogtreecommitdiff
path: root/vcl/source/control/ctrl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/ctrl.cxx')
-rw-r--r--vcl/source/control/ctrl.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 3d7ac2172e91..537d85636aec 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -65,15 +65,7 @@ Control::Control( Window* pParent, WinBits nStyle ) :
Window( WINDOW_CONTROL )
{
ImplInitControlData();
- Window::ImplInit( pParent, nStyle, NULL );
-}
-
-void Control::take_properties(Window &rOther)
-{
- Control &rOtherControl = static_cast<Control&>(rOther);
- std::swap(mpControlData, rOtherControl.mpControlData);
- mbHasFocus = rOtherControl.mbHasFocus;
- Window::take_properties(rOther);
+ ImplInit( pParent, nStyle, NULL );
}
Control::Control( Window* pParent, const ResId& rResId ) :
@@ -89,6 +81,21 @@ Control::Control( Window* pParent, const ResId& rResId ) :
Show();
}
+void Control::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ {
+ ImplInitControlData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle(), NULL);
+ }
+
+ Window::take_properties(rOther);
+
+ Control &rOtherControl = static_cast<Control&>(rOther);
+ std::swap(mpControlData, rOtherControl.mpControlData);
+ mbHasFocus = rOtherControl.mbHasFocus;
+}
+
// -----------------------------------------------------------------------
Control::~Control()