diff options
-rw-r--r-- | forms/source/richtext/richtextviewport.cxx | 14 | ||||
-rw-r--r-- | reportdesign/source/ui/report/propbrw.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphfedit.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/preview.cxx | 6 | ||||
-rw-r--r-- | starmath/source/view.cxx | 5 | ||||
-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 |
12 files changed, 45 insertions, 21 deletions
diff --git a/forms/source/richtext/richtextviewport.cxx b/forms/source/richtext/richtextviewport.cxx index 6862f755237d..9a206b79ce4a 100644 --- a/forms/source/richtext/richtextviewport.cxx +++ b/forms/source/richtext/richtextviewport.cxx @@ -48,15 +48,21 @@ namespace frm void RichTextViewPort::GetFocus() { Control::GetFocus(); - m_pView->SetSelectionMode( EE_SELMODE_STD ); - m_pView->ShowCursor( true ); + if (m_pView) + { + m_pView->SetSelectionMode( EE_SELMODE_STD ); + m_pView->ShowCursor( true ); + } } void RichTextViewPort::LoseFocus() { - m_pView->HideCursor(); - m_pView->SetSelectionMode( m_bHideInactiveSelection ? EE_SELMODE_HIDDEN : EE_SELMODE_STD ); + if (m_pView) + { + m_pView->HideCursor(); + m_pView->SetSelectionMode( m_bHideInactiveSelection ? EE_SELMODE_HIDDEN : EE_SELMODE_STD ); + } Control::LoseFocus(); } diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 0fb2b0e62dfe..941979199fdc 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -579,7 +579,8 @@ IMPL_LINK( PropBrw, OnAsyncGetFocus, void*, ) void PropBrw::LoseFocus() { DockingWindow::LoseFocus(); - m_pDesignView->getController().InvalidateAll(); + if (m_pDesignView) + m_pDesignView->getController().InvalidateAll(); } } diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx index 99bb77b0c742..c3927578c4cf 100644 --- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx +++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx @@ -144,6 +144,7 @@ void ScPivotLayoutTreeListBase::GetFocus() void ScPivotLayoutTreeListBase::LoseFocus() { SvTreeListBox::LoseFocus(); - mpParent->mpPreviouslyFocusedListBox = this; + if (mpParent) + mpParent->mpPreviouslyFocusedListBox = this; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 69dc943b72d3..c087920e98cd 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -291,6 +291,8 @@ void ScEditWindow::GetFocus() } else pAcc = NULL; + + Control::GetFocus(); } void ScEditWindow::LoseFocus() @@ -302,6 +304,7 @@ void ScEditWindow::LoseFocus() } else pAcc = NULL; + Control::LoseFocus(); } ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ScEditWindow::CreateAccessible() diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 69fd520a7a21..8cf05b2cdab5 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -286,6 +286,7 @@ void ScFilterListBox::LoseFocus() #ifndef UNX Hide(); #endif + vcl::Window::LoseFocus(); } bool ScFilterListBox::PreNotify( NotifyEvent& rNEvt ) @@ -4871,7 +4872,7 @@ void ScGridWindow::LoseFocus() { ScTabViewShell* pViewShell = pViewData->GetViewShell(); - if (pViewShell->HasAccessibilityObjects()) + if (pViewShell && pViewShell->HasAccessibilityObjects()) pViewShell->BroadcastAccessibility(ScAccGridWinFocusLostHint(eWhich, GetAccessible())); Window::LoseFocus(); diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 5a59c2c8411f..d4adc42769e9 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -1506,14 +1506,16 @@ void ScPreview::InvalidateLocationData(sal_uLong nId) void ScPreview::GetFocus() { - if (pViewShell->HasAccessibilityObjects()) + Window::GetFocus(); + if (pViewShell && pViewShell->HasAccessibilityObjects()) pViewShell->BroadcastAccessibility( ScAccWinFocusGotHint(GetAccessible()) ); } void ScPreview::LoseFocus() { - if (pViewShell->HasAccessibilityObjects()) + if (pViewShell && pViewShell->HasAccessibilityObjects()) pViewShell->BroadcastAccessibility( ScAccWinFocusLostHint(GetAccessible()) ); + Window::LoseFocus(); } com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> ScPreview::CreateAccessible() diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 829b6af9c2b2..304327be8f3b 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -268,8 +268,9 @@ void SmGraphicWindow::LoseFocus() void SmGraphicWindow::RepaintViewShellDoc() { - SmDocShell &rDoc = *pViewShell->GetDoc(); - rDoc.Repaint(); + SmDocShell *pDoc = pViewShell->GetDoc(); + if (pDoc) + pDoc->Repaint(); } IMPL_LINK_NOARG(SmGraphicWindow, CaretBlinkTimerHdl) 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(); + } } |