diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-30 16:10:07 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-10-06 07:29:37 +0000 |
commit | 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch) | |
tree | 871a91210913ecee91530c95392534bf18f80f3f /sc/source/ui/miscdlgs | |
parent | 32b9901dae7403453d773f5904de15551a323595 (diff) |
tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
idl, editeng, sc, sd, sw, sfx2, sot, starmath
Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sc/source/ui/miscdlgs')
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 38 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/mvtabdlg.cxx | 2 |
2 files changed, 17 insertions, 23 deletions
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 93232fde5e22..385537a20f26 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -92,8 +92,7 @@ void ScFormulaReferenceHelper::dispose() void ScFormulaReferenceHelper::enableInput( bool bEnable ) { - TypeId aType(TYPE(ScDocShell)); - ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType)); + ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>)); while( pDocShell ) { SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); @@ -103,7 +102,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable ) if ( !pFrame->GetFrame().IsInPlace() ) { SfxViewShell* p = pFrame->GetViewShell(); - ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p); + ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); if(pViewSh!=NULL) { vcl::Window *pWin=pViewSh->GetWindow(); @@ -122,7 +121,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable ) pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ); } - pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType)); + pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>)); } } @@ -655,8 +654,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock ) { // lock / unlock only the dispatchers of Calc documents - TypeId aType(TYPE(ScDocShell)); - ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType)); + ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>)); while( pDocShell ) { SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); @@ -668,7 +666,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock ) pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ); } - pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType)); + pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>)); } // if a new view is created while the dialog is open, @@ -684,8 +682,7 @@ void ScFormulaReferenceHelper::ViewShellChanged() } void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren) { - TypeId aType(TYPE(ScDocShell)); - ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType)); + ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>)); while( pDocShell ) { SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); @@ -695,7 +692,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren) if ( !pFrame->GetFrame().IsInPlace() ) { SfxViewShell* p = pFrame->GetViewShell(); - ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p); + ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); if(pViewSh!=NULL) { vcl::Window *pWin=pViewSh->GetWindow(); @@ -714,14 +711,13 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren) pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ); } - pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType)); + pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>)); } } static void lcl_InvalidateWindows() { - TypeId aType(TYPE(ScDocShell)); - ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType)); + ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>)); while( pDocShell ) { SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); @@ -731,7 +727,7 @@ static void lcl_InvalidateWindows() if ( !pFrame->GetFrame().IsInPlace() ) { SfxViewShell* p = pFrame->GetViewShell(); - ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p); + ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p ); if(pViewSh!=NULL) { vcl::Window *pWin=pViewSh->GetWindow(); @@ -746,18 +742,17 @@ static void lcl_InvalidateWindows() pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell ); } - pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, &aType)); + pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>)); } } static void lcl_HideAllReferences() { - TypeId aScType = TYPE(ScTabViewShell); - SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType ); + SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> ); while ( pSh ) { static_cast<ScTabViewShell*>(pSh)->ClearHighlightRanges(); - pSh = SfxViewShell::GetNext( *pSh, &aScType ); + pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> ); } } @@ -799,7 +794,7 @@ bool ScRefHandler::EnterRefMode() SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame(); if (pMyViewFrm) { - pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() ); + pScViewShell = dynamic_cast<ScTabViewShell*>( pMyViewFrm->GetViewShell() ); if( pScViewShell ) pScViewShell->UpdateInputHandler(true); pParentDoc = pMyViewFrm->GetObjectShell(); @@ -875,8 +870,7 @@ void ScRefHandler::SwitchToDocument() } } - TypeId aScType = TYPE(ScTabViewShell); - SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType ); + SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> ); while ( pSh ) { SfxObjectShell* pObjSh = pSh->GetObjectShell(); @@ -886,7 +880,7 @@ void ScRefHandler::SwitchToDocument() static_cast<ScTabViewShell*>(pSh)->SetActive(); return; } - pSh = SfxViewShell::GetNext( *pSh, &aScType ); + pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> ); } } diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index a6f2f24620fe..e1f9226ae5d9 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -227,7 +227,7 @@ void ScMoveTableDlg::InitDocListBox() while ( pSh ) { - pScSh = PTR_CAST( ScDocShell, pSh ); + pScSh = dynamic_cast<ScDocShell*>( pSh ); if ( pScSh ) { |