audit GetParent harder wrt GetParentDialog

weed out assumption that widgets are direct children of Dialogs

Change-Id: Ib2cf0c8862bd5e82b13380634ed82ca7fcc746b8
This commit is contained in:
Caolán McNamara
2013-03-04 13:03:57 +00:00
parent 045e411565
commit cc71e03d3b
8 changed files with 13 additions and 13 deletions

View File

@@ -1422,7 +1422,7 @@ namespace svx
rLoseFocusHdl.Call( this );
m_rScrollBar.SetThumbPos( m_rScrollBar.GetThumbPos() + ( _bUp? -1 : 1 ) );
( static_cast< HangulHanjaEditDictDialog* >( GetParent() ) )->UpdateScrollbar();
( static_cast< HangulHanjaEditDictDialog* >( GetParentDialog() ) )->UpdateScrollbar();
}
SuggestionEdit::SuggestionEdit( Window* pParent, const ResId& rResId,

View File

@@ -52,11 +52,11 @@ void HyphenEdit::KeyInput( const KeyEvent& rKEvt )
switch ( nCode )
{
case KEY_LEFT:
( (SvxHyphenWordDialog*)GetParent() )->SelLeft();
( (SvxHyphenWordDialog*)GetParentDialog() )->SelLeft();
break;
case KEY_RIGHT:
( (SvxHyphenWordDialog*)GetParent() )->SelRight();
( (SvxHyphenWordDialog*)GetParentDialog() )->SelRight();
break;
case KEY_TAB:

View File

@@ -1119,7 +1119,7 @@ IMPL_LINK( SvxNumberFormatTabPage, DoubleClickHdl_Impl, SvxFontListBox*, pLb )
}
else
{
SfxNoLayoutSingleTabDialog* pParent = dynamic_cast< SfxNoLayoutSingleTabDialog* >( GetParent() );
SfxNoLayoutSingleTabDialog* pParent = dynamic_cast< SfxNoLayoutSingleTabDialog* >( GetParentDialog() );
OKButton* pOKButton = pParent ? pParent->GetOKButton() : NULL;
if ( pOKButton )
pOKButton->Click();

View File

@@ -71,13 +71,13 @@ namespace dbmm
//--------------------------------------------------------------------
const MacroMigrationDialog& MacroMigrationPage::getDialog() const
{
return *dynamic_cast< const MacroMigrationDialog* >( GetParent() );
return *dynamic_cast< const MacroMigrationDialog* >( GetParentDialog() );
}
//--------------------------------------------------------------------
MacroMigrationDialog& MacroMigrationPage::getDialog()
{
return *dynamic_cast< MacroMigrationDialog* >( GetParent() );
return *dynamic_cast< MacroMigrationDialog* >( GetParentDialog() );
}
//====================================================================

View File

@@ -322,7 +322,7 @@ namespace pcr
{
SvTreeListBox::ModelHasMoved( _pSource );
((TabOrderDialog*)Window::GetParent())->SetModified();
((TabOrderDialog*)GetParentDialog())->SetModified();
}
//------------------------------------------------------------------------
@@ -332,7 +332,7 @@ namespace pcr
Image aImage;
for (long i=0; i<labs(nRelPos); i++)
{
((TabOrderDialog*)Window::GetParent())->SetModified();
((TabOrderDialog*)GetParentDialog())->SetModified();
//////////////////////////////////////////////////////////////////////
// move entries

View File

@@ -290,7 +290,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
pView->DeleteMarked();
bProc = sal_True;
if( !pView->AreObjectsMarked() )
((Dialog*)GetParent())->GrabFocusToFirstControl();
GetParentDialog()->GrabFocusToFirstControl();
}
}
break;
@@ -314,12 +314,12 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
}
else
{
((Dialog*)GetParent())->GrabFocusToFirstControl();
GetParentDialog()->GrabFocusToFirstControl();
}
}
else
{
((Dialog*)GetParent())->GrabFocusToFirstControl();
GetParentDialog()->GrabFocusToFirstControl();
}
bProc = sal_True;
}

View File

@@ -794,7 +794,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl)
{
String sFldTypeName = aCategoryBox.GetText();
SfxNoLayoutSingleTabDialog *pDlg = dynamic_cast<SfxNoLayoutSingleTabDialog*>(GetParent());
SfxNoLayoutSingleTabDialog *pDlg = dynamic_cast<SfxNoLayoutSingleTabDialog*>(GetParentDialog());
PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL;
if (pBtn)
pBtn->Enable(sFldTypeName.Len() != 0);

View File

@@ -189,7 +189,7 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
if( rEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pWheelData = rEvt.GetWheelData();
PrintDialog* pDlg = dynamic_cast<PrintDialog*>(GetParent());
PrintDialog* pDlg = dynamic_cast<PrintDialog*>(GetParentDialog());
if( pDlg )
{
if( pWheelData->GetDelta() > 0 )