diff options
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 10 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenu.cxx | 4 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol.cxx | 4 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 9 |
5 files changed, 19 insertions, 10 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 7818856dfaf5..784efbc231ae 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -2623,7 +2623,7 @@ void SvImpLBox::LoseFocus() if( m_nStyle & WB_HIDESELECTION ) { - SvTreeListEntry* pEntry = pView->FirstSelected(); + SvTreeListEntry* pEntry = pView ? pView->FirstSelected() : NULL; while( pEntry ) { InvalidateEntry( pEntry ); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 039b6693a11c..6d98310924b6 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -62,6 +62,8 @@ class MyEdit_Impl : public Edit SvInplaceEdit2* pOwner; public: MyEdit_Impl( vcl::Window* pParent, SvInplaceEdit2* pOwner ); + virtual ~MyEdit_Impl() { disposeOnce(); } + virtual void dispose() SAL_OVERRIDE { pOwner = NULL; Edit::dispose(); } virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; }; @@ -71,6 +73,8 @@ class MyMultiEdit_Impl : public MultiLineEdit SvInplaceEdit2* pOwner; public: MyMultiEdit_Impl( vcl::Window* pParent, SvInplaceEdit2* pOwner ); + virtual ~MyMultiEdit_Impl() { disposeOnce(); } + virtual void dispose() SAL_OVERRIDE { pOwner = NULL; MultiLineEdit::dispose(); } virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; }; @@ -92,7 +96,8 @@ void MyEdit_Impl::KeyInput( const KeyEvent& rKEvt ) void MyEdit_Impl::LoseFocus() { - pOwner->LoseFocus(); + if (pOwner) + pOwner->LoseFocus(); } MyMultiEdit_Impl::MyMultiEdit_Impl( vcl::Window* pParent, SvInplaceEdit2* _pOwner ) @@ -110,7 +115,8 @@ void MyMultiEdit_Impl::KeyInput( const KeyEvent& rKEvt ) void MyMultiEdit_Impl::LoseFocus() { - pOwner->LoseFocus(); + if (pOwner) + pOwner->LoseFocus(); } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 8051265deda7..217244881db3 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -483,6 +483,8 @@ void ToolbarMenu::dispose() } delete mpImpl; + mpImpl = NULL; + DockingWindow::dispose(); } @@ -774,7 +776,7 @@ void ToolbarMenu::GetFocus() void ToolbarMenu::LoseFocus() { - if( mpImpl->mnHighlightedEntry != -1 ) + if( mpImpl && mpImpl->mnHighlightedEntry != -1 ) implChangeHighlightEntry( -1 ); DockingWindow::LoseFocus(); diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 5c887c36d83d..0c1bdb3b6d8b 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -80,14 +80,14 @@ namespace svt { namespace table void TableControl::GetFocus() { - if ( !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) ) + if ( !m_pImpl || !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) ) Control::GetFocus(); } void TableControl::LoseFocus() { - if ( !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) ) + if ( !m_pImpl || !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) ) Control::LoseFocus(); } diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 47aa13398ddf..069211cf3143 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -1199,12 +1199,13 @@ namespace svt { Control::LoseFocus(); - if ( !!m_pImpl->m_aFocusedItem ) + if ( m_pImpl ) { - m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem ); - } + if ( !!m_pImpl->m_aFocusedItem ) + m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem ); - m_pImpl->m_aFocusedItem.reset(); + m_pImpl->m_aFocusedItem.reset(); + } } |