diff options
Diffstat (limited to 'sd/source/ui/view')
29 files changed, 138 insertions, 135 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 86df4579f849..06dd0ef4bdaa 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1421,7 +1421,7 @@ private: rOutliner.SetControlWord( nCntrl ); // When in outline view then apply all pending changes to the model. - if (pShell->ISA(OutlineViewShell)) + if( dynamic_cast< OutlineViewShell *>( pShell ) != nullptr) static_cast<OutlineViewShell*>(pShell)->PrepareClose (false); // Collect some frequently used data. diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index 3de3a18959f6..50907f81262a 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -108,7 +108,7 @@ void GraphicObjectBar::GetFilterState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) bEnable = true; } @@ -124,7 +124,7 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); diff --git a/sd/source/ui/view/MediaObjectBar.cxx b/sd/source/ui/view/MediaObjectBar.cxx index 7c191ae057c7..a0df58bfecd3 100644 --- a/sd/source/ui/view/MediaObjectBar.cxx +++ b/sd/source/ui/view/MediaObjectBar.cxx @@ -93,7 +93,7 @@ void MediaObjectBar::GetState( SfxItemSet& rSet ) { SdrObject* pObj =pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrMediaObj ) ) + if( pObj && dynamic_cast< SdrMediaObj *>( pObj ) != nullptr ) { ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX ); @@ -129,7 +129,7 @@ void MediaObjectBar::Execute( SfxRequest& rReq ) { SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrMediaObj ) ) + if( pObj && dynamic_cast< SdrMediaObj *>( pObj ) != nullptr ) { static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem( static_cast< const ::avmedia::MediaItem& >( *pItem ) ); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 29521588152b..9cde9d74b9dc 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -251,7 +251,7 @@ void Outliner::PrepareSpelling() { mbPrepareSpellingPending = false; - ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast< ViewShellBase *>( SfxViewShell::Current() ); if (pBase != NULL) SetViewShell (pBase->GetMainViewShell()); SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) ); @@ -294,7 +294,7 @@ void Outliner::EndSpelling() std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); std::shared_ptr<ViewShell> pOldViewShell (pViewShell); - ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast< ViewShellBase *>( SfxViewShell::Current() ); if (pBase != NULL) pViewShell = pBase->GetMainViewShell(); else @@ -303,7 +303,7 @@ void Outliner::EndSpelling() // When in <member>PrepareSpelling()</member> a new outline view has // been created then delete it here. - bool bViewIsDrawViewShell(pViewShell && pViewShell->ISA(DrawViewShell)); + bool bViewIsDrawViewShell(pViewShell && 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )); if (bViewIsDrawViewShell) { SetStatusEventHdl(Link<EditStatus&,void>()); @@ -331,7 +331,7 @@ void Outliner::EndSpelling() // changes were done at SpellCheck if(IsModified()) { - if(mpView && mpView->ISA(OutlineView)) + if(mpView && dynamic_cast< const OutlineView *>( mpView ) != nullptr) static_cast<OutlineView*>(mpView)->PrepareClose(false); if(mpDrawDocument && !mpDrawDocument->IsChanged()) mpDrawDocument->SetChanged(); @@ -354,7 +354,7 @@ void Outliner::EndSpelling() bool Outliner::SpellNextDocument() { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell->ISA(OutlineViewShell)) + if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // When doing a spell check in the outline view then there is // only one document. @@ -363,7 +363,7 @@ bool Outliner::SpellNextDocument() } else { - if (mpView->ISA(OutlineView)) + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) static_cast<OutlineView*>(mpView)->PrepareClose(false); mpDrawDocument->GetDocSh()->SetWaitCursor( true ); @@ -439,7 +439,7 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) mpDrawDocument->GetDocSh()->SetWaitCursor( true ); if (mbPrepareSpellingPending) PrepareSpelling(); - ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast< ViewShellBase *>( SfxViewShell::Current() ); // Determine whether we have to abort the search. This is necessary // when the main view shell does not support searching. bool bAbort = false; @@ -532,7 +532,7 @@ void Outliner::Initialize (bool bDirectionIsForward) // In case we are searching in an outline view then first remove the // current selection and place cursor at its start or end. - if (pViewShell->ISA(OutlineViewShell)) + if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { ESelection aSelection = mpImpl->GetOutlinerView()->GetSelection (); if (mbDirectionIsForward) @@ -591,7 +591,7 @@ bool Outliner::SearchAndReplaceAll() return true; } - if (pViewShell->ISA(OutlineViewShell)) + if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Put the cursor to the beginning/end of the outliner. mpImpl->GetOutlinerView()->SetSelection (GetSearchStartPosition ()); @@ -599,7 +599,7 @@ bool Outliner::SearchAndReplaceAll() // The outliner does all the work for us when we are in this mode. SearchAndReplaceOnce(); } - else if (pViewShell->ISA(DrawViewShell)) + else if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { // Go to beginning/end of document. maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin(); @@ -644,7 +644,7 @@ bool Outliner::SearchAndReplaceOnce() mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); - if (pViewShell->ISA(DrawViewShell) ) + if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { // When replacing we first check if there is a selection // indicating a match. If there is then replace it. The @@ -689,7 +689,7 @@ bool Outliner::SearchAndReplaceOnce() } } } - else if (pViewShell->ISA(OutlineViewShell)) + else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { mpDrawDocument->GetDocSh()->SetWaitCursor(false); // The following loop is executed more than once only when a @@ -835,7 +835,7 @@ void Outliner::RememberStartPosition() if ( mnStartPageIndex != (sal_uInt16) -1 ) return; - if (pViewShell->ISA(DrawViewShell)) + if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); @@ -863,7 +863,7 @@ void Outliner::RememberStartPosition() } } } - else if (pViewShell->ISA(OutlineViewShell)) + else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Remember the current cursor position. OutlinerView* pView = GetView(0); @@ -890,7 +890,7 @@ void Outliner::RestoreStartPosition() if (bRestore) { - if (pViewShell->ISA(DrawViewShell)) + if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); @@ -898,7 +898,7 @@ void Outliner::RestoreStartPosition() if (pDrawViewShell.get() != NULL) SetPage (meStartEditMode, mnStartPageIndex); } - else if (pViewShell->ISA(OutlineViewShell)) + else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Set cursor to its old position. OutlinerView* pView = GetView(0); @@ -996,7 +996,7 @@ void Outliner::EndOfSearch() // Before we display a dialog we first jump to where the last valid text // object was found. All page and view mode switching since then was // temporary and should not be visible to the user. - if ( ! pViewShell->ISA(OutlineViewShell)) + if( 0 == dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) SetObject (maLastValidPosition); if (mbRestrictSearchToSelection) @@ -1016,7 +1016,7 @@ void Outliner::EndOfSearch() mbMatchMayExist = false; // Everything back to beginning (or end?) of the document. maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin(); - if (pViewShell->ISA(OutlineViewShell)) + if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Set cursor to first character of the document. OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); @@ -1425,7 +1425,7 @@ void Outliner::StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLan const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive ) { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - bool bMultiDoc = pViewShell->ISA(DrawViewShell); + bool bMultiDoc = 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() ); meMode = TEXT_CONVERSION; mbDirectionIsForward = true; @@ -1477,7 +1477,7 @@ void Outliner::BeginConversion() { SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) ); - ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() ); if (pBase != NULL) SetViewShell (pBase->GetMainViewShell()); @@ -1510,7 +1510,7 @@ void Outliner::EndConversion() bool Outliner::ConvertNextDocument() { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell && pViewShell->ISA(OutlineViewShell) ) + if (pViewShell && 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() ) ) return false; mpDrawDocument->GetDocSh()->SetWaitCursor( true ); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 6c4e4041eda6..df28bb3a22b9 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -244,7 +244,7 @@ ViewShellBase::ViewShellBase ( _pFrame->GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor()); // Set up the members in the correct order. - if (GetViewFrame()->GetObjectShell()->ISA(DrawDocShell)) + if (0 != dynamic_cast< DrawDocShell *>( GetViewFrame()->GetObjectShell() )) mpDocShell = static_cast<DrawDocShell*>( GetViewFrame()->GetObjectShell()); if (mpDocShell != NULL) @@ -386,7 +386,7 @@ ViewShellBase* ViewShellBase::GetViewShellBase (SfxViewFrame* pViewFrame) // Get the view shell for the frame and cast it to // sd::ViewShellBase. SfxViewShell* pSfxViewShell = pViewFrame->GetViewShell(); - if (pSfxViewShell!=NULL && pSfxViewShell->ISA(::sd::ViewShellBase)) + if (pSfxViewShell!=NULL && dynamic_cast< ::sd::ViewShellBase *>( pSfxViewShell ) != nullptr) pBase = static_cast<ViewShellBase*>(pSfxViewShell); } @@ -689,7 +689,7 @@ void ViewShellBase::ReadUserDataSequence ( case ViewShell::ST_HANDOUT: { OUString sViewURL; - switch (PTR_CAST(DrawViewShell, pShell)->GetPageKind()) + switch (dynamic_cast<DrawViewShell*>( pShell)->GetPageKind() ) { default: case PK_STANDARD: @@ -1270,8 +1270,8 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) ViewShell* pCenterViewShell = FrameworkHelper::Instance(mrBase)->GetViewShell( FrameworkHelper::msCenterPaneURL).get(); bool bMasterPageMode (false); - if (pCenterViewShell!=NULL && pCenterViewShell->ISA(DrawViewShell)) - if (PTR_CAST(DrawViewShell,pCenterViewShell)->GetEditMode() + if (pCenterViewShell!=NULL && dynamic_cast< DrawViewShell *>( pCenterViewShell ) != nullptr) + if (dynamic_cast< DrawViewShell *>( pCenterViewShell )->GetEditMode() == EM_MASTERPAGE) { bMasterPageMode = true; diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 970e9db8a05f..2dfddca385a9 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -234,8 +234,8 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind ePageKind ) { - const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE, false, TYPE(SfxUInt32Item) ) ); - const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT, false, TYPE(SfxUInt32Item) ) ); + const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE, false, checkSfxPoolItem< SfxUInt32Item > ) ); + const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT, false, checkSfxPoolItem< SfxUInt32Item > ) ); SdDrawDocument* pDocument = mrViewShell.GetDoc(); if( !pDocument ) diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx index a52dd5786ea0..24c141789627 100644 --- a/sd/source/ui/view/drbezob.cxx +++ b/sd/source/ui/view/drbezob.cxx @@ -96,12 +96,12 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet) if(xFunc.is()) { - if(xFunc->ISA(FuSelection)) + if( 0 != dynamic_cast< const FuSelection *>( xFunc.get() )) { sal_uInt16 nEditMode = static_cast<FuSelection*>(xFunc.get())->GetEditMode(); rSet.Put(SfxBoolItem(nEditMode, true)); } - else if (xFunc->ISA(FuConstructBezierPolygon)) + else if( 0 != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) { sal_uInt16 nEditMode = static_cast<FuConstructBezierPolygon*>(xFunc.get())->GetEditMode(); rSet.Put(SfxBoolItem(nEditMode, true)); @@ -302,11 +302,11 @@ void BezierObjectBar::Execute(SfxRequest& rReq) if(xFunc.is()) { - if(xFunc->ISA(FuSelection)) + if( 0 != dynamic_cast< const FuSelection *>( xFunc.get() )) { static_cast<FuSelection*>(xFunc.get())->SetEditMode(rReq.GetSlot()); } - else if(xFunc->ISA(FuConstructBezierPolygon)) + else if( 0 != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) { static_cast<FuConstructBezierPolygon*>(xFunc.get())->SetEditMode(rReq.GetSlot()); } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 45c868f13f06..900ea482b165 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -189,7 +189,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); SdrOutliner *pOutliner = mpView->GetTextEditOutliner(); - if (mpView->ISA(OutlineView)) + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow( mpViewShell->GetActiveWindow()); @@ -261,13 +261,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); - if (mpView->ISA(OutlineView)) + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow( mpViewShell->GetActiveWindow()); } - bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell); + bool bOutlineViewSh = dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr; if (pOLV && ( pOLV->GetOutliner()->GetMode() == OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) ) @@ -428,7 +428,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) rSet.Put( aAttrSet, false ); // <- sal_False, so DontCare-Status gets acquired // these are disabled in outline-mode - if (!mpViewShell || !mpViewShell->ISA(DrawViewShell)) + if (!mpViewShell || dynamic_cast< const DrawViewShell *>( mpViewShell ) == nullptr) { rSet.DisableItem( SID_ATTR_PARA_ADJUST_LEFT ); rSet.DisableItem( SID_ATTR_PARA_ADJUST_RIGHT ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index be7b3fc0cdc4..4a50c0374a32 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -89,7 +89,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) std::unique_ptr< OutlineViewModelChangeGuard > aGuard; - if (mpView->ISA(OutlineView)) + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pOLV = static_cast<OutlineView*>(mpView) ->GetViewByWindow(mpViewShell->GetActiveWindow()); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 2a8c7bfb6844..67c41682501c 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -37,6 +37,7 @@ #include <editeng/editdata.hxx> #include <editeng/eeitem.hxx> #include <editeng/flditem.hxx> +#include <editeng/editeng.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> @@ -808,7 +809,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ::Outliner* pOutl = mpDrawView->GetTextEditOutliner(); if (pOutl) { - pOutl->RemoveFields(true, SvxURLField::StaticType()); + pOutl->RemoveFields(true, checkSvxFieldData<SvxURLField>); } pSet.reset(new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END )); @@ -953,7 +954,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() ); { @@ -972,7 +973,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); m_ExternalEdits.push_back( @@ -993,7 +994,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ); @@ -1700,7 +1701,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( pFieldItem ) { const SvxFieldData* pField = pFieldItem->GetField(); - if( pField && pField->ISA( SvxURLField ) ) + if( pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr ) { const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField ); @@ -1905,13 +1906,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { const SvxFieldItem* pOldFldItem = pOLV->GetFieldAtSelection(); - if( pOldFldItem && ( pOldFldItem->GetField()->ISA( SvxURLField ) || - pOldFldItem->GetField()->ISA( SvxDateField ) || - pOldFldItem->GetField()->ISA( SvxTimeField ) || - pOldFldItem->GetField()->ISA( SvxExtTimeField ) || - pOldFldItem->GetField()->ISA( SvxExtFileField ) || - pOldFldItem->GetField()->ISA( SvxAuthorField ) || - pOldFldItem->GetField()->ISA( SvxPageField ) ) ) + if( pOldFldItem && ( 0 != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) ) ) { // select field, then it will be deleted when inserting ESelection aSel = pOLV->GetSelection(); @@ -1970,10 +1971,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection(); - if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) || - pFldItem->GetField()->ISA( SvxAuthorField ) || - pFldItem->GetField()->ISA( SvxExtFileField ) || - pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) + if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); @@ -2335,8 +2336,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrMark* pM=rMarkList.GetMark(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); - SdrGrafObj* pGraf=PTR_CAST(SdrGrafObj,pObj); - SdrOle2Obj* pOle2=PTR_CAST(SdrOle2Obj,pObj); + SdrGrafObj* pGraf= dynamic_cast< SdrGrafObj *>( pObj ); + SdrOle2Obj* pOle2= dynamic_cast< SdrOle2Obj *>( pObj ); if(pGraf) { diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 7d073ae2ea80..9a162934414c 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -153,7 +153,7 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) { SdrObject* pObj = aIter.Next(); - if(pObj && pObj->ISA(SdrTextObj)) + if(pObj && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) { sal_uInt32 nInv(pObj->GetObjInventor()); sal_uInt16 nKnd(pObj->GetObjIdentifier()); @@ -507,7 +507,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) pWin != NULL && !mpDrawView->IsAction() && !SD_MOD()->GetWaterCan() ) { sal_uInt16 nSdResId = 0; // ResourceID for popup menu - bool bGraphicShell = this->ISA(GraphicViewShell); + bool bGraphicShell = dynamic_cast< const GraphicViewShell *>( this ) != nullptr; // is there a snap object under the cursor? SdrPageView* pPV; @@ -538,10 +538,10 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) nSdResId = RID_DRAW_GLUEPOINT_POPUP; } // field command? - else if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) || - pFldItem->GetField()->ISA( SvxExtTimeField ) || - pFldItem->GetField()->ISA( SvxExtFileField ) || - pFldItem->GetField()->ISA( SvxAuthorField ) ) ) + else if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ) ) { LanguageType eLanguage( LANGUAGE_SYSTEM ); diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 607c54dbb8a9..d6565591acbb 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -356,7 +356,7 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet ) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); // valid graphic object? - if( pObj && pObj->ISA( SdrGrafObj ) && + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && !static_cast<const SdrGrafObj*>(pObj)->IsEPS() && !mpDrawView->IsTextEdit() ) { diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 480b433445de..f165ddbb5fc9 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -609,7 +609,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) // avoid clipboard initialization for // read-only presentation views (workaround for NT4.0 // clipboard prob...) - if( !ISA(PresentationViewShell) ) + if( dynamic_cast< const PresentationViewShell *>( this ) == nullptr ) { // create listener mpClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) ); @@ -1491,7 +1491,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) { const SvxFieldData* pField = pFieldItem->GetField(); - if ( pField->ISA(SvxURLField) ) + if ( dynamic_cast< const SvxURLField *>( pField ) != nullptr ) bDisableEditHyperlink = false; } } @@ -1499,7 +1499,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } else { - SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()); + SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() ); if ( pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor() ) { diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 17c070993c8f..c1d409e6727b 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -110,7 +110,7 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& ) SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - if( pObj->ISA( SdrGrafObj ) ) + if( dynamic_cast< SdrGrafObj *>( pObj ) != nullptr ) { pGrafObj = static_cast< SdrGrafObj* >( pObj ); diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx index 72e50e70b0c8..68266fc0591f 100644 --- a/sd/source/ui/view/drviewsc.cxx +++ b/sd/source/ui/view/drviewsc.cxx @@ -53,7 +53,7 @@ namespace sd { void DrawViewShell::UpdateIMapDlg( SdrObject* pObj ) { - if( ( pObj->ISA( SdrGrafObj ) || pObj->ISA( SdrOle2Obj ) ) && !mpDrawView->IsTextEdit() && + if( ( dynamic_cast< SdrGrafObj *>( pObj ) != nullptr || dynamic_cast< SdrOle2Obj *>( pObj ) != nullptr ) && !mpDrawView->IsTextEdit() && GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) ) { Graphic aGraphic; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 9a86ddbd0f10..32e15576e051 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -266,7 +266,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) if(pDescriptorItem) { // get the form view - FmFormView* pFormView = PTR_CAST(FmFormView, mpDrawView); + FmFormView* pFormView = dynamic_cast<FmFormView*>( mpDrawView ); SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL; if(pPageView) @@ -348,7 +348,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) while (i < nMarkCnt && !b3DObjMarked) { - if (rMarkList.GetMark(i)->GetMarkedSdrObj()->ISA(E3dObject)) + if (0 != dynamic_cast< E3dObject *>( rMarkList.GetMark(i)->GetMarkedSdrObj() )) { b3DObjMarked = true; } diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 1e1e322f817d..bd6070a3ee53 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -97,7 +97,7 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) { const SvxFieldData* pField = pFieldItem->GetField(); - if (pField->ISA(SvxURLField)) + if( dynamic_cast< const SvxURLField *>( pField ) != nullptr) { aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index 94bb4df5e5c4..ab5a8d3f214d 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -85,7 +85,7 @@ void DrawViewShell::GetIMapState( SfxItemSet& rSet ) const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SvxIMapDlg* pImageMapDialog = ViewShell::Implementation::GetImageMapDialog(); - if ( ( pObj->ISA( SdrGrafObj ) /*|| pObj->ISA( SdrOle2Obj )*/ ) + if ( ( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr /*|| pObj->ISA( SdrOle2Obj )*/ ) && pImageMapDialog!=NULL && ( pImageMapDialog->GetEditingObject() == static_cast<void const *>(pObj) ) ) { diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 503b7404ae52..b8a19814ea0b 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -134,14 +134,14 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) /* If it is not a group object or 3D object, we disable "enter group". */ - if( !( ( pObj->ISA( SdrObjGroup ) && nInv == SdrInventor ) || - (pObj->ISA (E3dPolyScene) || pObj->ISA (E3dScene) /*|| pObj->ISA (E3dCompoundObject) */) ) ) + if( !( ( dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && nInv == SdrInventor ) || + (dynamic_cast< const E3dPolyScene* >(pObj) != nullptr|| dynamic_cast< const E3dScene* >(pObj) != nullptr /*|| pObj->ISA (E3dCompoundObject) */) ) ) { rSet.DisableItem( SID_ENTER_GROUP ); } // If it is not a group object, we disable "ungroup" - if (!(pObj->ISA(SdrObjGroup) && nInv == SdrInventor)) + if(!(dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr && nInv == SdrInventor)) { rSet.DisableItem(SID_UNGROUP); } @@ -170,7 +170,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem( SID_ATTR_FILL_TRANSPARENCE ); rSet.DisableItem( SID_ATTR_FILL_FLOATTRANSPARENCE ); } - if( (!pObj->ISA( SdrPathObj ) && !aInfoRec.bCanConvToPath) || pObj->ISA( SdrObjGroup ) ) // As long as JOE handles it incorrectly! + if( (dynamic_cast< const SdrPathObj *>( pObj ) == nullptr&& !aInfoRec.bCanConvToPath) || dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr ) // As long as JOE handles it incorrectly! { // JOE: a group object may can be converted into a PathObj rSet.DisableItem( SID_LINEEND_POLYGON ); } @@ -225,7 +225,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem( SID_OBJECT_SHEAR ); } - if(pObj->ISA(E3dCompoundObject)) + if(dynamic_cast< const E3dCompoundObject *>( pObj ) != nullptr) { rSet.DisableItem( SID_OBJECT_ALIGN ); rSet.DisableItem( SID_OBJECT_ALIGN_LEFT ); @@ -268,10 +268,10 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) { const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection(); - if( !( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) || - pFldItem->GetField()->ISA( SvxAuthorField ) || - pFldItem->GetField()->ISA( SvxExtFileField ) || - pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) ) + if( !( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) { rSet.DisableItem( SID_MODIFY_FIELD ); } @@ -360,9 +360,9 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) } else if (nInv == E3dInventor) { - if(pObj->ISA(E3dScene)) + if(dynamic_cast< const E3dScene *>( pObj ) != nullptr) b3dObj = true; - else if(pObj->ISA(E3dCompoundObject)) + else if(dynamic_cast< const E3dCompoundObject* >(pObj) != nullptr) bE3dCompoundObject = true; } } diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 03db5e64631d..c1f65c78b39f 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -84,7 +84,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * // Count the FrameViews and remember the type of the main // view shell. SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell(); - ViewShellBase* pBase = PTR_CAST(ViewShellBase, pSfxViewSh ); + ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( pSfxViewSh ); if (pBase != NULL) { diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index a12ac7bb4b38..366ac905703a 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -546,14 +546,14 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) const SvxFieldItem* pOldFldItem = pOutlinerView->GetFieldAtSelection(); - if( pOldFldItem && ( pOldFldItem->GetField()->ISA( SvxURLField ) || - pOldFldItem->GetField()->ISA( SvxDateField ) || - pOldFldItem->GetField()->ISA( SvxTimeField ) || - pOldFldItem->GetField()->ISA( SvxExtTimeField ) || - pOldFldItem->GetField()->ISA( SvxExtFileField ) || - pOldFldItem->GetField()->ISA( SvxAuthorField ) || - pOldFldItem->GetField()->ISA( SvxPageField ) || - pOldFldItem->GetField()->ISA( SvxPagesField )) ) + if( pOldFldItem && ( 0 != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) || + 0 != dynamic_cast< const SvxPagesField *>( pOldFldItem->GetField() )) ) { // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); @@ -576,10 +576,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection(); - if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) || - pFldItem->GetField()->ISA( SvxAuthorField ) || - pFldItem->GetField()->ISA( SvxExtFileField ) || - pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) + if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index e540acf76d8a..feedfac3d24a 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -371,7 +371,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) { const SvxFieldData* pField = pFieldItem->GetField(); - if ( pField->ISA(SvxURLField) ) + if ( dynamic_cast< const SvxURLField *>( pField ) != nullptr ) { aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); @@ -941,10 +941,10 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) { const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection(); - if( !( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) || - pFldItem->GetField()->ISA( SvxAuthorField ) || - pFldItem->GetField()->ISA( SvxExtFileField ) || - pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) ) + if( !( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) { rSet.DisableItem( SID_MODIFY_FIELD ); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 8b100921d904..6a88acb4599f 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -222,7 +222,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP { bool bCreateOutline(false); - if( pObject->IsEmptyPresObj() && pObject->ISA(SdrTextObj) ) + if( pObject->IsEmptyPresObj() && dynamic_cast< SdrTextObj *>( pObject ) != nullptr ) { if( !bSubContentProcessing || !pObject->IsNotVisibleAsMaster() ) { @@ -992,7 +992,7 @@ bool View::IsMorphingAllowed() const ( nKind1 != OBJ_GRAF && nKind2 != OBJ_GRAF ) && ( nKind1 != OBJ_OLE2 && nKind2 != OBJ_OLE2 ) && ( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) && - !pObj1->ISA( E3dObject) && !pObj2->ISA( E3dObject) ) + dynamic_cast< const E3dObject *>( pObj1 ) == nullptr && dynamic_cast< const E3dObject *>( pObj2 ) == nullptr ) { SfxItemSet aSet1( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE ); SfxItemSet aSet2( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE ); @@ -1276,7 +1276,7 @@ bool View::ShouldToggleOn( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(GetMarkedObjectByIndex(nIndex)); if (!pTextObj || pTextObj->IsTextEditActive()) continue; - if (pTextObj->ISA(SdrTableObj)) + if( dynamic_cast< const SdrTableObj *>( pTextObj ) != nullptr) { SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >(pTextObj); if (!pTableObj) @@ -1346,7 +1346,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(GetMarkedObjectByIndex(nIndex)); if (!pTextObj || pTextObj->IsTextEditActive()) continue; - if (pTextObj->ISA(SdrTableObj)) + if( dynamic_cast< SdrTableObj *>( pTextObj ) != nullptr) { SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >(pTextObj); if (!pTableObj) diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 24bff878d70c..c440d4befcc9 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -126,7 +126,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent { SdrObject* pObj = GetMarkedObjectByIndex(0); - if( pObj && pObj->ISA(SdrOle2Obj) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) + if( pObj && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try @@ -172,7 +172,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent { SdrObject* pObj = GetMarkedObjectByIndex( 0 ); - if( pObj && pObj->ISA( SdrOle2Obj ) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) + if( pObj && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try @@ -369,7 +369,7 @@ void View::StartDrag( const Point& rStartPos, vcl::Window* pWindow ) { rtl::Reference<FuPoor> xFunction( pDrawViewShell->GetCurrentFunction() ); - if( xFunction.is() && xFunction->ISA( FuDraw ) ) + if( xFunction.is() && 0 != dynamic_cast< const FuDraw *>( xFunction.get() ) ) static_cast<FuDraw*>(xFunction.get())->ForcePointer( NULL ); } @@ -792,7 +792,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar nRet = nDropAction; } } - else if( mpViewSh->ISA( DrawViewShell ) ) + else if( dynamic_cast< const DrawViewShell *>( mpViewSh ) != nullptr ) { // insert as normal URL button static_cast<DrawViewShell*>( mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), OUString(), &aPos ); @@ -928,7 +928,7 @@ typedef std::vector< SdrObject* > SdrObjectVector; void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector ) { bool bIsGroup(pObj->IsGroupObject()); - if(bIsGroup && pObj->ISA(E3dObject) && !pObj->ISA(E3dScene)) + if(bIsGroup && dynamic_cast< const E3dObject *>( pObj ) != nullptr && dynamic_cast< const E3dScene *>( pObj ) == nullptr) bIsGroup = false; rVector.push_back( pObj ); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index d9a4211320fb..3d28ee2cf496 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -277,7 +277,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); - if( mpViewSh->ISA(::sd::slidesorter::SlideSorterViewShell) + if( dynamic_cast< ::sd::slidesorter::SlideSorterViewShell *>( mpViewSh ) != nullptr || (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())) nPasteOptions |= SdrInsertFlags::DONTMARK; } @@ -360,7 +360,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { const View* pSourceView = pOwnData->GetView(); - if( pOwnData->GetDocShell() && pOwnData->IsPageTransferable() && ISA( View ) ) + if( pOwnData->GetDocShell() && pOwnData->IsPageTransferable() && dynamic_cast< View *>( this) != nullptr ) { mpClipboard->HandlePageDrop (*pOwnData); bReturn = true; @@ -487,7 +487,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, pRem->pClone = pObj; aConnectorContainer.push_back(pRem); - if(pObj->ISA(SdrEdgeObj)) + if(dynamic_cast< SdrEdgeObj *>( pObj ) != nullptr) nConnectorCount++; } } @@ -499,7 +499,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { ImpRememberOrigAndClone* pRem = aConnectorContainer[a]; - if(pRem->pClone->ISA(SdrEdgeObj)) + if(dynamic_cast< const SdrEdgeObj *>( pRem->pClone ) != nullptr) { SdrEdgeObj* pOrigEdge = static_cast<SdrEdgeObj*>(pRem->pOrig); SdrEdgeObj* pCloneEdge = static_cast<SdrEdgeObj*>(pRem->pClone); @@ -737,7 +737,9 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bChanged = true; mnAction = DND_ACTION_COPY; } - else if( ( mnAction & DND_ACTION_LINK ) && pPickObj && pObj && !pPickObj->ISA( SdrGrafObj ) && !pPickObj->ISA( SdrOle2Obj ) ) + else if( ( mnAction & DND_ACTION_LINK ) && pPickObj && pObj && + dynamic_cast< const SdrGrafObj *>( pPickObj ) == nullptr && + dynamic_cast< const SdrOle2Obj *>( pPickObj ) == nullptr ) { SfxItemSet aSet( mrDoc.GetPool() ); @@ -769,7 +771,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, pPickObj->SetMergedItemSetAndBroadcast( aSet ); - if( pPickObj->ISA( E3dObject ) && pObj->ISA( E3dObject ) ) + if( dynamic_cast< E3dObject *>( pPickObj ) != nullptr && dynamic_cast< E3dObject *>( pObj ) != nullptr ) { // handle 3D attribute in addition SfxItemSet aNewSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 ); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 0ce3beea00fd..8036eeecaf47 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -86,7 +86,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, SdrObject* pPickObj = pObj; const bool bOnMaster = pPV && pPV->GetPage() && pPV->GetPage()->IsMasterPage(); - if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView)) + if(pPV && dynamic_cast< const ::sd::slidesorter::view::SlideSorterView* >(this) != nullptr) { if(!pPV->GetPageRect().IsInside(rPos)) pPV = 0L; @@ -98,7 +98,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, PickObj(rPos, getHitTolLog(), pPickObj, pPageView); } - const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj)); + const bool bIsGraphic(dynamic_cast< const SdrGrafObj* >(pPickObj) != nullptr); if (DND_ACTION_LINK == mnAction && pPickObj @@ -150,7 +150,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, && pPickObj && !bIsGraphic && pPickObj->IsClosedObj() - && !dynamic_cast< SdrOle2Obj* >(pPickObj)) + && !dynamic_cast< const SdrOle2Obj* >(pPickObj)) { // fill style change (fill object with graphic), independent of mnAction // and thus of DND_ACTION_LINK or DND_ACTION_MOVE @@ -206,7 +206,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, && mpViewSh->GetViewShell()!=NULL && mpViewSh->GetViewShell()->GetIPClient() && mpViewSh->GetViewShell()->GetIPClient()->IsObjectInPlaceActive()) - || this->ISA(::sd::slidesorter::view::SlideSorterView)) + || dynamic_cast<const ::sd::slidesorter::view::SlideSorterView* >(this)) nOptions |= SdrInsertFlags::DONTMARK; if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && (pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall()) ) @@ -330,7 +330,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM SdrPageView* pPV = GetSdrPageView(); SdrObject* pPickObj = GetEmptyPresentationObject( PRESOBJ_MEDIA ); - if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView )) + if(pPV && dynamic_cast<const ::sd::slidesorter::view::SlideSorterView* >(this) ) { if(!pPV->GetPageRect().IsInside(rPos)) pPV = 0L; @@ -342,7 +342,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM PickObj(rPos, getHitTolLog(), pPickObj, pPageView); } - if( mnAction == DND_ACTION_LINK && pPickObj && pPV && pPickObj->ISA( SdrMediaObj ) ) + if( mnAction == DND_ACTION_LINK && pPickObj && pPV && dynamic_cast< SdrMediaObj *>( pPickObj ) != nullptr ) { pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() ); pNewMediaObj->setURL( rMediaURL, ""/*TODO?*/, rMimeType ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index a9a4bd035e81..83b65bd0ca48 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -346,7 +346,7 @@ long Window::SetZoomFactor(long nZoom) UpdateMapOrigin(); // Update the view's snapping to the new zoom factor. - if ( mpViewShell && mpViewShell->ISA(DrawViewShell) ) + if ( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) static_cast<DrawViewShell*>(mpViewShell)->GetView()-> RecalcLogicSnapMagnetic(*this); @@ -585,7 +585,7 @@ void Window::UpdateMapMode() // removed old stuff here which still forced zoom to be // %BRUSH_SIZE which is outdated now - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) { // page should not "stick" to the window border if (aPix.Width() == 0) @@ -790,7 +790,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt ) else nPreviewSlot = SID_PREVIEW_QUALITY_COLOR; - if( mpViewShell->ISA( DrawViewShell ) ) + if( dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) { SetDrawMode( nOutputMode ); mpViewShell->GetFrameView()->SetDrawMode( nOutputMode ); @@ -798,7 +798,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt ) } // Overwrite window color for OutlineView - if( mpViewShell->ISA(OutlineViewShell ) ) + if( dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr ) { svtools::ColorConfig aColorConfig; const Color aDocColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor ); @@ -811,7 +811,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt ) mpViewShell->ArrangeGUIElements(); // re-create handles to show new outfit - if(mpViewShell->ISA(DrawViewShell)) + if(dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) { mpViewShell->GetView()->AdjustMarkHdl(); } @@ -882,7 +882,7 @@ sal_Int8 Window::AcceptDrop( const AcceptDropEvent& rEvt ) if( mpViewShell ) nRet = mpViewShell->AcceptDrop( rEvt, *this, this, SDRPAGE_NOTFOUND, SDRLAYER_NOTFOUND ); - if (mbUseDropScroll && ! mpViewShell->ISA(OutlineViewShell)) + if (mbUseDropScroll && dynamic_cast< OutlineViewShell *>( mpViewShell ) == nullptr) DropScroll( rEvt.maPosPixel ); } @@ -953,7 +953,7 @@ void Window::DropScroll(const Point& rMousePos) Window::CreateAccessible() { // If current viewshell is PresentationViewShell, just return empty because the correct ShowWin will be created later. - if (mpViewShell && mpViewShell->ISA(PresentationViewShell)) + if (mpViewShell && dynamic_cast< PresentationViewShell *>( mpViewShell ) != nullptr) { return vcl::Window::CreateAccessible (); } diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx index d66f3198575e..22c5ac1db45b 100644 --- a/sd/source/ui/view/tabcontr.cxx +++ b/sd/source/ui/view/tabcontr.cxx @@ -280,7 +280,7 @@ void TabControl::Command(const CommandEvent& rCEvt) { if ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) { - bool bGraphicShell = pDrViewSh->ISA(GraphicViewShell); + bool bGraphicShell = dynamic_cast< GraphicViewShell *>( pDrViewSh ) != nullptr; sal_uInt16 nResId = bGraphicShell ? RID_GRAPHIC_PAGETAB_POPUP : RID_DRAW_PAGETAB_POPUP; SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 642f33f14a45..99aca248383b 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -114,7 +114,7 @@ namespace sd { bool ViewShell::IsPageFlipMode() const { - return this->ISA(DrawViewShell) && mpContentWindow.get() != NULL && + return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow.get() != NULL && mpContentWindow->GetVisibleHeight() >= 1.0; } |