[Libreoffice-commits] core.git: svx/source
Caolán McNamara
caolanm at redhat.com
Mon May 19 03:46:06 PDT 2014
svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 7 ++++-
svx/source/dialog/dlgctrl.cxx | 17 +++-----------
2 files changed, 9 insertions(+), 15 deletions(-)
New commits:
commit 12d9ac1f773e88abd0cfa975366db16e42ae4292
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 19 11:41:14 2014 +0100
Resolves: fdo#78841 crash because parent isn't SvxTabPage
regression from 60f11adb950e4f9645cc9ecb0f5af8235cc97366
Change-Id: I244dd9fba3dc8230fcac8710a1289151b25dcf6c
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index 76dd605..1d45757 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 aa529f7..ffb0be2 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();
More information about the Libreoffice-commits
mailing list