diff options
Diffstat (limited to 'vcl/source/control/ctrl.cxx')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 411243cccaeb..85ca49501f24 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -67,7 +67,13 @@ Control::Control( vcl::Window* pParent, const ResId& rResId ) : Control::~Control() { + disposeOnce(); +} + +void Control::dispose() +{ delete mpControlData, mpControlData = NULL; + Window::dispose(); } void Control::EnableRTL( bool bEnable ) @@ -107,7 +113,7 @@ void Control::CreateLayoutData() const bool Control::HasLayoutData() const { - return mpControlData->mpLayoutData != NULL; + return mpControlData ? mpControlData->mpLayoutData != NULL : false; } ::vcl::ControlLayoutData* Control::GetLayoutData() const @@ -121,6 +127,10 @@ void Control::SetText( const OUString& rStr ) Window::SetText( rStr ); } +ControlLayoutData::ControlLayoutData() : m_pParent( NULL ) +{ +} + Rectangle ControlLayoutData::GetCharacterBounds( long nIndex ) const { return (nIndex >= 0 && nIndex < (long) m_aUnicodeBoundRects.size()) ? m_aUnicodeBoundRects[ nIndex ] : Rectangle(); @@ -338,7 +348,11 @@ void Control::SetLayoutDataParent( const Control* pParent ) const void Control::ImplClearLayoutData() const { - delete mpControlData->mpLayoutData, mpControlData->mpLayoutData = NULL; + if (mpControlData) + { + delete mpControlData->mpLayoutData; + mpControlData->mpLayoutData = NULL; + } } void Control::ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect ) |