diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-29 15:35:28 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-10-01 08:32:26 +0000 |
commit | 85f93697defd9a812a0cda0bc4e9364e28c0339e (patch) | |
tree | 0c43827cda0e18b03c3d28599b696bcab3a8069a /svx/source/engine3d | |
parent | c1e0a697a70872ef1b6deaf5222538899554221b (diff) |
tdf#94559: third step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
oox, reportdesign, svl, svtools, svx, tools
Change-Id: I1f85ff92267a0668eba625fa61b4f07feb8f3d4e
Reviewed-on: https://gerrit.libreoffice.org/19002
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'svx/source/engine3d')
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/obj3d.cxx | 14 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 8 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 44 | ||||
-rw-r--r-- | svx/source/engine3d/view3d1.cxx | 10 |
5 files changed, 40 insertions, 40 deletions
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index 53028b382895..add71f23cf5f 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -321,7 +321,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) { // Get modifier sal_uInt16 nModifier = 0; - if(getSdrDragView().ISA(E3dView)) + if(dynamic_cast<const E3dView*>(&getSdrDragView())) { const MouseEvent& rLastMouse = static_cast<E3dView&>(getSdrDragView()).GetMouseEvent(); nModifier = rLastMouse.GetModifier(); @@ -499,7 +499,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) // Get modifier sal_uInt16 nModifier(0); - if(getSdrDragView().ISA(E3dView)) + if(dynamic_cast<const E3dView*>(&getSdrDragView())) { const MouseEvent& rLastMouse = static_cast<E3dView&>(getSdrDragView()).GetMouseEvent(); nModifier = rLastMouse.GetModifier(); diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 91d2d3d4f1e7..5181ac2c2a41 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -110,10 +110,10 @@ E3dObjList::~E3dObjList() void E3dObjList::NbcInsertObject(SdrObject* pObj, size_t nPos, const SdrInsertReason* pReason) { // Get owner - DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "Insert 3D object in parent != 3DObject"); + DBG_ASSERT(dynamic_cast<const E3dObject*>(GetOwnerObj()), "Insert 3D object in parent != 3DObject"); // Is it even a 3D object? - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast<const E3dObject*>(pObj)) { // Normal 3D object, insert means // call parent @@ -128,7 +128,7 @@ void E3dObjList::NbcInsertObject(SdrObject* pObj, size_t nPos, const SdrInsertRe void E3dObjList::InsertObject(SdrObject* pObj, size_t nPos, const SdrInsertReason* pReason) { - OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "Insert 3D object in non-3D Parent"); + OSL_ENSURE(dynamic_cast<const E3dObject*>(GetOwnerObj()), "Insert 3D object in non-3D Parent"); // call parent SdrObjList::InsertObject(pObj, nPos, pReason); @@ -142,7 +142,7 @@ void E3dObjList::InsertObject(SdrObject* pObj, size_t nPos, const SdrInsertReaso SdrObject* E3dObjList::NbcRemoveObject(size_t nObjNum) { - DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "Remove 3D object from Parent != 3DObject"); + DBG_ASSERT(dynamic_cast<const E3dObject*>(GetOwnerObj()), "Remove 3D object from Parent != 3DObject"); // call parent SdrObject* pRetval = SdrObjList::NbcRemoveObject(nObjNum); @@ -158,7 +158,7 @@ SdrObject* E3dObjList::NbcRemoveObject(size_t nObjNum) SdrObject* E3dObjList::RemoveObject(size_t nObjNum) { - OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "3D object is removed from non-3D Parent"); + OSL_ENSURE(dynamic_cast<const E3dObject*>(GetOwnerObj()), "3D object is removed from non-3D Parent"); // call parent SdrObject* pRetval = SdrObjList::RemoveObject(nObjNum); @@ -507,7 +507,7 @@ E3dObject* E3dObject::GetParentObj() const if(GetObjList() && GetObjList()->GetOwnerObj() - && GetObjList()->GetOwnerObj()->ISA(E3dObject)) + && dynamic_cast<const E3dObject*>(GetObjList()->GetOwnerObj())) pRetval = static_cast<E3dObject*>(GetObjList()->GetOwnerObj()); return pRetval; } @@ -968,7 +968,7 @@ bool E3dCompoundObject::IsAOrdNumRemapCandidate(E3dScene*& prScene) const { if(GetObjList() && GetObjList()->GetOwnerObj() - && GetObjList()->GetOwnerObj()->ISA(E3dScene)) + && dynamic_cast<const E3dObject*>(GetObjList()->GetOwnerObj())) { prScene = static_cast<E3dScene*>(GetObjList()->GetOwnerObj()); return true; diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index ab36ed2461aa..38bba54bf8ef 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -129,7 +129,7 @@ Imp3DDepthRemapper::Imp3DDepthRemapper(E3dScene& rScene) if(pCandidate) { - if(pCandidate->ISA(E3dCompoundObject)) + if(dynamic_cast< const E3dCompoundObject*>(pCandidate)) { // single 3d object, calc depth const double fMinimalDepth(getMinimalDepthInViewCoordinates(static_cast< const E3dCompoundObject& >(*pCandidate))); @@ -402,7 +402,7 @@ void E3dScene::removeAllNonSelectedObjects() { bool bRemoveObject(false); - if(pObj->ISA(E3dScene)) + if(dynamic_cast< const E3dScene*>(pObj)) { E3dScene* pScene = static_cast<E3dScene*>(pObj); @@ -418,7 +418,7 @@ void E3dScene::removeAllNonSelectedObjects() bRemoveObject = true; } } - else if(pObj->ISA(E3dCompoundObject)) + else if(dynamic_cast< const E3dCompoundObject*>(pObj)) { E3dCompoundObject* pCompound = static_cast<E3dCompoundObject*>(pObj); @@ -666,7 +666,7 @@ bool E3dScene::IsBreakObjPossible() while ( a3DIterator.IsMore() ) { E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next()); - DBG_ASSERT(pObj->ISA(E3dObject), "only 3D objects are allowed in scenes!"); + DBG_ASSERT(dynamic_cast< const E3dObject*>(pObj), "only 3D objects are allowed in scenes!"); if(!pObj->IsBreakObjPossible()) return false; } diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 7e498f706c1a..ec2045604711 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -247,7 +247,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dCompoundObject)) + if(pObj && dynamic_cast< const E3dCompoundObject*>(pObj) != nullptr) { // related scene pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); @@ -255,7 +255,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const bSpecialHandling = true; } // Reset all selection flags - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast< const E3dObject*>(pObj) != nullptr) { pScene = static_cast<E3dObject*>(pObj)->GetScene(); if(pScene) @@ -270,7 +270,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dCompoundObject)) + if(pObj && dynamic_cast< const E3dCompoundObject*>(pObj) != nullptr) { // relatated scene pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); @@ -282,7 +282,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast< const E3dObject*>(pObj) != nullptr) { // Select object E3dObject* p3DObj = static_cast<E3dObject*>(pObj); @@ -305,7 +305,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dCompoundObject)) + if(pObj && dynamic_cast< const E3dCompoundObject*>(pObj) != nullptr) { // related scene pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); @@ -335,7 +335,7 @@ SdrModel* E3dView::GetMarkedObjModel() const { const SdrObject* pObj = GetMarkedObjectByIndex(nObjs); - if(!bSpecialHandling && pObj && pObj->ISA(E3dCompoundObject)) + if(!bSpecialHandling && pObj && dynamic_cast< const E3dCompoundObject*>(pObj) != nullptr) { // if the object is selected, but it's scene not, // we need special handling @@ -347,7 +347,7 @@ SdrModel* E3dView::GetMarkedObjModel() const } } - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast< const E3dObject*>(pObj) != nullptr) { // reset all selection flags at 3D objects pScene = static_cast<const E3dObject*>(pObj)->GetScene(); @@ -374,7 +374,7 @@ SdrModel* E3dView::GetMarkedObjModel() const { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dCompoundObject)) + if(pObj && dynamic_cast< const E3dCompoundObject*>(pObj) != nullptr) { // mark object, but not scenes E3dCompoundObject* p3DObj = static_cast<E3dCompoundObject*>(pObj); @@ -394,7 +394,7 @@ SdrModel* E3dView::GetMarkedObjModel() const { SdrObject *pObj = aOldML.GetMark(nObjs)->GetMarkedSdrObj(); - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast< const E3dObject* >(pObj) != nullptr) { pScene = static_cast<E3dObject*>(pObj)->GetScene(); @@ -420,7 +420,7 @@ SdrModel* E3dView::GetMarkedObjModel() const { const SdrObject* pSrcOb=pSrcPg->GetObj(nOb); - if(pSrcOb->ISA(E3dScene)) + if(dynamic_cast< const E3dScene* >( pSrcOb) != nullptr) { pScene = const_cast<E3dScene*>(static_cast<const E3dScene*>(pSrcOb)); @@ -460,7 +460,7 @@ bool E3dView::Paste( // Get owner of the list SdrObject* pOwner = pDstList->GetOwnerObj(); - if(pOwner && pOwner->ISA(E3dScene)) + if(pOwner && dynamic_cast< const E3dScene* >(pOwner) != nullptr) { E3dScene* pDstScene = static_cast<E3dScene*>(pOwner); BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXCHANGE_PASTE)); @@ -479,7 +479,7 @@ bool E3dView::Paste( for(size_t nOb = 0; nOb < nObjCount; ++nOb) { const SdrObject* pSrcOb = pSrcPg->GetObj(nOb); - if(pSrcOb->ISA(E3dScene)) + if(dynamic_cast< const E3dScene* >(pSrcOb) != nullptr) { E3dScene* pSrcScene = const_cast<E3dScene*>(static_cast<const E3dScene*>(pSrcOb)); ImpCloneAll3DObjectsToDestScene(pSrcScene, pDstScene, aDist); @@ -635,7 +635,7 @@ void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D, { if(pObj) { - if(pObj->ISA(E3dObject)) + if(dynamic_cast< const E3dObject* >(pObj) != nullptr) { rAny3D = true; } @@ -659,7 +659,7 @@ void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D, void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj) { - if(pObj->ISA(SdrTextObj)) + if(dynamic_cast<const SdrTextObj*>( pObj) != nullptr) { const SfxItemSet& rSet = pObj->GetMergedItemSet(); const SvxColorItem& rTextColorItem = static_cast<const SvxColorItem&>(rSet.Get(EE_CHAR_COLOR)); @@ -684,7 +684,7 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj) void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj) { - if(pObj->ISA(SdrPathObj)) + if(dynamic_cast<const SdrPathObj*>( pObj) != nullptr) { const SfxItemSet& rSet = pObj->GetMergedItemSet(); sal_Int32 nLineWidth = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue(); @@ -707,7 +707,7 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj) void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat) { // Single PathObject, transform this - SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj); + SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pObj ); if(pPath) { @@ -1225,9 +1225,9 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj) { - if(pObj->ISA(E3dScene) && static_cast<E3dScene*>(pObj)->GetScene() == pObj) + if(dynamic_cast< const E3dScene*>(pObj) != nullptr && static_cast<E3dScene*>(pObj)->GetScene() == pObj) bThereAreRootScenes = true; - if(pObj->ISA(E3dObject)) + if(dynamic_cast< const E3dObject* >(pObj) != nullptr) bThereAre3DObjects = true; } } @@ -1553,7 +1553,7 @@ bool E3dView::IsBreak3DObjPossible() const { SdrObject* pObj = GetMarkedObjectByIndex(i); - if (pObj && pObj->ISA(E3dObject)) + if (pObj && dynamic_cast< const E3dObject* >(pObj) != nullptr) { if(!(static_cast<E3dObject*>(pObj)->IsBreakObjPossible())) return false; @@ -1592,7 +1592,7 @@ void E3dView::Break3DObj() void E3dView::BreakSingle3DObj(E3dObject* pObj) { - if(pObj->ISA(E3dScene)) + if(dynamic_cast< const E3dScene* >(pObj) != nullptr) { SdrObjList* pSubList = pObj->GetSubList(); SdrObjListIter aIter(*pSubList, IM_FLAT); @@ -1629,9 +1629,9 @@ void E3dView::CheckPossibilities() for(size_t nObjs = 0; (nObjs < nMarkCnt) && !bCoumpound; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); - if(pObj && pObj->ISA(E3dCompoundObject)) + if(pObj && dynamic_cast< const E3dCompoundObject* >(pObj) != nullptr) bCoumpound = true; - if(pObj && pObj->ISA(E3dObject)) + if(pObj && dynamic_cast< const E3dObject* >(pObj) != nullptr) b3DObject = true; } diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 62ce42a3b03f..6cd62af4d7a0 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -50,7 +50,7 @@ void E3dView::ConvertMarkedToPolyObj(bool bLineToArea) { SdrObject* pObj = GetMarkedObjectByIndex(0); - if (pObj && pObj->ISA(E3dPolyScene)) + if (pObj && dynamic_cast< const E3dPolyScene* >(pObj) != nullptr) { bool bBezier = false; pNewObj = static_cast<E3dPolyScene*>(pObj)->ConvertToPolyObj(bBezier, bLineToArea); @@ -72,19 +72,19 @@ void E3dView::ConvertMarkedToPolyObj(bool bLineToArea) void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask) { - if(pObj->ISA(E3dLatheObj)) + if(dynamic_cast< const E3dLatheObj* >(pObj) != nullptr) { rMask |= 0x0001; } - else if(pObj->ISA(E3dExtrudeObj)) + else if(dynamic_cast< const E3dExtrudeObj* >(pObj) != nullptr) { rMask |= 0x0002; } - else if(pObj->ISA(E3dSphereObj)) + else if(dynamic_cast< const E3dSphereObj* >(pObj) != nullptr) { rMask |= 0x0004; } - else if(pObj->ISA(E3dCubeObj)) + else if(dynamic_cast< const E3dCubeObj* >(pObj) != nullptr) { rMask |= 0x0008; } |