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 /sfx2/source/view | |
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 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/frame.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/frmload.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 17 |
5 files changed, 16 insertions, 16 deletions
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 70796e9a74aa..79287c3a3314 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -631,7 +631,7 @@ SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const ::com::sun::star::u bool SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const { - return i_rItem.ISA( SfxUnoFrameItem ) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame; + return dynamic_cast< const SfxUnoFrameItem* >(&i_rItem) != nullptr && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame; } SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index bae61e76852b..edc01fb72927 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -331,7 +331,7 @@ namespace // On the other side some special slots return a boolean state, // which can be set to FALSE. - const SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, _pResult ); + const SfxBoolItem *pItem = dynamic_cast<const SfxBoolItem*>( _pResult ); if ( pItem ) bSuccess = pItem->GetValue(); @@ -402,7 +402,8 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) { - for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, false ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, false ) ) + for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( nullptr, false ); pDoc; + pDoc = SfxObjectShell::GetNext( *pDoc, nullptr, false ) ) { if ( i_rxDocument == pDoc->GetModel() ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6cce9411dfe7..213753aaef6e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1967,9 +1967,9 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c if ( !pDoc ) { Reference< XModel > xDocument( i_rController->getModel() ); - for ( pDoc = SfxObjectShell::GetFirst( 0, false ); + for ( pDoc = SfxObjectShell::GetFirst( nullptr, false ); pDoc; - pDoc = SfxObjectShell::GetNext( *pDoc, 0, false ) + pDoc = SfxObjectShell::GetNext( *pDoc, nullptr, false ) ) { if ( pDoc->GetModel() == xDocument ) diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 726e83a92f90..93940f35100b 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -98,7 +98,7 @@ void SfxViewFrame::UpdateTitle() void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - if ( rHint.IsA(TYPE(SfxSimpleHint)) ) + if ( dynamic_cast<const SfxSimpleHint *>(&rHint) != nullptr ) { switch( ( (SfxSimpleHint&) rHint ).GetId() ) { @@ -225,7 +225,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq ) aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) ); aReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString( "_blank" ) ) ); SfxGetpApp()->ExecuteSlot( aReq ); - const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() ); + const SfxViewFrameItem* pItem = dynamic_cast<const SfxViewFrameItem*>( aReq.GetReturnValue() ); if ( pItem ) rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) ); break; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index b103283fcfd4..eb278cbd3fa3 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1342,9 +1342,9 @@ SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController ) if ( !i_rController.is() ) return NULL; - for ( SfxViewShell* pViewShell = SfxViewShell::GetFirst( NULL, false ); + for ( SfxViewShell* pViewShell = SfxViewShell::GetFirst( false ); pViewShell; - pViewShell = SfxViewShell::GetNext( *pViewShell, NULL, false ) + pViewShell = SfxViewShell::GetNext( *pViewShell, false ) ) { if ( pViewShell->GetController() == i_rController ) @@ -1503,11 +1503,10 @@ void SfxViewShell::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue // returns the first shell of spec. type viewing the specified doc. - SfxViewShell* SfxViewShell::GetFirst ( - const TypeId* pType, - bool bOnlyVisible + bool bOnlyVisible, + std::function< bool ( const SfxViewShell* ) > isViewShell ) { // search for a SfxViewShell of the specified type @@ -1527,7 +1526,7 @@ SfxViewShell* SfxViewShell::GetFirst if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned - if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) ) + if ( ( !bOnlyVisible || pFrame->IsVisible() ) && (!isViewShell || isViewShell(pShell))) return pShell; break; } @@ -1544,8 +1543,8 @@ SfxViewShell* SfxViewShell::GetFirst SfxViewShell* SfxViewShell::GetNext ( const SfxViewShell& rPrev, - const TypeId* pType, - bool bOnlyVisible + bool bOnlyVisible, + std::function<bool ( const SfxViewShell* )> isViewShell ) { SfxViewShellArr_Impl &rShells = SfxGetpApp()->GetViewShells_Impl(); @@ -1569,7 +1568,7 @@ SfxViewShell* SfxViewShell::GetNext if ( pFrame == pShell->GetViewFrame() ) { // only ViewShells with a valid ViewFrame will be returned - if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) ) + if ( ( !bOnlyVisible || pFrame->IsVisible() ) && (!isViewShell || isViewShell(pShell)) ) return pShell; break; } |