diff options
Diffstat (limited to 'sd/source')
90 files changed, 366 insertions, 371 deletions
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 5c50be3365d8..16849adb32a3 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -761,7 +761,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool } } - if (pObj->ISA(SdrTextObj) && pObj->IsEmptyPresObj()) + if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr && pObj->IsEmptyPresObj()) { PresObjKind ePresObjKind = pPage->GetPresObjKind(pObj); OUString aString( pPage->GetPresObjText(ePresObjKind) ); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 4f08dd3c0fc1..dac47fe62954 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -981,7 +981,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj, bool bObjSupported = false; // execute HitTest - if ( pObj->ISA( SdrGrafObj ) ) // simple graphics object + if ( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) // simple graphics object { const SdrGrafObj* pGrafObj = static_cast<const SdrGrafObj*>(pObj); const GeoStat& rGeo = pGrafObj->GetGeoStat(); @@ -1008,7 +1008,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj, delete pGeoData; bObjSupported = true; } - else if ( pObj->ISA( SdrOle2Obj ) ) // OLE object + else if ( dynamic_cast<const SdrOle2Obj* >(pObj) != nullptr ) // OLE object { aGraphSize = static_cast<SdrOle2Obj*>( pObj )->GetOrigObjSize(); bObjSupported = true; diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 84aaae171ed7..d4fc04876dbd 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -833,7 +833,7 @@ IMPL_LINK_NOARG_TYPED(SdDrawDocument, OnlineSpellingHdl, Idle *, void) if (pObj) { - if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj)) + if (pObj->GetOutlinerParaObject() && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) { // Spell text object SpellObject(static_cast<SdrTextObj*>(pObj)); @@ -849,7 +849,7 @@ IMPL_LINK_NOARG_TYPED(SdDrawDocument, OnlineSpellingHdl, Idle *, void) { SdrObject* pSubObj = aGroupIter.Next(); - if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj)) + if (pSubObj->GetOutlinerParaObject() && dynamic_cast< SdrTextObj *>( pSubObj ) != nullptr) { // Found a text object in a group object SpellObject(static_cast<SdrTextObj*>(pSubObj)); @@ -975,7 +975,7 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* // restart when add to dictionary takes place, too. || nCommand == SpellCallbackCommand::ADDTODICTIONARY) { - if(pObj && pOutl && pObj->ISA(SdrTextObj)) + if(pObj && pOutl && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) { bool bModified(IsChanged()); static_cast<SdrTextObj*>(pObj)->SetOutlinerParaObject(pOutl->CreateParaObject()); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 9caab81a83bb..768e8aabd05a 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -407,7 +407,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec InsertObject(pSdrObj); - if ( pSdrObj->ISA(SdrTextObj) ) + if ( dynamic_cast< const SdrTextObj *>( pSdrObj ) != nullptr ) { // Tell the object EARLY that it is vertical to have the // defaults for AutoGrowWidth/Height reversed @@ -454,7 +454,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec } OUString aString = GetPresObjText(eObjKind); - if( (!aString.isEmpty() || bForceText) && pSdrObj->ISA(SdrTextObj) ) + if( (!aString.isEmpty() || bForceText) && dynamic_cast< const SdrTextObj *>( pSdrObj ) != nullptr ) { SdrOutliner* pOutliner = static_cast<SdDrawDocument*>( GetModel() )->GetInternalOutliner(); @@ -2023,7 +2023,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR } else if ( eObjKind != OBJ_TITLETEXT && eObjKind != OBJ_OUTLINETEXT && - pObj->ISA(SdrTextObj) && + dynamic_cast< const SdrTextObj *>( pObj ) != nullptr && pObj->GetOutlinerParaObject() ) { /****************************************************** @@ -2316,7 +2316,7 @@ SdrObject* SdPage::InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, } } - if ( pObj && (pObj->GetUserCall() || bInit) && ( pObj->IsEmptyPresObj() || !pObj->ISA(SdrGrafObj) ) ) + if ( pObj && (pObj->GetUserCall() || bInit) && ( pObj->IsEmptyPresObj() || dynamic_cast< const SdrGrafObj *>( pObj ) == nullptr ) ) pObj->AdjustToMaxRect(rRect); return pObj; @@ -2380,7 +2380,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO { if ( pObj ) { - DBG_ASSERT( pObj->ISA(SdrTextObj), "SetObjText: No SdrTextObj!" ); + DBG_ASSERT( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr, "SetObjText: No SdrTextObj!" ); ::Outliner* pOutl = pOutliner; if (!pOutliner) diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 50ac9395091d..6605755d0fb8 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1273,7 +1273,7 @@ void PPTWriter::ImplWriteOLE( ) case NORMAL_OLE_OBJECT : { SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape ); - if ( pSdrObj && pSdrObj->ISA( SdrOle2Obj ) ) + if ( pSdrObj && dynamic_cast<const SdrOle2Obj* >(pSdrObj) != nullptr ) { ::uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pSdrObj)->GetObjRef() ); if( xObj.is() ) diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index d20aceaba719..e0dfbb07e868 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -241,8 +241,7 @@ bool SdGRFFilter::Export() uno::Reference< drawing::XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( xContext ); SdPage* pPage = NULL; - sd::DrawViewShell* pDrawViewShell = static_cast< ::sd::DrawViewShell* > - ( ( ( mrDocShell.GetViewShell() && mrDocShell.GetViewShell()->ISA(::sd::DrawViewShell ) ) ? mrDocShell.GetViewShell() : NULL ) ); + sd::DrawViewShell* pDrawViewShell = dynamic_cast<::sd::DrawViewShell* >(mrDocShell.GetViewShell() ); PageKind ePageKind = PK_STANDARD; if( pDrawViewShell ) diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 41fbc5dd68c3..8d82eb7595d1 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1462,7 +1462,7 @@ OUString HtmlExport::TextAttribToHTMLString( SfxItemSet* pSet, HtmlState* pState const SvxFieldItem* pItem = static_cast<const SvxFieldItem*>(pSet->GetItem( EE_FEATURE_FIELD )); if(pItem) { - const SvxURLField* pURL = PTR_CAST(SvxURLField, pItem->GetField()); + const SvxURLField* pURL = dynamic_cast<const SvxURLField*>( pItem->GetField() ); if(pURL) { aLink = pURL->GetURL(); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 7af03e59db47..ecefc2df9294 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2395,7 +2395,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj } else if ( pTextObj->GetShapeType() == mso_sptPictureFrame ) { - if ( !pTextObj->Count() && pObj->ISA( SdrGrafObj ) ) + if ( !pTextObj->Count() && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) { bEmptyPresObj = false; switch ( nPlaceholderId ) @@ -2576,7 +2576,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi if ( pObj ) { // further setup placeholder objects - if( pObj->ISA(SdrPageObj) && pData ) + if( dynamic_cast< const SdrPageObj *>( pObj ) != nullptr && pData ) { const ProcessData* pProcessData=static_cast<const ProcessData*>(pData); if( pProcessData->pPage.page ) @@ -2623,7 +2623,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObj); if( pTextObj && pTextObj->HasText() && - !pObj->ISA( SdrObjGroup ) && + dynamic_cast< SdrObjGroup *>( pObj ) == nullptr && pAnimation->HasAnimateAssociatedShape() ) { const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet(); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 3b8199907edf..8d9907e3c610 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -2969,7 +2969,7 @@ sal_Int32 AnimationImporter::importTargetElementContainer( const Atom* pAtom, An case 8: rSubType = ShapeAnimationSubType::ONLY_TEXT; break; case 2: // one paragraph { - if( ((begin == -1) && (end == -1)) || !pSdrObject->ISA( SdrTextObj ) ) + if( ((begin == -1) && (end == -1)) || dynamic_cast< SdrTextObj *>( pSdrObject ) == nullptr ) break; SdrTextObj* pTextObj = static_cast< SdrTextObj* >( pSdrObject ); diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index afd26268d4fe..d10f3c415107 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -739,7 +739,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() uno::Any anyAtrribute; OUString sValue; - if (mpViewShell && mpViewShell->ISA(::sd::DrawViewShell)) + if (0 != dynamic_cast<const ::sd::DrawViewShell* > (mpViewShell)) { ::sd::DrawViewShell* pDrViewSh = static_cast< ::sd::DrawViewShell*>(mpViewShell); OUString sDisplay; @@ -796,7 +796,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() sValue += ";"; } } - if (mpViewShell && mpViewShell->ISA(::sd::PresentationViewShell)) + if (dynamic_cast<const ::sd::PresentationViewShell* >(mpViewShell) != nullptr ) { ::sd::PresentationViewShell* pPresViewSh = static_cast< ::sd::PresentationViewShell*>(mpViewShell); SdPage* pCurrPge = pPresViewSh->getCurrentPage(); @@ -827,7 +827,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() } } } - if (mpViewShell && mpViewShell->ISA(::sd::OutlineViewShell) ) + if (dynamic_cast<const ::sd::OutlineViewShell* >(mpViewShell ) != nullptr ) { OUString sName; OUString sDisplay; diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx index f7f6477cb3dd..29e02ab72857 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx @@ -74,7 +74,7 @@ AccessibleOutlineView::AccessibleOutlineView ( { ::sd::View* pView = pViewShell->GetView(); - if (pView && pView->ISA(::sd::OutlineView)) + if (dynamic_cast<const ::sd::OutlineView* >( pView ) != nullptr) { OutlinerView* pOutlineView = static_cast< ::sd::OutlineView*>( pView)->GetViewByWindow( pSdWindow ); diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index d1c4e6f2a49d..7747cc76ca40 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -155,7 +155,7 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType) { sal_uInt16 nMetric = pOptions->GetMetric(); - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); SdDrawDocument* pDoc = NULL; if (pDocSh) pDoc = pDocSh->GetDoc(); @@ -175,7 +175,7 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType) tools::SvRef<SotStorageStream> SdModule::GetOptionStream( const OUString& rOptionName, SdOptionStreamMode eMode ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); tools::SvRef<SotStorageStream> xStm; if( pDocSh ) diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 69599d9b7fa7..c8a376b5c402 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -111,7 +111,7 @@ void SdModule::Execute(SfxRequest& rReq) { bool bOnlineSpelling = static_cast<const SfxBoolItem*>( pItem )->GetValue(); // save at document: - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh ) { SdDrawDocument* pDoc = pDocSh->GetDoc(); @@ -135,7 +135,7 @@ void SdModule::Execute(SfxRequest& rReq) case FUNIT_PICA: case FUNIT_POINT: { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if(pDocSh) { DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType(); @@ -170,7 +170,7 @@ void SdModule::Execute(SfxRequest& rReq) ) { // save at the document: - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if ( pDocSh ) { LanguageType eLanguage = static_cast<const SvxLanguageItem*>(pItem)->GetValue(); @@ -208,7 +208,7 @@ void SdModule::Execute(SfxRequest& rReq) case SID_OPENDOC: { bool bIntercept = false; - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if (pDocShell) { ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); @@ -323,7 +323,7 @@ void SdModule::GetState(SfxItemSet& rItemSet) } else { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if (pDocShell) { ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); @@ -340,7 +340,7 @@ void SdModule::GetState(SfxItemSet& rItemSet) if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_METRIC ) ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if(pDocSh) { DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType(); @@ -369,7 +369,7 @@ void SdModule::GetState(SfxItemSet& rItemSet) if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_AUTOSPELL_CHECK ) ) { ::sd::DrawDocShell* pDocSh = - PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh ) { SdDrawDocument* pDoc = pDocSh->GetDoc(); @@ -379,28 +379,28 @@ void SdModule::GetState(SfxItemSet& rItemSet) if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_LANGUAGE ) ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh ) rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ), SID_ATTR_LANGUAGE ) ); } if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE ) ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh ) rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CJK ), SID_ATTR_CHAR_CJK_LANGUAGE ) ); } if( SfxItemState::DEFAULT == rItemSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE ) ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh ) rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CTL ), SID_ATTR_CHAR_CTL_LANGUAGE ) ); } if ( !mbEventListenerAdded ) { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocShell ) // Impress or Draw ? { ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); @@ -429,7 +429,7 @@ IMPL_STATIC_LINK_TYPED( SdModule, EventListenerHdl, VclSimpleEvent&, rSimpleEven { case MediaCommand::Play: { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); if( pDocShell ) // Impress or Draw ? { ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); @@ -591,7 +591,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) aSet.Put( aPassword ); const SfxPoolItem* pRet = SfxFrame::OpenDocumentSynchron( aSet, xTargetFrame ); - const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet ); + const SfxViewFrameItem* pFrameItem = dynamic_cast<const SfxViewFrameItem*>( pRet ); if ( pFrameItem && pFrameItem->GetFrame() ) pFrame = &pFrameItem->GetFrame()->GetFrame(); } @@ -610,7 +610,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) try { const SfxPoolItem* pRet = SfxGetpApp()->ExecuteSlot (aRequest); - const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet ); + const SfxViewFrameItem* pFrameItem = dynamic_cast<const SfxViewFrameItem*>( pRet ); if ( pFrameItem ) pFrame = &pFrameItem->GetFrame()->GetFrame(); } @@ -652,7 +652,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) SdDrawDocument* pDoc(NULL); if (pShell && pViewFrame) { - pDocShell = PTR_CAST(::sd::DrawDocShell, pShell); + pDocShell = dynamic_cast< ::sd::DrawDocShell *>( pShell ); pDoc = pDocShell ? pDocShell->GetDoc() : NULL; pBase = ::sd::ViewShellBase::GetViewShellBase(pViewFrame); } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 2b4866d680fa..873a99bfb10b 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -87,7 +87,7 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo // first try to check if we are inside the outline view sd::OutlineView* pSdView = NULL; - if( pViewSh && pViewSh->ISA(sd::OutlineViewShell)) + if( dynamic_cast<const sd::OutlineViewShell* >(pViewSh) != nullptr ) pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView()); if (pSdView != NULL && (pOutliner == &pSdView->GetOutliner())) @@ -218,7 +218,7 @@ IMPL_LINK_TYPED(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; if(pViewSh == NULL) { - ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); + ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase *>( SfxViewShell::Current() ); if(pBase) pViewSh = pBase->GetMainViewShell().get(); } @@ -255,7 +255,7 @@ IMPL_LINK_TYPED(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; if(pViewSh == NULL) { - ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); + ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase *>( SfxViewShell::Current() ); if(pBase) pViewSh = pBase->GetMainViewShell().get(); } @@ -285,7 +285,7 @@ IMPL_LINK_TYPED(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) ::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL; if(pViewSh == NULL) { - ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current()); + ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase *>( SfxViewShell::Current() ); if(pBase) pViewSh = pBase->GetMainViewShell().get(); } @@ -409,7 +409,7 @@ IMPL_LINK_TYPED(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot ) { ::sd::FrameView* pFrameView = NULL; - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); SdDrawDocument* pDoc = NULL; // Here we set the DocType of the option dialog (not document!) @@ -536,7 +536,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) bool bNewPrintOptions = false; bool bMiscOptions = false; - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); SdDrawDocument* pDoc = NULL; // Here we set the DocType of the option dialog (not document!) DocumentType eDocType = DOCUMENT_TYPE_IMPRESS; diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 526a338df8ca..071340202dd1 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -55,7 +55,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) InsertItem( nID++, SD_RESSTR( STR_VAR ), nStyle ); InsertSeparator(); - if( pField->ISA( SvxDateField ) ) + if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) { const SvxDateField* pDateField = static_cast<const SvxDateField*>( pField ); SvxDateField aDateField( *pDateField ); @@ -87,7 +87,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) CheckItem( (sal_uInt16) ( pDateField->GetFormat() ) + 1 ); // - 2 + 3 ! } - else if( pField->ISA( SvxExtTimeField ) ) + else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxExtTimeField aTimeField( *pTimeField ); @@ -121,7 +121,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) CheckItem( (sal_uInt16) ( pTimeField->GetFormat() ) + 1 ); // - 2 + 3 ! } - else if( pField->ISA( SvxExtFileField ) ) + else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); //SvxExtFileField aFileField( *pFileField ); @@ -138,7 +138,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 ); } - else if( pField->ISA( SvxAuthorField ) ) + else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); @@ -166,7 +166,7 @@ SvxFieldData* SdFieldPopup::GetField() SvxFieldData* pNewField = NULL; sal_uInt16 nCount = GetItemCount(); - if( pField->ISA( SvxDateField ) ) + if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) { const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateType eType; @@ -199,7 +199,7 @@ SvxFieldData* SdFieldPopup::GetField() } } } - else if( pField->ISA( SvxExtTimeField ) ) + else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>(pField); SvxTimeType eType; @@ -233,7 +233,7 @@ SvxFieldData* SdFieldPopup::GetField() } } - else if( pField->ISA( SvxExtFileField ) ) + else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); SvxFileType eType; @@ -255,8 +255,7 @@ SvxFieldData* SdFieldPopup::GetField() if( pFileField->GetFormat() != eFormat || pFileField->GetType() != eType ) { - ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, - SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast<::sd::DrawDocShell* >( SfxObjectShell::Current() ); if( pDocSh ) { @@ -273,7 +272,7 @@ SvxFieldData* SdFieldPopup::GetField() } } } - else if( pField->ISA( SvxAuthorField ) ) + else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorType eType; diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index f82d9da4d72d..06c80790ff3f 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -157,7 +157,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) delete mpBookmark, mpBookmark = NULL; delete mpImageMap, mpImageMap = NULL; - if( pObj->ISA( SdrOle2Obj ) ) + if( 0!= dynamic_cast< const SdrOle2Obj* >( pObj ) ) { try { @@ -177,7 +177,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) catch( uno::Exception& ) {} } - else if( pObj->ISA( SdrGrafObj ) && (mpSourceDoc && !mpSourceDoc->GetAnimationInfo( pObj )) ) + else if( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && (mpSourceDoc && !mpSourceDoc->GetAnimationInfo( pObj )) ) { mpGraphic = new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() ); } @@ -211,7 +211,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) } } } - else if( pObj->ISA( SdrTextObj ) ) + else if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr ) { const OutlinerParaObject* pPara; @@ -223,7 +223,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { const SvxFieldData* pData = pField->GetField(); - if( pData && pData->ISA( SvxURLField ) ) + if( pData && dynamic_cast< const SvxURLField *>( pData ) != nullptr ) { const SvxURLField* pURL = static_cast<const SvxURLField*>(pData); @@ -357,7 +357,7 @@ static bool lcl_HasOnlyControls( SdrModel* pModel ) bOnlyControls = true; // only set if there are any objects at all while ( pObj ) { - if (!pObj->ISA(SdrUnoObj)) + if (dynamic_cast< const SdrUnoObj *>( pObj ) == nullptr) { bOnlyControls = false; break; diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index 4e3ca3394fc2..fc4a6560fe68 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -76,9 +76,9 @@ SdTemplateControl::~SdTemplateControl() void SdTemplateControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { - if( eState != SfxItemState::DEFAULT || pState->ISA( SfxVoidItem ) ) + if( eState != SfxItemState::DEFAULT || dynamic_cast< const SfxVoidItem *>( pState ) != nullptr ) GetStatusBar().SetItemText( GetId(), OUString() ); - else if ( pState->ISA( SfxStringItem ) ) + else if ( dynamic_cast< const SfxStringItem *>( pState ) != nullptr ) { msTemplate = static_cast<const SfxStringItem*>(pState)->GetValue(); GetStatusBar().SetItemText( GetId(), msTemplate ); diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 4e47bbc81121..e1127c3a0fb7 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -234,7 +234,7 @@ void LayerTabBar::EndRenaming() if( !IsEditModeCanceled() ) { ::sd::View* pView = pDrViewSh->GetView(); - DrawView* pDrView = PTR_CAST( DrawView, pView ); + DrawView* pDrView = dynamic_cast<DrawView*>( pView ); SdDrawDocument& rDoc = pView->GetDoc(); OUString aLayerName = pView->GetActiveLayer(); diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx index 574ba97eb773..dbf9c9d8584d 100644 --- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx +++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx @@ -105,7 +105,7 @@ void SpellDialogChildWindow::LoseFocus() void SpellDialogChildWindow::ProvideOutliner() { - ViewShellBase* pViewShellBase = PTR_CAST (ViewShellBase, SfxViewShell::Current()); + ViewShellBase* pViewShellBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() ); if (pViewShellBase != NULL) { @@ -113,8 +113,8 @@ void SpellDialogChildWindow::ProvideOutliner() // If there already exists an outliner that has been created // for another view shell then destroy it first. if (mpSdOutliner != NULL) - if ((pViewShell->ISA(DrawViewShell) && ! mbOwnOutliner) - || (pViewShell->ISA(OutlineViewShell) && mbOwnOutliner)) + if(( dynamic_cast< const DrawViewShell *>( pViewShell ) != nullptr && ! mbOwnOutliner) + || (dynamic_cast< const OutlineViewShell *>( pViewShell ) != nullptr && mbOwnOutliner)) { mpSdOutliner->EndSpelling(); if (mbOwnOutliner) @@ -125,7 +125,7 @@ void SpellDialogChildWindow::ProvideOutliner() // Now create/get an outliner if none is present. if (mpSdOutliner == NULL) { - if (pViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( pViewShell ) != nullptr) { // We need an outliner for the spell check so we have // to create one. @@ -134,7 +134,7 @@ void SpellDialogChildWindow::ProvideOutliner() pViewShell->GetDoc(), OUTLINERMODE_TEXTOBJECT); } - else if (pViewShell->ISA(OutlineViewShell)) + else if( dynamic_cast< const OutlineViewShell *>( pViewShell ) != nullptr) { // An outline view is already visible. The SdOutliner // will use it instead of creating its own. diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 8e3989c42acd..4535372b81e6 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -1147,7 +1147,7 @@ void AnimationControllerItem::StateChanged( sal_uInt16 nSId, { if( eState >= SfxItemState::DEFAULT && nSId == SID_ANIMATOR_STATE ) { - const SfxUInt16Item* pStateItem = PTR_CAST( SfxUInt16Item, pItem ); + const SfxUInt16Item* pStateItem = dynamic_cast< const SfxUInt16Item*>( pItem ); assert(pStateItem); //SfxUInt16Item expected if (pStateItem) { diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 82a83a630e67..c0fc28a8a63c 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -941,7 +941,7 @@ SfxObjectShellLock AssistentDlgImpl::GetDocument() UpdatePageList(); SfxObjectShell* pShell = xDocShell; - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,pShell); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( pShell ); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; if(pDoc) @@ -1309,7 +1309,7 @@ void AssistentDlgImpl::UpdateUserData() OUString aInfo = mpPage4AskInfoEDT->GetText(); SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell *>( pShell ); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; SdPage* pPage = pDoc?pDoc->GetSdPage(0, PK_STANDARD):NULL; @@ -1372,7 +1372,7 @@ void AssistentDlgImpl::UpdatePageList() maPageListFile = maDocFile; SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell *>( pShell ); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; mpPage5PageListCT->Clear(); @@ -1431,7 +1431,7 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview ) if( aLayoutFile != maLayoutFile ) { SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell *>( pShell ); ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL; if(pUndoMgr) pUndoMgr->Undo(); @@ -1470,7 +1470,7 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview ) aReq.AppendItem( SfxBoolItem( SID_HIDDEN, true ) ); aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) ); - const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SfxGetpApp()->ExecuteSlot( aReq ) ); + const SfxViewFrameItem* pRet = dynamic_cast<const SfxViewFrameItem*>( SfxGetpApp()->ExecuteSlot( aReq ) ); if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() ) xDocShell = pRet->GetFrame()->GetObjectShell(); @@ -1509,11 +1509,11 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview ) // determine the implementation SfxObjectShell* pShell = xDocShell; - DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); + DrawDocShell* pDocShell = dynamic_cast< DrawDocShell *>( pShell ); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; pShell = xLayoutDocShell; - pDocShell = PTR_CAST(DrawDocShell,pShell); + pDocShell = dynamic_cast< DrawDocShell *>( pShell ); SdDrawDocument* pLayoutDoc = pDocShell?pDocShell->GetDoc():NULL; if( pDoc && pLayoutDoc ) diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index cbd3265cb242..f2c6359569a6 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -80,7 +80,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() m_pRbtVar->IsValueChangedFromSaved() || m_pLbFormat->IsValueChangedFromSaved() ) { - if( pField->ISA( SvxDateField ) ) + if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) { const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateType eType; @@ -97,7 +97,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() static_cast<SvxDateField*>( pNewField )->SetType( eType ); static_cast<SvxDateField*>( pNewField )->SetFormat( eFormat ); } - else if( pField->ISA( SvxExtTimeField ) ) + else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxTimeType eType; @@ -114,7 +114,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() static_cast<SvxExtTimeField*>( pNewField )->SetType( eType ); static_cast<SvxExtTimeField*>( pNewField )->SetFormat( eFormat ); } - else if( pField->ISA( SvxExtFileField ) ) + else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>( pField ); SvxFileType eType; @@ -127,8 +127,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() eFormat = (SvxFileFormat) ( m_pLbFormat->GetSelectEntryPos() ); - ::sd::DrawDocShell* pDocSh = PTR_CAST( ::sd::DrawDocShell, - SfxObjectShell::Current() ); + ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() ); if( pDocSh ) { @@ -144,7 +143,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() static_cast<SvxExtFileField*>( pNewField )->SetFormat( eFormat ); } } - else if( pField->ISA( SvxAuthorField ) ) + else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { SvxAuthorType eType; SvxAuthorFormat eFormat; @@ -173,7 +172,7 @@ void SdModifyFieldDlg::FillFormatList() m_pLbFormat->Clear(); - if( pField->ISA( SvxDateField ) ) + if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) { const SvxDateField* pDateField = static_cast<const SvxDateField*>( pField ); SvxDateField aDateField( *pDateField ); @@ -199,7 +198,7 @@ void SdModifyFieldDlg::FillFormatList() m_pLbFormat->SelectEntryPos( (sal_uInt16) ( pDateField->GetFormat() - 2 ) ); } - else if( pField->ISA( SvxExtTimeField ) ) + else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxExtTimeField aTimeField( *pTimeField ); @@ -227,7 +226,7 @@ void SdModifyFieldDlg::FillFormatList() m_pLbFormat->SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) ); } - else if( pField->ISA( SvxExtFileField ) ) + else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>( pField ); SvxExtFileField aFileField( *pFileField ); @@ -239,7 +238,7 @@ void SdModifyFieldDlg::FillFormatList() m_pLbFormat->SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) ); } - else if( pField->ISA( SvxAuthorField ) ) + else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>( pField ); SvxAuthorField aAuthorField( *pAuthorField ); @@ -260,7 +259,7 @@ void SdModifyFieldDlg::FillControls() { m_pLbFormat->Clear(); - if( pField->ISA( SvxDateField ) ) + if( dynamic_cast< const SvxDateField *>( pField ) != nullptr ) { const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateField aDateField( *pDateField ); @@ -270,7 +269,7 @@ void SdModifyFieldDlg::FillControls() else m_pRbtVar->Check(); } - else if( pField->ISA( SvxExtTimeField ) ) + else if( dynamic_cast< const SvxExtTimeField *>( pField ) != nullptr ) { const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>(pField); SvxExtTimeField aTimeField( *pTimeField ); @@ -280,7 +279,7 @@ void SdModifyFieldDlg::FillControls() else m_pRbtVar->Check(); } - else if( pField->ISA( SvxExtFileField ) ) + else if( dynamic_cast< const SvxExtFileField *>( pField ) != nullptr ) { const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); SvxExtFileField aFileField( *pFileField ); @@ -290,7 +289,7 @@ void SdModifyFieldDlg::FillControls() else m_pRbtVar->Check(); } - else if( pField->ISA( SvxAuthorField ) ) + else if( dynamic_cast< const SvxAuthorField *>( pField ) != nullptr ) { const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 688f578a831e..7540fa7a1946 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -214,7 +214,7 @@ bool SdDocPreviewWin::Notify( NotifyEvent& rNEvt ) void SdDocPreviewWin::updateViewSettings() { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,mpObj); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( mpObj ); SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL; SvtAccessibilityOptions aAccOptions; diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 8b22fd2d6bd4..1276126cb055 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -651,7 +651,7 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo if( aFieldInfo.pFieldItem ) { const SvxFieldData* pFieldData = aFieldInfo.pFieldItem->GetField(); - if( pFieldData && (pFieldData->ISA( SvxDateTimeField ) || pFieldData->ISA( SvxDateField )) ) + if( pFieldData && ( dynamic_cast< const SvxDateTimeField *>( pFieldData ) != nullptr || dynamic_cast< const SvxDateField *>( pFieldData ) != nullptr)) { break; } diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index bfd0e6cbc359..644250429ca9 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -694,11 +694,11 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) maLbDocs->InsertEntry( aStr, 0 ); ::sd::DrawDocShell* pCurrentDocShell = - PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); - SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(0, false); + dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); + SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst([](const SfxObjectShell*){return true;}, false); while( pSfxDocShell ) { - ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, pSfxDocShell ); + ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( pSfxDocShell ); if( pDocShell && !pDocShell->IsInDestruction() && ( pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) ) { NavDocInfo aInfo ; @@ -724,7 +724,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) maDocList.push_back( aInfo ); } - pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0, false ); + pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, [](const SfxObjectShell*){return true;}, false ); } } maLbDocs->SelectEntryPos( nPos ); @@ -873,7 +873,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId, { if( eState >= SfxItemState::DEFAULT && nSId == SID_NAVIGATOR_STATE ) { - const SfxUInt32Item* pStateItem = PTR_CAST( SfxUInt32Item, pItem ); + const SfxUInt32Item* pStateItem = dynamic_cast< const SfxUInt32Item* >( pItem ); DBG_ASSERT( pStateItem, "SfxUInt16Item expected"); sal_uInt32 nState = pStateItem->GetValue(); @@ -957,7 +957,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId, NavDocInfo* pInfo = pNavigatorWin->GetDocInfo(); if( pInfo && pInfo->IsActive() ) { - const SfxStringItem* pStateItem = PTR_CAST( SfxStringItem, pItem ); + const SfxStringItem* pStateItem = dynamic_cast<const SfxStringItem*>( pItem ); DBG_ASSERT( pStateItem, "SfxStringItem expected"); OUString aPageName = pStateItem->GetValue(); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 042d38e0a45b..fafaafe8eedd 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -421,7 +421,7 @@ OUString SdPageObjsTLB::GetObjectName( { aRet = pObject->GetName(); - if (aRet.isEmpty() && pObject->ISA(SdrOle2Obj)) + if (aRet.isEmpty() && dynamic_cast<const SdrOle2Obj* >(pObject) != nullptr) aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName(); } diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 9e5b3ab66208..91f347d1a2e5 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -174,7 +174,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) while (pShell) { - if (pShell->ISA(DrawDocShell)) + if( dynamic_cast< const DrawDocShell *>( pShell ) != nullptr) { static_cast<DrawDocShell*>(pShell)->CancelSearching(); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index e80bb8952eeb..fd6e879a8609 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -187,7 +187,7 @@ void DrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter) return; } - // if (mpPrinter->IsA(SfxPrinter)) + // if 0 != dynamic_cast< SfxPrinter *>( (mpPrinter )) { // Since we do not have RTTI we use a hard cast (...) SetPrinter(static_cast<SfxPrinter*>(pNewPrinter)); @@ -635,7 +635,7 @@ bool DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com: if( mpViewShell ) { - if( mpViewShell->ISA( OutlineViewShell ) ) + if( dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr ) static_cast<OutlineView*>(mpViewShell->GetView()) ->GetOutliner().ClearModifyFlag(); @@ -671,7 +671,7 @@ bool DrawDocShell::GotoBookmark(const OUString& rBookmark) { bool bFound = false; - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(mpViewShell); ViewShellBase& rBase (mpViewShell->GetViewShellBase()); @@ -837,7 +837,7 @@ bool DrawDocShell::IsMarked( SdrObject* pObject ) { bool bisMarked =false; - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpViewShell ); if (pObject ) @@ -855,7 +855,7 @@ bool DrawDocShell::GetObjectIsmarked(const OUString& rBookmark) OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr()); bool bUnMark = false; - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpViewShell ); @@ -936,7 +936,7 @@ bool DrawDocShell::GotoTreeBookmark(const OUString& rBookmark) OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr()); bool bFound = false; - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpViewShell ); @@ -1133,7 +1133,7 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL ) VclPtr<SfxDocumentInfoDialog> DrawDocShell::CreateDocumentInfoDialog( vcl::Window *pParent, const SfxItemSet &rSet ) { VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet ); - DrawDocShell* pDocSh = PTR_CAST(DrawDocShell,SfxObjectShell::Current()); + DrawDocShell* pDocSh = dynamic_cast< DrawDocShell *>( SfxObjectShell::Current() ); if( pDocSh == this ) { diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 5be6ef9b0258..7b252ff9268c 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -300,8 +300,7 @@ void DrawDocShell::InPlaceActivate( bool bActive ) { // determine the number of FrameViews SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell(); - // FIXME this used to be a PTR_CAST, but when I updated the macro, I discovered that SfxViewShell is not statically castable to sd::ViewShell - ViewShell* pViewSh = (pSfxViewSh && pSfxViewSh->IsA( TYPE(ViewShell) )) ? dynamic_cast<ViewShell*>(pSfxViewSh) : 0; + ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh); if ( pViewSh && pViewSh->GetFrameView() ) { @@ -321,8 +320,7 @@ void DrawDocShell::InPlaceActivate( bool bActive ) { // determine the number of FrameViews SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell(); - // FIXME this used to be a PTR_CAST, but when I updated the macro, I discovered that SfxViewShell is not statically castable to sd::ViewShell - ViewShell* pViewSh = (pSfxViewSh && pSfxViewSh->IsA( TYPE(ViewShell) )) ? dynamic_cast<ViewShell*>(pSfxViewSh) : 0; + ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh); if ( pViewSh ) { diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index cc989a3efd9a..461749f55bd0 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -103,13 +103,13 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark ) ::Outliner* pOL = NULL; // depending on ViewShell set Outliner and OutlinerView - if (mpViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { pOV = mpView->GetTextEditOutlinerView(); if (pOV) pOL = mpView->GetTextEditOutliner(); } - else if (mpViewShell->ISA(OutlineViewShell)) + else if( dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr) { pOL = &static_cast<OutlineView*>(mpView)->GetOutliner(); pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow( @@ -162,7 +162,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) aChars = static_cast<const SfxStringItem*>(pItem)->GetValue(); const SfxPoolItem* pFtItem = NULL; pArgs->GetItemState( mpDoc->GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); - const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem ); + const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) { OUString aFontName = pFontItem->GetValue(); @@ -223,7 +223,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) ::Outliner* pOL = NULL; // determine depending on ViewShell Outliner and OutlinerView - if(mpViewShell && mpViewShell->ISA(DrawViewShell)) + if(mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { pOV = mpView->GetTextEditOutlinerView(); if (pOV) @@ -231,7 +231,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) pOL = mpView->GetTextEditOutliner(); } } - else if(mpViewShell && mpViewShell->ISA(OutlineViewShell)) + else if(mpViewShell && dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr) { pOL = &static_cast<OutlineView*>(mpView)->GetOutliner(); pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow( diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index d6b887010c94..4abbc7686071 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -227,7 +227,7 @@ SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const Recta if(pObj) { - if(pObj->ISA(SdrCircObj)) + if( dynamic_cast< const SdrCircObj *>( pObj ) != nullptr) { Rectangle aRect(rRectangle); diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index 8be8252b39cc..3fda2e13d3b5 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -329,7 +329,7 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c if(pObj) { - if(pObj->ISA(SdrPathObj)) + if( dynamic_cast< const SdrPathObj *>( pObj ) != nullptr) { basegfx::B2DPolyPolygon aPoly; diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index 8d5ec3893d67..25f9548be7b3 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -239,7 +239,7 @@ bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt) } // init text position when vertical caption object is created - if(pObj->ISA(SdrCaptionObj) && SID_DRAW_CAPTION_VERTICAL == nSlotId) + if( dynamic_cast< const SdrCaptionObj *>( pObj ) != nullptr && SID_DRAW_CAPTION_VERTICAL == nSlotId) { // draw text object, needs to be initialized when vertical text is used SfxItemSet aSet(pObj->GetMergedItemSet()); @@ -815,7 +815,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const case SID_LINE_ARROW_SQUARE: case SID_LINE_SQUARE_ARROW: { - if(pObj->ISA(SdrPathObj)) + if( dynamic_cast< const SdrPathObj *>( pObj ) != nullptr) { sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); @@ -834,7 +834,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const case SID_DRAW_MEASURELINE: { - if(pObj->ISA(SdrMeasureObj)) + if( dynamic_cast< SdrMeasureObj *>( pObj ) != nullptr) { sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0); @@ -877,7 +877,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const case SID_CONNECTOR_LINES_CIRCLE_END: case SID_CONNECTOR_LINES_CIRCLES: { - if(pObj->ISA(SdrEdgeObj)) + if( dynamic_cast< SdrEdgeObj *>( pObj ) != nullptr) { static_cast<SdrEdgeObj*>(pObj)->SetTailPoint(false, aStart); static_cast<SdrEdgeObj*>(pObj)->SetTailPoint(true, aEnd); @@ -892,7 +892,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const case SID_DRAW_CAPTION: case SID_DRAW_CAPTION_VERTICAL: { - if(pObj->ISA(SdrCaptionObj)) + if( dynamic_cast< SdrCaptionObj *>( pObj ) != nullptr) { bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 87fd5f415e12..1655822dee2b 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -557,7 +557,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) // wouldn't be possible per default. const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if ((pObject->ISA(E3dObject)) && (rMarkList.GetMarkCount() == 1)) + if ((dynamic_cast<const E3dObject* >(pObject) != nullptr) && (rMarkList.GetMarkCount() == 1)) { mpWindow->SetPointer(Pointer(PointerStyle::Rotate)); bDefPointer = false; // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again @@ -573,7 +573,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) { pObj = aVEvt.pObj; } - else if (eHit == SDRHIT_TEXTEDITOBJ && this->ISA(FuSelection)) + else if (eHit == SDRHIT_TEXTEDITOBJ && dynamic_cast< const FuSelection *>( this ) != nullptr) { sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier(); @@ -588,12 +588,12 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) } } - if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection)) + if (pObj && pMEvt && !pMEvt->IsMod2() && dynamic_cast< const FuSelection *>( this ) != nullptr) { // test for animation or ImageMap bDefPointer = !SetPointer(pObj, aPnt); - if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene))) + if (bDefPointer && (dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr || dynamic_cast< const E3dPolyScene* >(pObj) != nullptr)) { // take a glance into the group if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::DEEP)) @@ -617,7 +617,7 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) { bool bSet = false; - bool bAnimationInfo = !mpDocSh->ISA(GraphicDocShell) && + bool bAnimationInfo = dynamic_cast< const GraphicDocShell *>( mpDocSh ) == nullptr && mpDoc->GetAnimationInfo(pObj); bool bImageMapInfo = false; @@ -657,7 +657,7 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) ******************************************************/ SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj); - if ((mpView->ISA(DrawView) && + if(( dynamic_cast< const DrawView *>( mpView ) != nullptr && (pInfo->meClickAction == presentation::ClickAction_BOOKMARK || pInfo->meClickAction == presentation::ClickAction_DOCUMENT || pInfo->meClickAction == presentation::ClickAction_PREVPAGE || @@ -669,7 +669,7 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) pInfo->meClickAction == presentation::ClickAction_MACRO || pInfo->meClickAction == presentation::ClickAction_SOUND)) || - (mpView->ISA(DrawView) && + ( dynamic_cast< const DrawView *>( mpView ) != nullptr && SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) && (pInfo->meClickAction == presentation::ClickAction_VANISH || pInfo->meClickAction == presentation::ClickAction_INVISIBLE || @@ -735,7 +735,7 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) GetDispatcher()->Execute( SID_INSERT_GRAPHIC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); } - else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) && + else if ( ( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr || dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr ) && !SD_MOD()->GetWaterCan() && mpViewShell->GetFrameView()->IsDoubleClickTextEdit() && !mpDocSh->IsReadOnly()) @@ -777,7 +777,7 @@ bool FuDraw::RequestHelp(const HelpEvent& rHEvt) bReturn = SetHelpText(pObj, aPosPixel, aVEvt); - if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene))) + if (!bReturn && (dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr || dynamic_cast< const E3dPolyScene* >(pObj) != nullptr)) { // take a glance into the group SdrPageView* pPV = NULL; @@ -821,7 +821,7 @@ bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewE } } } - else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj)) + else if (dynamic_cast< GraphicDocShell *>( mpDocSh ) == nullptr && mpDoc->GetAnimationInfo(pObj)) { SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj); diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx index a8331942f3c9..6b7a259d0209 100644 --- a/sd/source/ui/func/fuhhconv.cxx +++ b/sd/source/ui/func/fuhhconv.cxx @@ -63,12 +63,12 @@ FuHangulHanjaConversion::FuHangulHanjaConversion ( pSdOutliner(NULL), bOwnOutliner(false) { - if ( mpViewShell->ISA(DrawViewShell) ) + if ( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr ) { bOwnOutliner = true; pSdOutliner = new Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT ); } - else if ( mpViewShell->ISA(OutlineViewShell) ) + else if ( dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr ) { bOwnOutliner = false; pSdOutliner = mpDoc->GetOutliner(); @@ -102,13 +102,13 @@ void FuHangulHanjaConversion::StartConversion( sal_Int16 nSourceLanguage, sal_In mpView->BegUndo(SD_RESSTR(STR_UNDO_HANGULHANJACONVERSION)); - ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() ); if (pBase != NULL) mpViewShell = pBase->GetMainViewShell().get(); if( mpViewShell ) { - if ( pSdOutliner && mpViewShell->ISA(DrawViewShell) && !bOwnOutliner ) + if ( pSdOutliner && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bOwnOutliner ) { pSdOutliner->EndConversion(); @@ -116,7 +116,7 @@ void FuHangulHanjaConversion::StartConversion( sal_Int16 nSourceLanguage, sal_In pSdOutliner = new Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT ); pSdOutliner->BeginConversion(); } - else if ( pSdOutliner && mpViewShell->ISA(OutlineViewShell) && bOwnOutliner ) + else if ( pSdOutliner && dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr && bOwnOutliner ) { pSdOutliner->EndConversion(); delete pSdOutliner; diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index f2c1432c103b..da787904b807 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -123,7 +123,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& ) int nError = aDlg.GetGraphic(aGraphic); if( nError == GRFILTER_OK ) { - if( mpViewShell && mpViewShell->ISA(DrawViewShell)) + if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) { sal_Int8 nAction = DND_ACTION_COPY; SdrObject* pPickObj; @@ -228,7 +228,7 @@ void FuInsertClipboard::DoExecute( SfxRequest& ) if( !mpView->InsertData( aDataHelper, mpWindow->PixelToLogic( Rectangle( Point(), mpWindow->GetOutputSizePixel() ).Center() ), nAction, false, nFormatId ) && - ( mpViewShell && mpViewShell->ISA( DrawViewShell ) ) ) + ( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) ) { DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell); INetBookmark aINetBookmark( "", "" ); @@ -702,7 +702,7 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) if( pReqArgs ) { - const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, &pReqArgs->Get( rReq.GetSlot() ) ); + const SfxStringItem* pStringItem = dynamic_cast<const SfxStringItem*>( &pReqArgs->Get( rReq.GetSlot() ) ); if( pStringItem ) { diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 281155e1b7b4..163a9acf5e70 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -264,7 +264,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SfxFilterFlags::IMPORT, SFX_FILTER_NOTINSTALLED ); - bool bDrawMode = mpViewShell && mpViewShell->ISA(DrawViewShell); + bool bDrawMode = mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr; bool bInserted = false; if( pFilter ) @@ -357,7 +357,7 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) if (pView) { - if (pView->ISA(OutlineView)) + if( dynamic_cast< const OutlineView *>( pView ) != nullptr) { pPage = static_cast<OutlineView*>(pView)->GetActualPage(); } diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 985824f860d1..9aa90de5db82 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -61,7 +61,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) const SdrObject* pNewObj; SdrObject* pConvPolyObj = NULL; - if( pObj->ISA( SdrPathObj ) ) + if( dynamic_cast< const SdrPathObj *>( pObj ) != nullptr ) { pNewObj = pObj; } @@ -78,7 +78,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) { pNewObj = pConvPolyObj = pObj->ConvertToPolyObj( true, false ); - if( !pNewObj || !pNewObj->ISA( SdrPathObj ) ) + if( !pNewObj || dynamic_cast< const SdrPathObj *>( pNewObj ) == nullptr ) return; // Cancel, additional security, but it does not help // for group objects } diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 4f9d2cfa89de..523ad26798c2 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -113,14 +113,14 @@ void FuMorph::DoExecute( SfxRequest& ) while(aIter1.IsMore()) { SdrObject* pObj = aIter1.Next(); - if(pObj && pObj->ISA(SdrPathObj)) + if(pObj && dynamic_cast< SdrPathObj *>( pObj ) != nullptr) aPolyPoly1.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); } while(aIter2.IsMore()) { SdrObject* pObj = aIter2.Next(); - if(pObj && pObj->ISA(SdrPathObj)) + if(pObj && dynamic_cast< SdrPathObj *>( pObj ) != nullptr) aPolyPoly2.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); } diff --git a/sd/source/ui/func/funavig.cxx b/sd/source/ui/func/funavig.cxx index 1c28b93d7bce..a739109a6c95 100644 --- a/sd/source/ui/func/funavig.cxx +++ b/sd/source/ui/func/funavig.cxx @@ -59,7 +59,7 @@ void FuNavigation::DoExecute( SfxRequest& rReq ) case SID_GO_TO_FIRST_PAGE: { if (!mpView->IsTextEdit() - && mpViewShell->ISA(DrawViewShell) + && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // jump to first page @@ -70,7 +70,7 @@ void FuNavigation::DoExecute( SfxRequest& rReq ) case SID_GO_TO_PREVIOUS_PAGE: { - if(mpViewShell->ISA(DrawViewShell) && !bSlideShow) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // With no modifier pressed we move to the previous // slide. @@ -100,7 +100,7 @@ void FuNavigation::DoExecute( SfxRequest& rReq ) case SID_GO_TO_NEXT_PAGE: { - if(mpViewShell->ISA(DrawViewShell) && !bSlideShow) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // With no modifier pressed we move to the next slide. mpView->SdrEndTextEdit(); @@ -129,7 +129,7 @@ void FuNavigation::DoExecute( SfxRequest& rReq ) case SID_GO_TO_LAST_PAGE: { if (!mpView->IsTextEdit() - && mpViewShell->ISA(DrawViewShell) + && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // jump to last page diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 653562aeb61e..f13a8035cc0a 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -99,7 +99,7 @@ void FuOutlineBullet::DoExecute( 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()); @@ -236,7 +236,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); 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/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index a3dceffd6599..ee94791407e4 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -144,7 +144,7 @@ bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt) { const SvxFieldData* pField = pFieldItem->GetField(); - if( pField && pField->ISA( SvxURLField ) ) + if( pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr ) { bReturn = true; mpWindow->ReleaseMouse(); diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index b2be7eb2884e..06e431d9fa83 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -202,7 +202,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { if(rKEvt.GetKeyCode().IsMod1()) { - if (mpViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(mpViewShell); @@ -217,7 +217,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { 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()); @@ -260,12 +260,12 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrOle2Obj ) && !mpDocSh->IsUIActive() ) + if( pObj && dynamic_cast< const SdrOle2Obj* >( pObj ) != nullptr && !mpDocSh->IsUIActive() ) { //HMHmpView->HideMarkHdl(); mpViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 ); } - else if( pObj && pObj->IsEmptyPresObj() && pObj->ISA( SdrGrafObj ) ) + else if( pObj && pObj->IsEmptyPresObj() && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) { mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_GRAPHIC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); } @@ -321,7 +321,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) // increase zoom mpViewShell->SetZoom(mpWindow->GetZoom() * 3 / 2); - if (mpViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) static_cast<DrawViewShell*>(mpViewShell) ->SetZoomOnPage(false); @@ -337,7 +337,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) // decrease zoom mpViewShell->SetZoom(mpWindow->GetZoom() * 2 / 3); - if (mpViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) static_cast<DrawViewShell*>(mpViewShell) ->SetZoomOnPage(false); @@ -399,7 +399,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) case KEY_HOME: { if (!mpView->IsTextEdit() - && mpViewShell->ISA(DrawViewShell) + && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // jump to first page @@ -412,7 +412,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) case KEY_END: { if (!mpView->IsTextEdit() - && mpViewShell->ISA(DrawViewShell) + && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // jump to last page @@ -431,7 +431,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() ) break; - if(mpViewShell->ISA(DrawViewShell) && !bSlideShow) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // The page-up key switches layers or pages depending on the // modifier key. @@ -478,7 +478,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() ) break; - if(mpViewShell->ISA(DrawViewShell) && !bSlideShow) + if(dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bSlideShow) { // The page-down key switches layers or pages depending on the // modifier key. @@ -626,7 +626,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) bool bOldSuppress = false; SdrEdgeObj* pEdgeObj = 0L; - if(pHdl && pHdl->GetObj() && pHdl->GetObj()->ISA(SdrEdgeObj) && 0 == pHdl->GetPolyNum()) + if(pHdl && pHdl->GetObj() && 0 != dynamic_cast< const SdrEdgeObj *>( pHdl->GetObj() ) && 0 == pHdl->GetPolyNum()) { pEdgeObj = static_cast<SdrEdgeObj*>(pHdl->GetObj()); @@ -811,7 +811,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); // #i118485# allow TextInput for OLEs, too - if(pObj->ISA(SdrTextObj) && pObj->HasTextEdit()) + if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr && pObj->HasTextEdit()) { // use common IsSimpleCharInput from the EditEngine. bool bPrintable(EditEngine::IsSimpleCharInput(rKEvt)); @@ -836,7 +836,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { // test if there is a title object there. If yes, try to // set it to edit mode and start typing... - if(mpViewShell->ISA(DrawViewShell) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && EditEngine::IsSimpleCharInput(rKEvt)) { DrawViewShell* pDrawViewShell = @@ -852,7 +852,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { 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()); @@ -1044,7 +1044,7 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq) { const SfxPoolItem& rItem = pSet->Get( nSlotId ); - if( rItem.ISA( SfxAllEnumItem ) ) + if( dynamic_cast< const SfxAllEnumItem *>( &rItem ) != nullptr ) { nSlotValue = static_cast<const SfxAllEnumItem&>( rItem ).GetValue(); } @@ -1076,7 +1076,7 @@ void FuPoor::ImpForceQuadratic(Rectangle& rRect) void FuPoor::SwitchLayer (sal_Int32 nOffset) { - if(mpViewShell && mpViewShell->ISA(DrawViewShell)) + if(mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(mpViewShell); @@ -1114,7 +1114,7 @@ void FuPoor::SwitchLayer (sal_Int32 nOffset) */ bool FuPoor::cancel() { - if ( !this->ISA(FuSelection) ) + if ( dynamic_cast< const FuSelection *>( this ) == nullptr ) { mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); return true; diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 01993ba790c1..16665d1c6f64 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -93,7 +93,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) /* if we are on a master page, the changes apply for all pages and notes- pages who are using the relevant layout */ bool bOnMaster = false; - if( mpViewShell && mpViewShell->ISA(DrawViewShell)) + if( mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { EditMode eEditMode = static_cast<DrawViewShell*>(mpViewShell)->GetEditMode(); @@ -210,7 +210,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) /* That isn't quite right. If the masterpageview is active and you are removing a masterpage, it's possible that you are removing the current masterpage. So you have to call ResetActualPage ! */ - if( mpViewShell->ISA(DrawViewShell) && !bCheckMasters ) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bCheckMasters ) static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(true); if (bLoad) @@ -236,7 +236,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) } // remove blocking - if (mpViewShell->ISA(DrawViewShell) && !bCheckMasters ) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr && !bCheckMasters ) static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(false); // if the master page was visible, show it again @@ -244,7 +244,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) { if (bOnMaster) { - if (mpViewShell->ISA(DrawViewShell)) + if( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) { ::sd::View* pView = static_cast<DrawViewShell*>(mpViewShell)->GetView(); @@ -276,7 +276,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) // fake a mode change to repaint the page tab bar - if( mpViewShell && mpViewShell->ISA( DrawViewShell ) ) + if( mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr ) { DrawViewShell* pDrawViewSh = static_cast<DrawViewShell*>(mpViewShell); diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 2c2db012d629..4c54f95d27b7 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -77,7 +77,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) nValue = (sal_Int16) mpWindow->GetZoom(); // zoom on page size? - if( mpViewShell && mpViewShell->ISA( DrawViewShell ) && + if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr && static_cast<DrawViewShell*>(mpViewShell)->IsZoomOnPage() ) { pZoomItem.reset(new SvxZoomItem( SvxZoomType::WHOLEPAGE, nValue )); @@ -90,7 +90,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) // limit range if( mpViewShell ) { - if( mpViewShell->ISA( DrawViewShell ) ) + if( dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) { SdrPageView* pPageView = mpView->GetSdrPageView(); if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) ) @@ -99,7 +99,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL; } } - else if( mpViewShell->ISA( OutlineViewShell ) ) + else if( dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr ) { nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL; nZoomValues &= ~SvxZoomEnableFlags::WHOLEPAGE; @@ -156,7 +156,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) case SvxZoomType::OPTIMAL: { - if( mpViewShell->ISA( DrawViewShell ) ) + if( dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) { // name confusion: SID_SIZE_ALL -> zoom onto all objects // --> the program offers it as optimal diff --git a/sd/source/ui/func/fusearch.cxx b/sd/source/ui/func/fusearch.cxx index eb0003520830..a6d535f43821 100644 --- a/sd/source/ui/func/fusearch.cxx +++ b/sd/source/ui/func/fusearch.cxx @@ -73,12 +73,12 @@ void FuSearch::DoExecute( SfxRequest& ) { mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArraySpell ); - if ( mpViewShell->ISA(DrawViewShell) ) + if ( dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr ) { bOwnOutliner = true; pSdOutliner = new ::sd::Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT ); } - else if ( mpViewShell->ISA(OutlineViewShell) ) + else if ( dynamic_cast< const OutlineViewShell *>( mpViewShell ) != nullptr ) { bOwnOutliner = false; pSdOutliner = mpDoc->GetOutliner(); @@ -102,14 +102,14 @@ FuSearch::~FuSearch() void FuSearch::SearchAndReplace( const SvxSearchItem* pSearchItem ) { - ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current()); + ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() ); ViewShell* pViewShell = NULL; if (pBase != NULL) pViewShell = pBase->GetMainViewShell().get(); if (pViewShell != NULL) { - if ( pSdOutliner && pViewShell->ISA(DrawViewShell) && !bOwnOutliner ) + if ( pSdOutliner && dynamic_cast< const DrawViewShell *>( pViewShell ) != nullptr && !bOwnOutliner ) { pSdOutliner->EndSpelling(); @@ -117,7 +117,7 @@ void FuSearch::SearchAndReplace( const SvxSearchItem* pSearchItem ) pSdOutliner = new ::sd::Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT ); pSdOutliner->PrepareSpelling(); } - else if ( pSdOutliner && pViewShell->ISA(OutlineViewShell) && bOwnOutliner ) + else if ( pSdOutliner && dynamic_cast< const OutlineViewShell *>( pViewShell ) != nullptr && bOwnOutliner ) { pSdOutliner->EndSpelling(); delete pSdOutliner; diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 63a78c3568ae..585454445d38 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -300,7 +300,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) bReturn = true; } else if(!rMEvt.IsMod2() - && mpViewShell->ISA(DrawViewShell) + && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr ) { if(mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER)) @@ -309,7 +309,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) if ( ! bSelectionOnly) bReturn = AnimateObj(pObj, aMDPos); - if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene))) + if( !bReturn && (dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr || dynamic_cast< const E3dPolyScene* >(pObj) != nullptr)) { if(rMEvt.GetClicks() == 1) { @@ -1257,8 +1257,8 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) bAnimated = true; } } - else if (!mpDocSh->ISA(GraphicDocShell) && - mpView->ISA(DrawView) && + else if( dynamic_cast< const GraphicDocShell *>( mpDocSh ) == nullptr && + dynamic_cast< const DrawView *>( mpView ) != nullptr && mpDoc->GetAnimationInfo(pObj)) { /********************************************************** @@ -1448,8 +1448,8 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) } if (!bAnimated && - mpView->ISA(DrawView) && - !mpDocSh->ISA(GraphicDocShell) && + dynamic_cast< const DrawView *>( mpView ) != nullptr && + dynamic_cast< const GraphicDocShell *>( mpDocSh ) == nullptr && SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) && mpDoc->GetAnimationInfo(pObj)) { diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 2b4624758356..f8cfe96a645c 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -529,7 +529,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - if( pObj->ISA(SdrPageObj) ) + if( dynamic_cast< const SdrPageObj *>( pObj ) != nullptr ) { // repaint only pObj->ActionChanged(); @@ -609,7 +609,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) case SID_STYLE_UPDATE_BY_EXAMPLE: { if ((mpView->AreObjectsMarked() && mpView->GetMarkedObjectList().GetMarkCount() == 1) || - mpView->ISA(OutlineView)) + dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pStyleSheet = mpView->GetStyleSheet(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 9aa0bbc997b3..b6a29ddfca84 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -323,7 +323,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) select object and set to EditMode */ mpView->MarkObj(aVEvt.pRootObj, pPV); - if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj)) + if (aVEvt.pObj && dynamic_cast< const SdrTextObj *>( aVEvt.pObj ) != nullptr) { mxTextObj.reset( static_cast<SdrTextObj*>(aVEvt.pObj) ); } @@ -1178,7 +1178,7 @@ bool FuText::RequestHelp(const HelpEvent& rHEvt) const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer(); const SvxFieldData* pField = pFieldItem->GetField(); - if (pField && pField->ISA(SvxURLField)) + if (pField && dynamic_cast< const SvxURLField *>( pField ) != nullptr) { // URL-Field aHelpText = INetURLObject::decode( static_cast<const SvxURLField*>(pField)->GetURL(), INetURLObject::DECODE_WITH_CHARSET ); @@ -1235,7 +1235,7 @@ void FuText::ReceiveRequest(SfxRequest& rReq) mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); mpView->MarkObj(aVEvt.pRootObj, pPV); - if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj)) + if (aVEvt.pObj && dynamic_cast< SdrTextObj *>( aVEvt.pObj ) != nullptr) { mxTextObj.reset( static_cast< SdrTextObj* >( aVEvt.pObj ) ); } @@ -1249,7 +1249,7 @@ void FuText::ReceiveRequest(SfxRequest& rReq) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if (pObj->ISA(SdrTextObj)) + if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr) { mxTextObj.reset( static_cast< SdrTextObj* >( pObj ) ); } @@ -1293,7 +1293,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR if(pObj) { - if(pObj->ISA(SdrTextObj)) + if( dynamic_cast< SdrTextObj *>( pObj ) != nullptr) { SdrTextObj* pText = static_cast<SdrTextObj*>(pObj); pText->SetLogicRect(rRectangle); diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx index 7ccee443f4d6..b3218da08a3a 100644 --- a/sd/source/ui/func/futhes.cxx +++ b/sd/source/ui/func/futhes.cxx @@ -70,7 +70,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, OUString(), mpWindow, RID_SVXERRCTX, &DIALOG_MGR() ); - if (mpViewShell && mpViewShell->ISA(DrawViewShell)) + if (mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr) { SdrTextObj* pTextObj = NULL; @@ -83,7 +83,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - if ( pObj->ISA(SdrTextObj) ) + if ( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr ) { pTextObj = static_cast<SdrTextObj*>(pObj); } @@ -117,7 +117,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) } } } - else if (mpViewShell && mpViewShell->ISA(OutlineViewShell)) + else if (mpViewShell && dynamic_cast< OutlineViewShell *>( mpViewShell ) != nullptr) { Outliner* pOutliner = mpDoc->GetOutliner(); OutlinerView* pOutlView = pOutliner->GetView(0); diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx index 2ceda3bc7d70..a4fbbf00c654 100644 --- a/sd/source/ui/func/fuvect.cxx +++ b/sd/source/ui/func/fuvect.cxx @@ -61,7 +61,7 @@ void FuVectorize::DoExecute( SfxRequest& ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) ) + if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); std::unique_ptr<AbstractSdVectorizeDlg> pDlg(pFact ? pFact->CreateSdVectorizeDlg( mpWindow, static_cast<SdrGrafObj*>( pObj )->GetGraphic().GetBitmap(), mpDocSh ) : 0); diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx index 688c08d0c3dc..0c012205eed1 100644 --- a/sd/source/ui/func/sdundogr.cxx +++ b/sd/source/ui/func/sdundogr.cxx @@ -35,7 +35,7 @@ bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) { bool bRet = false; - if( pNextAction && pNextAction->ISA( SdUndoAction ) ) + if( pNextAction && dynamic_cast< const SdUndoAction *>( pNextAction ) != nullptr ) { SdUndoAction* pClone = static_cast< SdUndoAction* >( pNextAction )->Clone(); diff --git a/sd/source/ui/func/undolayer.cxx b/sd/source/ui/func/undolayer.cxx index 33897e1dc33c..f852c48c1804 100644 --- a/sd/source/ui/func/undolayer.cxx +++ b/sd/source/ui/func/undolayer.cxx @@ -55,8 +55,7 @@ void SdLayerModifyUndoAction::Undo() ::sd::DrawDocShell* mpDocSh = mpDoc->GetDocSh(); if( mpDocSh ) { - ::sd::DrawViewShell* pDrViewSh = - PTR_CAST(::sd::DrawViewShell, mpDocSh->GetViewShell() ); + ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell*> ( mpDocSh->GetViewShell() ); if( pDrViewSh ) { pDrViewSh->ModifyLayer( mpLayer, maOldLayerName, maOldLayerTitle, maOldLayerDesc, mbOldIsVisible, mbOldIsLocked, mbOldIsPrintable ); @@ -69,8 +68,7 @@ void SdLayerModifyUndoAction::Redo() ::sd::DrawDocShell* mpDocSh = mpDoc->GetDocSh(); if( mpDocSh ) { - ::sd::DrawViewShell* pDrViewSh = - PTR_CAST(::sd::DrawViewShell, mpDocSh->GetViewShell() ); + ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >( mpDocSh->GetViewShell() ); if( pDrViewSh ) { pDrViewSh->ModifyLayer( mpLayer, maNewLayerName, maNewLayerTitle, maNewLayerDesc, mbNewIsVisible, mbNewIsLocked, mbNewIsPrintable ); diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx index 6474735da5e8..1c73b514ff09 100644 --- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx @@ -160,7 +160,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume mxDocumentShell = NULL; } SfxObjectShell* pShell = mxDocumentShell; - return PTR_CAST(::sd::DrawDocShell,pShell); + return dynamic_cast< ::sd::DrawDocShell *>( pShell ); } int TemplatePageObjectProvider::GetCostIndex() diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx index 9e71684192d4..d2a6d2d9bae6 100644 --- a/sd/source/ui/sidebar/MasterPageObserver.cxx +++ b/sd/source/ui/sidebar/MasterPageObserver.cxx @@ -232,7 +232,7 @@ void MasterPageObserver::Implementation::Notify( // filters out events that are sent in between the insertion // of a new standard master page and a new notes master // page. - if (rBroadcaster.ISA(SdDrawDocument)) + if (dynamic_cast< const SdDrawDocument *>( &rBroadcaster ) != nullptr) { SdDrawDocument& rDocument ( static_cast<SdDrawDocument&>(rBroadcaster)); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 0b3f79d912ef..e3c527af1a96 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -691,7 +691,7 @@ void SAL_CALL SlideshowImpl::disposing() } // show current window again - if( mpViewShell && !mpViewShell->ISA(PresentationViewShell)) + if( mpViewShell && dynamic_cast< PresentationViewShell *>( mpViewShell ) == nullptr) { if( meAnimationMode == ANIMATIONMODE_SHOW ) { @@ -1624,7 +1624,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun:: { // todo, better do it async? SdrObject* pObj = GetSdrObjectFromXShape( xShape ); - SdrOle2Obj* pOleObject = PTR_CAST(SdrOle2Obj, pObj); + SdrOle2Obj* pOleObject = dynamic_cast< SdrOle2Obj* >(pObj); if (pOleObject && mpViewShell ) mpViewShell->ActivateObject(pOleObject, pEvent->mnVerb); } diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index ca2e0583bee3..2d0523b0ed51 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +#/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -485,7 +485,7 @@ void SlideSorterViewShell::Activate (bool bIsMDIActivate) case ViewShell::ST_NOTES: case ViewShell::ST_DRAW: eContext = EnumContext::Context_DrawPage; - if (pMainViewShell->ISA(DrawViewShell)) + if( 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); if (pDrawViewShell != NULL) @@ -726,7 +726,7 @@ void SlideSorterViewShell::GetStateMovePageFirst (SfxItemSet& rSet) if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL && pMainViewShell->ISA(DrawViewShell)) + if (pMainViewShell.get() != NULL && 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); if (pDrawViewShell != NULL && pDrawViewShell->GetPageKind() == PK_HANDOUT) @@ -843,7 +843,7 @@ void SlideSorterViewShell::ExecMovePageLast (SfxRequest& /*rReq*/) void SlideSorterViewShell::GetStateMovePageLast (SfxItemSet& rSet) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL && pMainViewShell->ISA(DrawViewShell)) + if (pMainViewShell.get() != NULL && 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); if (pDrawViewShell != NULL && pDrawViewShell->GetPageKind() == PK_HANDOUT) diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 5ece5f1ddfee..af8f5e15f1f1 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -698,8 +698,7 @@ void SdLayerManager::UpdateLayerView( bool modify ) const throw() { if(mpModel->mpDocShell) { - ::sd::DrawViewShell* pDrViewSh = - PTR_CAST(::sd::DrawViewShell, mpModel->mpDocShell->GetViewShell()); + ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >( mpModel->mpDocShell->GetViewShell()); if(pDrViewSh) { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 0d322ea151f8..6dcf8cbe008a 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1769,7 +1769,7 @@ vcl::PDFWriter::StructElement ImplRenderPaintProc::ImplBegStructureTag( SdrObjec { sal_uInt32 nInventor = rObject.GetObjInventor(); sal_uInt16 nIdentifier = rObject.GetObjIdentifier(); - bool bIsTextObj = rObject.ISA( SdrTextObj ); + bool bIsTextObj = dynamic_cast< const SdrTextObj *>( &rObject ) != nullptr; if ( nInventor == SdrInventor ) { @@ -1913,7 +1913,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r if( pOut ) { - vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, pOut->GetExtOutDevData() ); + vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast<vcl::PDFExtOutDevData* >( pOut->GetExtOutDevData() ); if ( !( (mpDoc->GetSdPage((sal_Int16) nPageNumber-1, PK_STANDARD))->IsExcluded() ) || (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides()) ) diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index b5381cffdaae..70d7574fa706 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -902,7 +902,7 @@ bool SdXShape::IsPresObj() const SdrObject* pObj = mpShape->GetSdrObject(); if(pObj) { - SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage()); + SdPage* pPage = dynamic_cast<SdPage* >(pObj->GetPage()); if(pPage) return pPage->GetPresObjKind(pObj) != PRESOBJ_NONE; } @@ -945,7 +945,7 @@ OUString SdXShape::GetPlaceholderText() const if( pObj == NULL ) return OUString(); - SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage()); + SdPage* pPage = dynamic_cast< SdPage* >(pObj->GetPage()); DBG_ASSERT( pPage, "no page?" ); if( pPage == NULL ) return OUString(); @@ -975,10 +975,10 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) // really delete SdrOutlinerObj at pObj pObj->NbcSetOutlinerParaObject(0L); - if( bVertical && PTR_CAST( SdrTextObj, pObj ) ) + if( bVertical && dynamic_cast<SdrTextObj*>( pObj ) ) static_cast<SdrTextObj*>(pObj)->SetVerticalWriting( true ); - SdrGrafObj* pGraphicObj = PTR_CAST( SdrGrafObj, pObj ); + SdrGrafObj* pGraphicObj = dynamic_cast<SdrGrafObj*>( pObj ); if( pGraphicObj ) { Graphic aEmpty; @@ -986,7 +986,7 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) } else { - SdrOle2Obj* pOleObj = PTR_CAST( SdrOle2Obj, pObj ); + SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >( pObj ); if( pOleObj ) { pOleObj->SetGraphic( NULL ); @@ -1010,7 +1010,7 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) if( pOutliner == NULL ) break; - SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage()); + SdPage* pPage = dynamic_cast< SdPage* >(pObj->GetPage()); DBG_ASSERT( pPage, "no page?" ); if( pPage == NULL ) break; @@ -1049,7 +1049,7 @@ void SdXShape::SetMasterDepend( bool bDepend ) throw() { if( bDepend ) { - SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage()); + SdPage* pPage = dynamic_cast< SdPage* >(pObj->GetPage()); pObj->SetUserCall( pPage ); } else diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 6d22bec8281c..fa9897225afb 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -406,8 +406,8 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap // #i119287# similar to the code in the SdrObject methods the graphic and ole // SdrObjects need another default style than the rest, see task. Adding here, too. // TTTT: Same as for #i119287#: Can be removed in branch aw080 again - const bool bIsSdrGrafObj(0 != dynamic_cast< SdrGrafObj* >(pObj)); - const bool bIsSdrOle2Obj(0 != dynamic_cast< SdrOle2Obj* >(pObj)); + const bool bIsSdrGrafObj(dynamic_cast< const SdrGrafObj* >(pObj) != nullptr); + const bool bIsSdrOle2Obj(dynamic_cast< const SdrOle2Obj* >(pObj) != nullptr); if(bIsSdrGrafObj || bIsSdrOle2Obj) { @@ -1782,7 +1782,7 @@ static void refreshpage( SdDrawDocument* pDoc, const PageKind ePageKind ) if( pViewSh ) { - if( pViewSh->ISA(::sd::DrawViewShell ) ) + if( dynamic_cast<const ::sd::DrawViewShell* >(pViewSh) != nullptr ) static_cast< ::sd::DrawViewShell*>(pViewSh)->ResetActualPage(); Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize(); @@ -1917,7 +1917,7 @@ sal_Bool SAL_CALL SdPageLinkTargets::hasElements() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) + if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); if( !aStr.isEmpty() ) return sal_True; @@ -1964,7 +1964,7 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) + if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); if( !aStr.isEmpty() ) nObjCount++; @@ -1981,7 +1981,7 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) + if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); if( !aStr.isEmpty() ) *pStr++ = aStr; @@ -2011,7 +2011,7 @@ SdrObject* SdPageLinkTargets::FindObject( const OUString& rName ) const throw() { SdrObject* pObj = aIter.Next(); OUString aStr( pObj->GetName() ); - if( aStr.isEmpty() && pObj->ISA( SdrOle2Obj ) ) + if( aStr.isEmpty() && dynamic_cast< const SdrOle2Obj *>( pObj ) != nullptr ) aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); if( !aStr.isEmpty() && (aStr == rName) ) return pObj; @@ -2319,7 +2319,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName ) // fake a mode change to repaint the page tab bar ::sd::DrawDocShell* pDocSh = GetModel()->GetDocShell(); ::sd::ViewShell* pViewSh = pDocSh ? pDocSh->GetViewShell() : NULL; - if( pViewSh && pViewSh->ISA(::sd::DrawViewShell)) + if( pViewSh && dynamic_cast< const ::sd::DrawViewShell* >(pViewSh) != nullptr) { ::sd::DrawViewShell* pDrawViewSh = static_cast< ::sd::DrawViewShell*>(pViewSh); @@ -3037,7 +3037,7 @@ void SAL_CALL SdMasterPage::setName( const OUString& rName ) // fake a mode change to repaint the page tab bar ::sd::DrawDocShell* pDocSh = GetModel()->GetDocShell(); ::sd::ViewShell* pViewSh = pDocSh ? pDocSh->GetViewShell() : NULL; - if( pViewSh && pViewSh->ISA(::sd::DrawViewShell ) ) + if( pViewSh && dynamic_cast< const ::sd::DrawViewShell* >(pViewSh) != nullptr ) { ::sd::DrawViewShell* pDrawViewSh = static_cast< ::sd::DrawViewShell*>(pViewSh); 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; } |