diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-19 11:41:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-19 11:45:39 +0100 |
commit | 12d9ac1f773e88abd0cfa975366db16e42ae4292 (patch) | |
tree | 968f2244435d0a3d076e90de63dfc67979bed26c /svx/source | |
parent | 43716387ee437811b6b21b93d59171641906674f (diff) |
Resolves: fdo#78841 crash because parent isn't SvxTabPage
regression from 60f11adb950e4f9645cc9ecb0f5af8235cc97366
Change-Id: I244dd9fba3dc8230fcac8710a1289151b25dcf6c
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 7 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 17 |
2 files changed, 9 insertions, 15 deletions
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 76dd605b4fa6..1d45757fb26f 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -101,7 +101,9 @@ uno::Reference< XAccessible > SvxPixelCtlAccessible::getAccessibleParent( ) throw (uno::RuntimeException, std::exception) { ::osl::MutexGuard aGuard( m_aMutex ); - return mrPixelCtl.GetParent()->GetAccessible( true ); + Window *pTabPage = getNonLayoutParent(&mrPixelCtl); + assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType()); + return pTabPage->GetAccessible( true ); } sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( ) @@ -109,7 +111,8 @@ sal_Int32 SvxPixelCtlAccessible::getAccessibleIndexInParent( ) { ::osl::MutexGuard aGuard( m_aMutex ); sal_uInt16 nIdx = 0; - Window* pTabPage = mrPixelCtl.GetParent(); + Window *pTabPage = getNonLayoutParent(&mrPixelCtl); + assert(pTabPage && WINDOW_TABPAGE == pTabPage->GetType()); sal_uInt16 nChildren = pTabPage->GetChildCount(); for(nIdx = 0; nIdx < nChildren; nIdx++) if(pTabPage->GetChild( nIdx ) == &mrPixelCtl) diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index aa529f78c57f..ffb0be2a32f5 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -264,22 +264,13 @@ void SvxRectCtl::MouseButtonDown( const MouseEvent& rMEvt ) SetActualRP( eRP ); - Window* pParent = GetParent(); - while (pParent) - { - if( WINDOW_TABPAGE == pParent->GetType() ) - { - ( (SvxTabPage*) pParent )->PointChanged( this, eRP ); - break; - } - pParent = pParent->GetParent(); - } + Window *pTabPage = getNonLayoutParent(this); + if (pTabPage && WINDOW_TABPAGE == pTabPage->GetType()) + ( (SvxTabPage*)pTabPage)->PointChanged( this, eRP ); } } } - - void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt ) { // CompletelyDisabled() added to have a disabled state for SvxRectCtl @@ -812,7 +803,7 @@ long SvxPixelCtl::ShowPosition( const Point &pt) Window *pTabPage = getNonLayoutParent(this); if (pTabPage && WINDOW_TABPAGE == pTabPage->GetType()) - ( (SvxTabPage*) GetParent() )->PointChanged( this, RP_MM ); // RectPoint ist dummy + ( (SvxTabPage*)pTabPage)->PointChanged( this, RP_MM ); // RectPoint ist dummy return GetFoucsPosIndex(); |