Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Just some cleanup of tools/rtti.hxx macros for c++ RTTI. Theres a bunch of
patchs but they are very straightfoward.
In the future can i push the patch myself or should i continue sending them
to the ml for review??

Thanks
From cde1ced48a7124a8b074538da5bdc92033367d8f Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sun, 11 Dec 2011 14:34:27 -0430
Subject: [PATCH 02/36] Replace HAS_BASE macro for dynamic_cast.

---
 svx/source/sdr/properties/attributeproperties.cxx |    6 +-
 svx/source/sdr/properties/textproperties.cxx      |    4 +-
 svx/source/svdraw/svdcrtv.cxx                     |    2 +-
 svx/source/svdraw/svddrgv.cxx                     |    2 +-
 svx/source/svdraw/svdedtv.cxx                     |   14 +++---
 svx/source/svdraw/svdfmtf.cxx                     |    2 +-
 svx/source/svdraw/svdibrow.cxx                    |   43 +++++++++++----------
 svx/source/svdraw/svdoedge.cxx                    |    2 +-
 svx/source/svdraw/svdotxat.cxx                    |    8 ++--
 svx/source/svdraw/svdotxdr.cxx                    |   18 ++++++---
 sw/source/core/txtnode/ndtxt.cxx                  |    2 +-
 11 files changed, 55 insertions(+), 48 deletions(-)

diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 825fee2..db2bd8e 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -101,7 +101,7 @@ namespace sdr
         void AttributeProperties::ImpRemoveStyleSheet()
         {
             // Check type since it is destroyed when the type is deleted
-            if(GetStyleSheet() && HAS_BASE(SfxStyleSheet, mpStyleSheet))
+            if(GetStyleSheet())
             {
                 EndListening(*mpStyleSheet);
                 EndListening(mpStyleSheet->GetPool());
@@ -487,7 +487,7 @@ namespace sdr
 
         void AttributeProperties::ForceStyleToHardAttributes()
         {
-            if(GetStyleSheet() && HAS_BASE(SfxStyleSheet, mpStyleSheet))
+            if(GetStyleSheet())
             {
                 // prepare copied, new itemset, but WITHOUT parent
                 GetObjectItemSet();
@@ -566,7 +566,7 @@ namespace sdr
                         // to register as listener to that new StyleSheet.
                         if(pModel && !rObj.IsInDestruction())
                         {
-                            if(HAS_BASE(SfxStyleSheet, GetStyleSheet()))
+                            if(GetStyleSheet())
                             {
                                 pNewStSh = (SfxStyleSheet*)pModel->GetStyleSheetPool()->Find(
                                     GetStyleSheet()->GetParent(), GetStyleSheet()->GetFamily());
diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index 92a15a4..8661459 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -558,7 +558,7 @@ namespace sdr
             SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
             if(rObj.HasText())
             {
-                if(HAS_BASE(SfxStyleSheet, &rBC))
+                if(dynamic_cast<SfxStyleSheet*>(&rBC))
                 {
                     SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
                     sal_uInt32 nId(pSimple ? pSimple->GetId() : 0L);
@@ -599,7 +599,7 @@ namespace sdr
                         }
                     }
                 }
-                else if(HAS_BASE(SfxStyleSheetBasePool, &rBC))
+                else if(dynamic_cast<SfxStyleSheetBasePool*>(&rBC))
                 {
                     SfxStyleSheetHintExtended* pExtendedHint = PTR_CAST(SfxStyleSheetHintExtended, 
&rHint);
 
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index ffb3185..6fa0db2 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -465,7 +465,7 @@ sal_Bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, c
                     pAktCreate->SetMergedItemSet(aDefaultAttr);
                 }
 
-                if (HAS_BASE(SdrCaptionObj,pAktCreate))
+                if (dynamic_cast<SdrCaptionObj*>(pAktCreate))
                 {
                     SfxItemSet aSet(pMod->GetItemPool());
                     aSet.Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid 
umschaltet
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index a028d58..62a80db 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -746,7 +746,7 @@ sal_Bool SdrDragView::IsInsGluePointPossible() const
         {
             // return sal_False, if only 1 object which is a connector.
             const SdrObject* pObj=GetMarkedObjectByIndex(0);
-            if (!HAS_BASE(SdrEdgeObj,pObj))
+            if (!dynamic_cast<const SdrEdgeObj*>(pObj))
             {
                bRet=sal_True;
             }
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index dfdf7ef..5ad800d 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -619,18 +619,18 @@ void SdrEditView::CheckPossibilities()
                 // check ImportMtf
 
                 if (!bImportMtfPossible) {
-                    sal_Bool bGraf=HAS_BASE(SdrGrafObj,pObj);
-                    sal_Bool bOle2=HAS_BASE(SdrOle2Obj,pObj);
+                    const SdrGrafObj* pGraf = dynamic_cast<const SdrGrafObj*>(pObj);
+                    const SdrOle2Obj* pOle2 = dynamic_cast<const SdrOle2Obj*>(pObj);
 
-                    if( bGraf &&
-                        ((SdrGrafObj*)pObj)->HasGDIMetaFile() &&
-                        !( ((SdrGrafObj*)pObj)->IsEPS() || ((SdrGrafObj*)pObj)->IsRenderGraphic() 
) )
+                    if( pGraf &&
+                        pGraf->HasGDIMetaFile() &&
+                        !( pGraf->IsEPS() || pGraf->IsRenderGraphic() ) )
                     {
                         bImportMtfPossible = sal_True;
                     }
 
-                    if (bOle2)
-                        bImportMtfPossible=((SdrOle2Obj*)pObj)->GetObjRef().is();
+                    if (pOle2)
+                        bImportMtfPossible = pOle2->GetObjRef().is();
                 }
             }
 
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 0de996f..8fe9f18 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -428,7 +428,7 @@ void ImpSdrGDIMetaFileImport::InsertObj( SdrObject* pObj, sal_Bool bScale )
     else
     {
         aTmpList.InsertObject( pObj );
-        if ( HAS_BASE( SdrPathObj, pObj ) )
+        if ( dynamic_cast<SdrPathObj*>(pObj) )
         {
             bool bClosed=pObj->IsClosedObj();
             bLastObjWasPolyWithoutLine=bNoLine && bClosed;
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 7557d6c..6a4ea7c 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -945,7 +945,7 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
             if (eState!=SFX_ITEM_DISABLED) {
                 const SfxPoolItem& rItem=pSet->Get(nWhich);
                 sal_uInt16 nIndent=0;
-                if (!HAS_BASE(SfxVoidItem,&rItem) && !HAS_BASE(SfxSetItem,&rItem) && 
(!IsItemIneffective(nWhich,pSet,nIndent) || bDontHideIneffectiveItems)) {
+                if (!dynamic_cast<const SfxVoidItem*>(&rItem) && !dynamic_cast<const 
SfxSetItem*>(&rItem) && (!IsItemIneffective(nWhich,pSet,nIndent) || bDontHideIneffectiveItems)) {
                     XubString aCommentStr;
 
                     INSERTCOMMENT(XATTR_LINE_FIRST,XATTR_LINE_LAST,String("L I N I E", 
aTextEncoding));
@@ -991,25 +991,26 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const 
SfxItem
                         aEntry.nMax=0x7FFFFFFF;
                         aEntry.nMin=-aEntry.nMax;
                         aEntry.nVal=-4711;
-                        if      (HAS_BASE(SfxByteItem     ,&rItem)) aEntry.eItemType=ITEM_BYTE;
-                        else if (HAS_BASE(SfxInt16Item    ,&rItem)) aEntry.eItemType=ITEM_INT16;
-                        else if (HAS_BASE(SfxUInt16Item   ,&rItem)) aEntry.eItemType=ITEM_UINT16;
-                        else if (HAS_BASE(SfxInt32Item    ,&rItem)) aEntry.eItemType=ITEM_INT32;
-                        else if (HAS_BASE(SfxUInt32Item   ,&rItem)) aEntry.eItemType=ITEM_UINT32;
-                        else if (HAS_BASE(SfxEnumItemInterface,&rItem)) aEntry.eItemType=ITEM_ENUM;
-                        else if (HAS_BASE(SfxBoolItem     ,&rItem)) aEntry.eItemType=ITEM_BOOL;
-                        else if (HAS_BASE(SfxFlagItem     ,&rItem)) aEntry.eItemType=ITEM_FLAG;
-                        else if (HAS_BASE(XColorItem      ,&rItem)) aEntry.eItemType=ITEM_XCOLOR;
-                        else if (HAS_BASE(SfxStringItem   ,&rItem)) aEntry.eItemType=ITEM_STRING;
-                        else if (HAS_BASE(SfxPointItem    ,&rItem)) aEntry.eItemType=ITEM_POINT;
-                        else if (HAS_BASE(SfxRectangleItem,&rItem)) aEntry.eItemType=ITEM_RECT;
-                        else if (HAS_BASE(SfxRangeItem    ,&rItem)) aEntry.eItemType=ITEM_RANGE;
-                        else if (HAS_BASE(SdrFractionItem ,&rItem)) aEntry.eItemType=ITEM_FRACTION;
-                        else if (HAS_BASE(SvxColorItem    ,&rItem)) aEntry.eItemType=ITEM_COLOR;
-                        else if (HAS_BASE(SvxFontItem     ,&rItem)) aEntry.eItemType=ITEM_FONT;
-                        else if 
(HAS_BASE(SvxFontHeightItem,&rItem))aEntry.eItemType=ITEM_FONTHEIGHT;
-                        else if (HAS_BASE(SvxCharScaleWidthItem,&rItem)) 
aEntry.eItemType=ITEM_FONTWIDTH;
-                        else if (HAS_BASE(SvxFieldItem    ,&rItem)) aEntry.eItemType=ITEM_FIELD;
+
+                        if      (dynamic_cast<const SfxByteItem*>(&rItem)) 
aEntry.eItemType=ITEM_BYTE;
+                        else if (dynamic_cast<const SfxInt16Item*>(&rItem)) 
aEntry.eItemType=ITEM_INT16;
+                        else if (dynamic_cast<const SfxUInt16Item*>(&rItem)) 
aEntry.eItemType=ITEM_UINT16;
+                        else if (dynamic_cast<const SfxInt32Item*>(&rItem)) 
aEntry.eItemType=ITEM_INT32;
+                        else if (dynamic_cast<const SfxUInt32Item*>(&rItem)) 
aEntry.eItemType=ITEM_UINT32;
+                        else if (dynamic_cast<const SfxEnumItemInterface*>(&rItem)) 
aEntry.eItemType=ITEM_ENUM;
+                        else if (dynamic_cast<const SfxBoolItem*>(&rItem)) 
aEntry.eItemType=ITEM_BOOL;
+                        else if (dynamic_cast<const SfxFlagItem*>(&rItem)) 
aEntry.eItemType=ITEM_FLAG;
+                        else if (dynamic_cast<const XColorItem*>(&rItem)) 
aEntry.eItemType=ITEM_XCOLOR;
+                        else if (dynamic_cast<const SfxStringItem*>(&rItem)) 
aEntry.eItemType=ITEM_STRING;
+                        else if (dynamic_cast<const SfxPointItem*>(&rItem)) 
aEntry.eItemType=ITEM_POINT;
+                        else if (dynamic_cast<const SfxRectangleItem*>(&rItem)) 
aEntry.eItemType=ITEM_RECT;
+                        else if (dynamic_cast<const SfxRangeItem*>(&rItem)) 
aEntry.eItemType=ITEM_RANGE;
+                        else if (dynamic_cast<const SdrFractionItem*>(&rItem)) 
aEntry.eItemType=ITEM_FRACTION;
+                        else if (dynamic_cast<const SvxColorItem*>(&rItem)) 
aEntry.eItemType=ITEM_COLOR;
+                        else if (dynamic_cast<const SvxFontItem*>(&rItem)) 
aEntry.eItemType=ITEM_FONT;
+                        else if (dynamic_cast<const 
SvxFontHeightItem*>(&rItem))aEntry.eItemType=ITEM_FONTHEIGHT;
+                        else if (dynamic_cast<const SvxCharScaleWidthItem*>(&rItem)) 
aEntry.eItemType=ITEM_FONTWIDTH;
+                        else if (dynamic_cast<const SvxFieldItem*>(&rItem)) 
aEntry.eItemType=ITEM_FIELD;
                         switch (aEntry.eItemType) {
                             case ITEM_BYTE      : aEntry.bIsNum = true;  aEntry.nVal=((SfxByteItem 
 &)rItem).GetValue(); aEntry.nMin=0;      aEntry.nMax=255;   break;
                             case ITEM_INT16     : aEntry.bIsNum = true;  
aEntry.nVal=((SfxInt16Item &)rItem).GetValue(); aEntry.nMin=-32767; aEntry.nMax=32767; break;
@@ -1211,7 +1212,7 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
                 case ITEM_INT16 : ((SfxInt16Item *)pNewItem)->SetValue((sal_Int16 )nLongVal); 
break;
                 case ITEM_UINT16: ((SfxUInt16Item*)pNewItem)->SetValue((sal_uInt16)nLongVal); 
break;
                 case ITEM_INT32: {
-                    if(HAS_BASE(SdrAngleItem, pNewItem))
+                    if(dynamic_cast<SdrAngleItem*>(pNewItem))
                     {
                         aNewText.SearchAndReplace(sal_Unicode(','), sal_Unicode('.'));
                         double nVal = aNewText.ToFloat();
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 1e47375..988b2c6 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -2119,7 +2119,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, 
SdrO
             Rectangle aObjBound(pObj->GetCurrentBoundRect());
             if (aObjBound.IsOver(aMouseRect)) {
                 aTestCon.ResetVars();
-                bool bEdge=HAS_BASE(SdrEdgeObj,pObj); // no BestCon for Edge
+                bool bEdge=dynamic_cast<SdrEdgeObj*>(pObj); // no BestCon for Edge
                 // User-defined connectors have absolute priority.
                 // After those come Vertex, Corner and center (Best), all prioritized equally.
                 // Finally, a HitTest for the object.
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index e26cadf..92653f5 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -199,10 +199,10 @@ bool SdrTextObj::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
     bool bRet=AdjustTextFrameWidthAndHeight(aRect,bHgt,bWdt);
     if (bRet) {
         SetRectsDirty();
-        if (HAS_BASE(SdrRectObj,this)) { // mal wieder 'nen Hack
+        if (dynamic_cast<SdrRectObj*>(this)) { // mal wieder 'nen Hack
             ((SdrRectObj*)this)->SetXPolyDirty();
         }
-        if (HAS_BASE(SdrCaptionObj,this)) { // mal wieder 'nen Hack
+        if (dynamic_cast<SdrCaptionObj*>(this)) { // mal wieder 'nen Hack
             ((SdrCaptionObj*)this)->ImpRecalcTail();
         }
     }
@@ -217,10 +217,10 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
         Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
         aRect=aNeuRect;
         SetRectsDirty();
-        if (HAS_BASE(SdrRectObj,this)) { // mal wieder 'nen Hack
+        if (dynamic_cast<SdrRectObj*>(this)) { // mal wieder 'nen Hack
             ((SdrRectObj*)this)->SetXPolyDirty();
         }
-        if (HAS_BASE(SdrCaptionObj,this)) { // mal wieder 'nen Hack
+        if (dynamic_cast<SdrCaptionObj*>(this)) { // mal wieder 'nen Hack
             ((SdrCaptionObj*)this)->ImpRecalcTail();
         }
         SetChanged();
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index 307c916..740ffe9 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -209,9 +209,12 @@ bool SdrTextObj::MovCreate(SdrDragStat& rStat)
     aRect=aRect1; // fuer ObjName
     SetBoundRectDirty();
     bSnapRectDirty=sal_True;
-    if (HAS_BASE(SdrRectObj,this)) {
-        ((SdrRectObj*)this)->SetXPolyDirty();
-    }
+
+    SdrRectObj *pRect = dynamic_cast<SdrRectObj*>(this);
+
+    if (pRect)
+        pRect->SetXPolyDirty();
+
     return true;
 }
 
@@ -236,9 +239,12 @@ bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
         NbcAdjustTextFrameWidthAndHeight();
     }
     SetRectsDirty();
-    if (HAS_BASE(SdrRectObj,this)) {
-        ((SdrRectObj*)this)->SetXPolyDirty();
-    }
+
+    SdrRectObj *pRect = dynamic_cast<SdrRectObj*>(this);
+
+    if (pRect)
+        pRect->SetXPolyDirty();
+
     return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
 }
 
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 46f9c24..7776bb5 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3490,7 +3490,7 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* 
pNewVal
 SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
 {
     OSL_ENSURE( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
-    OSL_ENSURE( HAS_BASE( SwTxtFmtColl, pNewColl ),
+    OSL_ENSURE( dynamic_cast<SwTxtFmtColl*>(pNewColl),
                 "ChgFmtColl: ist kein Text-Collectionpointer." );
 
     SwTxtFmtColl *pOldColl = GetTxtColl();
-- 
1.7.3.4

From b4287936097ec67ebcf90f8c838b1882d96ec76c Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sun, 11 Dec 2011 14:47:24 -0430
Subject: [PATCH 03/36] Replace PTR_CAST macro with dynamic_cast.

---
 svl/source/items/sfontitm.cxx  |    2 +-
 tools/inc/tools/pstm.hxx       |    2 +-
 tools/source/inet/inetstrm.cxx |    6 +++---
 tools/source/ref/errinf.cxx    |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx
index 0013671..e9b8d54 100644
--- a/svl/source/items/sfontitm.cxx
+++ b/svl/source/items/sfontitm.cxx
@@ -42,7 +42,7 @@ TYPEINIT1(SfxFontItem, SfxPoolItem);
 // virtual
 int SfxFontItem::operator ==(const SfxPoolItem & rItem) const
 {
-    const SfxFontItem * pFontItem = PTR_CAST(SfxFontItem, &rItem);
+    const SfxFontItem * pFontItem = dynamic_cast<const SfxFontItem*>(&rItem);
     return pFontItem && m_bHasFont == pFontItem->m_bHasFont
            && m_bHasColor == pFontItem->m_bHasColor
            && m_bHasFillColor == pFontItem->m_bHasFillColor
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 68b4932..dd1cb10 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -92,7 +92,7 @@ SV_DECL_IMPL_REF(SvRttiBase)
                     {                                               \
                         SvPersistBase * pObj;                       \
                         rStm >> pObj;                               \
-                        rpObj = PTR_CAST( Class, pObj );            \
+                        rpObj = dynamic_cast<Class*>(pObj);            \
                         return rStm;                                \
                     }
 
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index d70d84d..c354927 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -373,7 +373,7 @@ INetMessageOStream::~INetMessageOStream (void)
     if (pTargetMsg)
     {
         SvOpenLockBytes *pLB =
-            PTR_CAST (SvOpenLockBytes, pTargetMsg->GetDocumentLB());
+            dynamic_cast<SvOpenLockBytes*>(pTargetMsg->GetDocumentLB());
         if (pLB)
         {
             pLB->Flush();
@@ -829,7 +829,7 @@ int INetMessageDecodeQPStream_Impl::PutMsgLine (
     INetMessage *pMsg = GetTargetMessage();
     if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
 
-    SvOpenLockBytes * pLB = PTR_CAST(SvOpenLockBytes, pMsg->GetDocumentLB());
+    SvOpenLockBytes * pLB = dynamic_cast<SvOpenLockBytes*>(pMsg->GetDocumentLB());
     if (pLB == NULL) return INETSTREAM_STATUS_WOULDBLOCK;
 
     const sal_Char *pStop = pData + nSize;
@@ -1159,7 +1159,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine (
     INetMessage *pMsg = GetTargetMessage ();
     if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
 
-    SvOpenLockBytes * pLB = PTR_CAST(SvOpenLockBytes, pMsg->GetDocumentLB());
+    SvOpenLockBytes * pLB = dynamic_cast<SvOpenLockBytes*>(pMsg->GetDocumentLB());
     if (pLB == NULL) return INETSTREAM_STATUS_WOULDBLOCK;
 
     const sal_Char *pStop = (pData + nSize);
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 9ee3512..c4d7f00 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -313,7 +313,7 @@ sal_uInt16 ErrorHandler::HandleError_Impl(
     else
         nErrFlags |= ERRCODE_MSG_ERROR;
 
-    DynamicErrorInfo* pDynPtr=PTR_CAST(DynamicErrorInfo,pInfo);
+    DynamicErrorInfo* pDynPtr=dynamic_cast<DynamicErrorInfo*>(pInfo);
     if(pDynPtr)
     {
         sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
@@ -428,7 +428,7 @@ sal_Bool SimpleErrorHandler::CreateString(
     aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorArea: "));
     aStr.append(static_cast<sal_Int32>((nId & ERRCODE_ERROR_MASK &
             ~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT));
-    DynamicErrorInfo *pDyn=PTR_CAST(DynamicErrorInfo,pInfo);
+    const DynamicErrorInfo *pDyn=dynamic_cast<const DynamicErrorInfo*>(pInfo);
     if(pDyn)
     {
         aStr.append(RTL_CONSTASCII_STRINGPARAM("\nDId "));
-- 
1.7.3.4

From 7d814b11e438f1251608849f33c04b073d41220f Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Mon, 12 Dec 2011 09:47:09 -0430
Subject: [PATCH 04/36] Remove usage of deprecated tools/rtti.

Replace for C++ RTTI and fixup use in the rest of the code.
---
 svtools/source/misc/ehdl.cxx |    9 +++++----
 tools/inc/tools/errinf.hxx   |    6 ------
 tools/source/ref/errinf.cxx  |    7 -------
 3 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 950cdcc..4c91b2e 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -188,7 +188,7 @@ sal_Bool SfxErrorHandler::CreateString(
     sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
     if( nErrCode>=lEnd || nErrCode<=lStart )
         return sal_False;
-    MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr);
+    const MessageInfo *pMsgInfo=dynamic_cast<const MessageInfo*>(pErr);
     if(pMsgInfo)
     {
         if(GetMessageString(nErrCode, rStr, nFlags))
@@ -206,7 +206,7 @@ sal_Bool SfxErrorHandler::CreateString(
     }
     else if(GetErrorString(nErrCode, rStr, nFlags))
     {
-        StringErrorInfo *pStringInfo=PTR_CAST(StringErrorInfo,pErr);
+        const StringErrorInfo *pStringInfo=dynamic_cast<const StringErrorInfo*>(pErr);
         if(pStringInfo)
             for (xub_StrLen i = 0; i < rStr.Len();)
             {
@@ -218,8 +218,9 @@ sal_Bool SfxErrorHandler::CreateString(
             }
         else
         {
-            TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo,
-                                                           pErr);
+            const TwoStringErrorInfo * pTwoStringInfo =
+                dynamic_cast<const TwoStringErrorInfo*>(pErr);
+
             if (pTwoStringInfo)
                 for (sal_uInt16 i = 0; i < rStr.Len();)
                 {
diff --git a/tools/inc/tools/errinf.hxx b/tools/inc/tools/errinf.hxx
index 951fcfe..70bf5b6 100644
--- a/tools/inc/tools/errinf.hxx
+++ b/tools/inc/tools/errinf.hxx
@@ -32,7 +32,6 @@
 #define _EINF_HXX
 
 #include <limits.h>
-#include <tools/rtti.hxx>
 #include <tools/errcode.hxx>
 #include <tools/string.hxx>
 #include "tools/toolsdllapi.h"
@@ -51,7 +50,6 @@ private:
     sal_uIntPtr                   lUserId;
 
 public:
-                            TYPEINFO();
 
                             ErrorInfo( sal_uIntPtr lArgUserId ) :
                                 lUserId( lArgUserId ){}
@@ -75,7 +73,6 @@ private:
     EDcr_Impl*              pImpl;
 
 public:
-                            TYPEINFO();
 
                             DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
     virtual                 ~DynamicErrorInfo();
@@ -95,7 +92,6 @@ private:
     String                  aString;
 
 public:
-                            TYPEINFO();
 
                             StringErrorInfo( sal_uIntPtr lUserId,
                                             const String& aStringP,
@@ -111,7 +107,6 @@ private:
     String aArg2;
 
 public:
-    TYPEINFO();
 
     TwoStringErrorInfo(sal_uIntPtr nUserID, const String & rTheArg1,
                        const String & rTheArg2, sal_uInt16 nFlags = 0):
@@ -130,7 +125,6 @@ class TOOLS_DLLPUBLIC MessageInfo : public DynamicErrorInfo
 {
   public:
 
-                            TYPEINFO();
                             MessageInfo(sal_uIntPtr UserId, sal_uInt16 nFlags = 0) :
                                 DynamicErrorInfo(UserId, nFlags){}
                             MessageInfo(sal_uIntPtr UserId, const String &rArg,
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index c4d7f00..b453463 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -134,13 +134,6 @@ void EDcr_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr)
         ppDcr[lIdx]=0;
 }
 
-TYPEINIT0(ErrorInfo);
-TYPEINIT1(DynamicErrorInfo, ErrorInfo);
-TYPEINIT1(StringErrorInfo, DynamicErrorInfo);
-TYPEINIT1(TwoStringErrorInfo, DynamicErrorInfo);
-TYPEINIT1(MessageInfo, DynamicErrorInfo);
-
-
 ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
 {
     if(lId & ERRCODE_DYNAMIC_MASK)
-- 
1.7.3.4

From f3fc43f981100de1692af9f2701b9b98a92e2ed3 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Fri, 16 Dec 2011 14:00:13 -0430
Subject: [PATCH 05/36] Refactor item_cast template to use c++ RTTI instead of tools/rtti.hxx.

Also remove deprecated STATICTYPE macro.
---
 sw/source/filter/ww8/writerhelper.hxx |    8 ++------
 tools/inc/tools/rtti.hxx              |    6 ------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index 2f16b06..7c80290 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -238,9 +238,7 @@ namespace sw
         template<class T> const T & item_cast(const SfxPoolItem &rItem)
             throw(std::bad_cast)
         {
-            if (!rItem.IsA(STATICTYPE(T)))
-                throw std::bad_cast();
-            return static_cast<const T &>(rItem);
+            return dynamic_cast<const T &>(rItem);
         }
 
         /** Provide a dynamic_cast style cast for SfxPoolItems
@@ -263,9 +261,7 @@ namespace sw
         */
         template<class T> const T * item_cast(const SfxPoolItem *pItem)
         {
-            if (pItem && !pItem->IsA(STATICTYPE(T)))
-                pItem = 0;
-            return static_cast<const T *>(pItem);
+            return dynamic_cast<const T *>(pItem);
         }
 
         /** Extract a SfxPoolItem derived property from a SwCntntNode
diff --git a/tools/inc/tools/rtti.hxx b/tools/inc/tools/rtti.hxx
index 7f279f1..91a0440 100644
--- a/tools/inc/tools/rtti.hxx
+++ b/tools/inc/tools/rtti.hxx
@@ -59,12 +59,8 @@ typedef void* (*TypeId)();
             if ( aSameOrSuperType == StaticType() ) \
                 return sal_True
 
-#define STATICTYPE(sType) (sType::StaticType())
-
 //-------------------------------------------------------------------------
 
-#define TYPEINIT(sType) TYPEINIT_FACTORY(sType, 0)
-
 #define SUPERTYPE(sSuper) \
             if ( sSuper::IsOf(aSameOrSuperType ) ) \
                 return sal_True
@@ -111,8 +107,6 @@ typedef void* (*TypeId)();
 
 #define TYPE(sType) (sType::StaticType())
 #define ISA(sType) IsA(sType::StaticType())
-#define ISOF(sType) IsOf(sType::StaticType())
-#define CREATE(TypeId) (TypeId())
 
 //-------------------------------------------------------------------------
 // On-Demand-faehige persistent-TypeId Version
-- 
1.7.3.4

From 52e35fe0df316aa7930efb63e05fb62406f37c69 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Fri, 16 Dec 2011 14:22:29 -0430
Subject: [PATCH 06/36] Replace deprecated macro ISA.

---
 sd/source/ui/dlg/SpellDialogChildWindow.cxx |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx 
b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
index 0d984d5..b9c4193 100644
--- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx
+++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
@@ -168,8 +168,8 @@ void SpellDialogChildWindow::ProvideOutliner (void)
         // 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<DrawViewShell*>(pViewShell) != NULL && ! mbOwnOutliner)
+                || (dynamic_cast<OutlineViewShell*>(pViewShell) != NULL && mbOwnOutliner))
             {
                 mpSdOutliner->EndSpelling();
                 if (mbOwnOutliner)
@@ -180,7 +180,7 @@ void SpellDialogChildWindow::ProvideOutliner (void)
         // Now create/get an outliner if none is present.
         if (mpSdOutliner == NULL)
         {
-            if (pViewShell->ISA(DrawViewShell))
+            if (dynamic_cast<DrawViewShell*>(pViewShell) != NULL)
             {
                 // We need an outliner for the spell check so we have
                 // to create one.
@@ -189,7 +189,7 @@ void SpellDialogChildWindow::ProvideOutliner (void)
                     pViewShell->GetDoc(),
                     OUTLINERMODE_TEXTOBJECT);
             }
-            else if (pViewShell->ISA(OutlineViewShell))
+            else if (dynamic_cast<OutlineViewShell*>(pViewShell) != NULL)
             {
                 // An outline view is already visible. The SdOutliner
                 // will use it instead of creating its own.
-- 
1.7.3.4

From 3aaf550f7d2cc349377397a5359f531f3b250443 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Fri, 16 Dec 2011 18:58:38 -0430
Subject: [PATCH 07/36] Replace deprecated ISA macro for dynamic_cast.

---
 sd/source/ui/dlg/dlgfield.cxx        |   24 ++++++++++++------------
 sd/source/ui/dlg/docprev.cxx         |    4 +++-
 sd/source/ui/dlg/headerfooterdlg.cxx |    2 +-
 sd/source/ui/dlg/sdtreelb.cxx        |    6 ++++--
 4 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 5e32d63..2a8167e 100644
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -95,7 +95,7 @@ SvxFieldData* SdModifyFieldDlg::GetField()
         aRbtVar.IsChecked() != aRbtVar.GetSavedValue() ||
         aLbFormat.GetSelectEntryPos() != aLbFormat.GetSavedValue() )
     {
-        if( pField->ISA( SvxDateField ) )
+        if( dynamic_cast<const SvxDateField*>(pField) != NULL )
         {
             const SvxDateField* pDateField = (const SvxDateField*) pField;
             SvxDateType   eType;
@@ -112,7 +112,7 @@ SvxFieldData* SdModifyFieldDlg::GetField()
             ( (SvxDateField*) pNewField )->SetType( eType );
             ( (SvxDateField*) pNewField )->SetFormat( eFormat );
         }
-        else if( pField->ISA( SvxExtTimeField ) )
+        else if( dynamic_cast<const SvxExtTimeField*>(pField) != NULL )
         {
             const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
             SvxTimeType   eType;
@@ -129,7 +129,7 @@ SvxFieldData* SdModifyFieldDlg::GetField()
             ( (SvxExtTimeField*) pNewField )->SetType( eType );
             ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat );
         }
-        else if( pField->ISA( SvxExtFileField ) )
+        else if( dynamic_cast<const SvxExtFileField*>(pField) != NULL )
         {
             const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
             SvxFileType   eType;
@@ -159,7 +159,7 @@ SvxFieldData* SdModifyFieldDlg::GetField()
                 ( (SvxExtFileField*) pNewField )->SetFormat( eFormat );
             }
         }
-        else if( pField->ISA( SvxAuthorField ) )
+        else if( dynamic_cast<const SvxAuthorField*>(pField) != NULL )
         {
             SvxAuthorType   eType;
             SvxAuthorFormat eFormat;
@@ -188,7 +188,7 @@ void SdModifyFieldDlg::FillFormatList()
 
     aLbFormat.Clear();
 
-    if( pField->ISA( SvxDateField ) )
+    if( dynamic_cast<const SvxDateField*>(pField) != NULL )
     {
         const SvxDateField* pDateField = (const SvxDateField*) pField;
         SvxDateField aDateField( *pDateField );
@@ -214,7 +214,7 @@ void SdModifyFieldDlg::FillFormatList()
 
         aLbFormat.SelectEntryPos( (sal_uInt16) ( pDateField->GetFormat() - 2 ) );
     }
-    else if( pField->ISA( SvxExtTimeField ) )
+    else if( dynamic_cast<const SvxExtTimeField*>(pField) != NULL )
     {
         const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
         SvxExtTimeField aTimeField( *pTimeField );
@@ -242,7 +242,7 @@ void SdModifyFieldDlg::FillFormatList()
 
         aLbFormat.SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) );
     }
-    else if( pField->ISA( SvxExtFileField ) )
+    else if( dynamic_cast<const SvxExtFileField*>(pField) != NULL )
     {
         const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
         SvxExtFileField aFileField( *pFileField );
@@ -254,7 +254,7 @@ void SdModifyFieldDlg::FillFormatList()
 
         aLbFormat.SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) );
     }
-    else if( pField->ISA( SvxAuthorField ) )
+    else if( dynamic_cast<const SvxAuthorField*>(pField) != NULL )
     {
         const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
         SvxAuthorField aAuthorField( *pAuthorField );
@@ -276,7 +276,7 @@ void SdModifyFieldDlg::FillControls()
 {
     aLbFormat.Clear();
 
-    if( pField->ISA( SvxDateField ) )
+    if( dynamic_cast<const SvxDateField*>(pField) != NULL )
     {
         const SvxDateField* pDateField = (const SvxDateField*) pField;
         SvxDateField aDateField( *pDateField );
@@ -286,7 +286,7 @@ void SdModifyFieldDlg::FillControls()
         else
             aRbtVar.Check();
     }
-    else if( pField->ISA( SvxExtTimeField ) )
+    else if( dynamic_cast<const SvxExtTimeField*>(pField) != NULL )
     {
         const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
         SvxExtTimeField aTimeField( *pTimeField );
@@ -296,7 +296,7 @@ void SdModifyFieldDlg::FillControls()
         else
             aRbtVar.Check();
     }
-    else if( pField->ISA( SvxExtFileField ) )
+    else if( dynamic_cast<const SvxExtFileField*>(pField) != NULL )
     {
         const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
         SvxExtFileField aFileField( *pFileField );
@@ -306,7 +306,7 @@ void SdModifyFieldDlg::FillControls()
         else
             aRbtVar.Check();
     }
-    else if( pField->ISA( SvxAuthorField ) )
+    else if( dynamic_cast<const SvxAuthorField*>(pField) != NULL )
     {
         const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
         SvxAuthorField aAuthorField( *pAuthorField );
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index e55db95..6bb610c 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -288,7 +288,9 @@ void SdDocPreviewWin::updateViewSettings()
 
 void SdDocPreviewWin::Notify(SfxBroadcaster&, const SfxHint& rHint)
 {
-    if( rHint.ISA( SfxSimpleHint ) && ( (SfxSimpleHint&) rHint ).GetId() == 
SFX_HINT_COLORS_CHANGED )
+    const SfxSimpleHint *pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+
+    if( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED )
     {
         updateViewSettings();
     }
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index e3e11d2..565e272 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -775,7 +775,7 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
                     if( aFieldInfo.pFieldItem )
                     {
                         const SvxFieldData* pFieldData = aFieldInfo.pFieldItem->GetField();
-                        if( pFieldData && pFieldData->ISA( SvxDateTimeField ) )
+                        if( dynamic_cast<const SvxDateTimeField*>(pFieldData) != NULL )
                         {
                             break;
                         }
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 4c16804..d138d25 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -282,8 +282,10 @@ String SdPageObjsTLB::GetObjectName(
     {
         aRet = pObject->GetName();
 
-        if( !aRet.Len() && pObject->ISA( SdrOle2Obj ) )
-            aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
+        const SdrOle2Obj *pOle = dynamic_cast<const SdrOle2Obj*>(pObject);
+
+        if( !aRet.Len() && pOle )
+            aRet = pOle->GetPersistName();
     }
 
     if (bCreate
-- 
1.7.3.4

From c3aa48312b9a66cf97df9d7820e0e68b0b94fe3c Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Fri, 16 Dec 2011 19:10:44 -0430
Subject: [PATCH 08/36] Replace deprecated ISA macro for dynamic_cast.

---
 sd/source/filter/eppt/eppt.cxx           |    2 +-
 sd/source/filter/grf/sdgrffilter.cxx     |    3 +--
 sd/source/filter/ppt/pptin.cxx           |    6 +++---
 sd/source/filter/ppt/pptinanimations.cxx |    2 +-
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index d4f450f..8ee62cd 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -1307,7 +1307,7 @@ void PPTWriter::ImplWriteOLE( )
             case NORMAL_OLE_OBJECT :
             {
                 SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape );
-                if ( pSdrObj && pSdrObj->ISA( SdrOle2Obj ) )
+                if ( dynamic_cast<SdrOle2Obj*>(pSdrObj) != NULL )
                 {
                     ::uno::Reference < embed::XEmbeddedObject > xObj( ( (SdrOle2Obj*) pSdrObj 
)->GetObjRef() );
                     if( xObj.is() )
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 4337bf5..c5853f4 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -285,8 +285,7 @@ sal_Bool SdGRFFilter::Export()
         if ( xExporter.is() && xFilter.is() )
         {
             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/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 3c7469a..d0e73c7 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2388,7 +2388,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<SdrGrafObj*>(pObj) != NULL )
                         {
                             bEmptyPresObj = sal_False;
                             switch ( nPlaceholderId )
@@ -2556,7 +2556,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, 
voi
     if ( pObj )
     {
         // further setup placeholder objects
-        if( pObj->ISA(SdrPageObj) && pData )
+        if( dynamic_cast<SdrPageObj*>(pObj) != NULL && pData )
         {
             const ProcessData* pProcessData=(const ProcessData*)pData;
             if( pProcessData->pPage )
@@ -2601,7 +2601,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) == NULL &&
                                             pAnimation->HasAnimateAssociatedShape() )
                                         {
                                             const SfxItemSet& rObjItemSet = 
pObj->GetMergedItemSet();
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index fb619f0..b5d3f40 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -3047,7 +3047,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) == NULL )
                             break;
 
                         SdrTextObj* pTextObj = static_cast< SdrTextObj* >( pSdrObject );
-- 
1.7.3.4

From 8d9933d79489dfe3a55beb16335379e047ccff55 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sat, 17 Dec 2011 00:13:19 -0430
Subject: [PATCH 09/36] Replace deprecated ISA macro for dynamic_cast.

---
 .../ui/slidesorter/controller/SlsListener.cxx      |   12 ++++++------
 .../ui/slidesorter/controller/SlsTransferable.cxx  |    7 ++++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx 
b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index fdd01a4..c0bbd5c 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -308,9 +308,9 @@ void Listener::Notify (
     SfxBroadcaster& rBroadcaster,
     const SfxHint& rHint)
 {
-    if (rHint.ISA(SdrHint))
+    if (dynamic_cast<const SdrHint*>(&rHint) != NULL)
     {
-        SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
+        const SdrHint& rSdrHint = static_cast<const SdrHint&>(rHint);
         switch (rSdrHint.GetKind())
         {
             case HINT_PAGEORDERCHG:
@@ -322,9 +322,9 @@ void Listener::Notify (
                 break;
         }
     }
-    else if (rHint.ISA(ViewShellHint))
+    else if (dynamic_cast<const ViewShellHint*>(&rHint) != NULL)
     {
-        ViewShellHint& rViewShellHint (*PTR_CAST(ViewShellHint,&rHint));
+        const ViewShellHint& rViewShellHint = static_cast<const ViewShellHint&>(rHint);
         switch (rViewShellHint.GetHintId())
         {
             case ViewShellHint::HINT_PAGE_RESIZE_START:
@@ -356,9 +356,9 @@ void Listener::Notify (
                 break;
         }
     }
-    else if (rHint.ISA(SfxSimpleHint))
+    else if (dynamic_cast<const SfxSimpleHint*>(&rHint) != NULL)
     {
-        SfxSimpleHint& rSfxSimpleHint (*PTR_CAST(SfxSimpleHint,&rHint));
+        const SfxSimpleHint& rSfxSimpleHint = static_cast<const SfxSimpleHint&>(rHint);
         switch (rSfxSimpleHint.GetId())
         {
             case SFX_HINT_DOCCHANGED:
diff --git a/sd/source/ui/slidesorter/controller/SlsTransferable.cxx 
b/sd/source/ui/slidesorter/controller/SlsTransferable.cxx
index faf4a08..724c5a8 100644
--- a/sd/source/ui/slidesorter/controller/SlsTransferable.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsTransferable.cxx
@@ -71,10 +71,11 @@ void Transferable::DragFinished (sal_Int8 nDropAction)
 
 void Transferable::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint)
 {
-    if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL)
+    const SfxSimpleHint *pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
+
+    if (pSimple != NULL && mpViewShell!=NULL)
     {
-        SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint));
-        if (rSimpleHint.GetId() == SFX_HINT_DYING)
+        if (pSimple->GetId() == SFX_HINT_DYING)
         {
             // This hint may come either from the ViewShell or from the
             // document (registered by SdTransferable).  We do not know
-- 
1.7.3.4

From 65f03b3e578993740a1e7adcfa54d75504db3522 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sat, 17 Dec 2011 00:38:42 -0430
Subject: [PATCH 10/36] Replace deprecated macro ISA for dynamic_cast.

---
 sd/source/ui/app/sdmod.cxx    |    5 +++--
 sd/source/ui/app/sdmod2.cxx   |    2 +-
 sd/source/ui/app/sdpopup.cxx  |   16 ++++++++--------
 sd/source/ui/app/sdxfer.cxx   |   10 +++++-----
 sd/source/ui/app/tmplctrl.cxx |    4 ++--
 5 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index f58975c..e93177f 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -161,8 +161,9 @@ SdModule::~SdModule()
 
 void SdModule::Notify( SfxBroadcaster&, const SfxHint& rHint )
 {
-    if( rHint.ISA( SfxSimpleHint ) &&
-        ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DEINITIALIZING )
+    const SfxSimpleHint *pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
+
+    if( pSimple && pSimple->GetId() == SFX_HINT_DEINITIALIZING )
     {
         delete pImpressOptions, pImpressOptions = NULL;
         delete pDrawOptions, pDrawOptions = NULL;
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index ceeaf66..bfc8999 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -102,7 +102,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<sd::OutlineViewShell*>(pViewSh) != NULL)
         pSdView = static_cast<sd::OutlineView*> 
(static_cast<sd::OutlineViewShell*>(pViewSh)->GetView());
 
     if (pSdView != NULL && (pOutliner ==  pSdView->GetOutliner()))
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index 65631d5..7acbe5e 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -81,7 +81,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
     InsertItem( nID++, String( SdResId( STR_VAR ) ), nStyle );
     InsertSeparator();
 
-    if( pField->ISA( SvxDateField ) )
+    if( dynamic_cast<const SvxDateField*>(pField) != NULL )
     {
         const SvxDateField* pDateField = (const SvxDateField*) pField;
         SvxDateField aDateField( *pDateField );
@@ -113,7 +113,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) != NULL )
     {
         const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
         SvxExtTimeField aTimeField( *pTimeField );
@@ -147,7 +147,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) != NULL )
     {
         const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
         //SvxExtFileField aFileField( *pFileField );
@@ -164,7 +164,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
 
         CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 );
     }
-    else if( pField->ISA( SvxAuthorField ) )
+    else if( dynamic_cast<const SvxAuthorField*>(pField) != NULL )
     {
         const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
         SvxAuthorField aAuthorField( *pAuthorField );
@@ -195,7 +195,7 @@ SvxFieldData* SdFieldPopup::GetField()
     SvxFieldData* pNewField = NULL;
     sal_uInt16 nCount = GetItemCount();
 
-    if( pField->ISA( SvxDateField ) )
+    if( dynamic_cast<const SvxDateField*>(pField) != NULL )
     {
         const SvxDateField* pDateField = (const SvxDateField*) pField;
         SvxDateType   eType;
@@ -228,7 +228,7 @@ SvxFieldData* SdFieldPopup::GetField()
             }
         }
     }
-    else if( pField->ISA( SvxExtTimeField ) )
+    else if( dynamic_cast<const SvxExtTimeField*>(pField) != NULL )
     {
         const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
         SvxTimeType   eType;
@@ -262,7 +262,7 @@ SvxFieldData* SdFieldPopup::GetField()
 
         }
     }
-    else if( pField->ISA( SvxExtFileField ) )
+    else if( dynamic_cast<const SvxExtFileField*>(pField) != NULL )
     {
         const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
         SvxFileType   eType;
@@ -302,7 +302,7 @@ SvxFieldData* SdFieldPopup::GetField()
             }
         }
     }
-    else if( pField->ISA( SvxAuthorField ) )
+    else if( dynamic_cast<const SvxAuthorField*>(pField) != NULL )
     {
         const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
         SvxAuthorType   eType;
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 317c9f2..ea25c22 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -183,7 +183,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
         delete mpBookmark, mpBookmark = NULL;
         delete mpImageMap, mpImageMap = NULL;
 
-        if( pObj->ISA( SdrOle2Obj ) )
+        if( dynamic_cast<SdrOle2Obj*>(pObj) != NULL )
         {
             try
             {
@@ -203,7 +203,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
             catch( uno::Exception& )
             {}
         }
-        else if( pObj->ISA( SdrGrafObj ) && (mpSourceDoc && !mpSourceDoc->GetAnimationInfo( pObj 
)) )
+        else if( dynamic_cast<SdrGrafObj*>(pObj) != NULL && (mpSourceDoc && 
!mpSourceDoc->GetAnimationInfo( pObj )) )
         {
             mpGraphic = new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() );
         }
@@ -237,7 +237,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
                 }
             }
         }
-        else if( pObj->ISA( SdrTextObj ) )
+        else if( dynamic_cast<SdrTextObj*>(pObj) )
         {
             const OutlinerParaObject* pPara;
 
@@ -249,7 +249,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
                 {
                     const SvxFieldData* pData = pField->GetField();
 
-                    if( pData && pData->ISA( SvxURLField ) )
+                    if( dynamic_cast<const SvxURLField*>(pData) != NULL )
                     {
                         const SvxURLField* pURL = (SvxURLField*) pData;
 
@@ -376,7 +376,7 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
                 bOnlyControls = sal_True;   // only set if there are any objects at all
                 while ( pObj )
                 {
-                    if (!pObj->ISA(SdrUnoObj))
+                    if (dynamic_cast<SdrUnoObj*>(pObj) == NULL)
                     {
                         bOnlyControls = sal_False;
                         break;
diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx
index be0c4fc..665ced5 100644
--- a/sd/source/ui/app/tmplctrl.cxx
+++ b/sd/source/ui/app/tmplctrl.cxx
@@ -94,9 +94,9 @@ SdTemplateControl::~SdTemplateControl()
 void SdTemplateControl::StateChanged(
     sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
 {
-    if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) )
+    if( eState != SFX_ITEM_AVAILABLE || dynamic_cast<const SfxPoolItem*>(pState) != NULL )
         GetStatusBar().SetItemText( GetId(), String() );
-    else if ( pState->ISA( SfxStringItem ) )
+    else if ( dynamic_cast<const SfxStringItem*>(pState) != NULL )
     {
         msTemplate = ((SfxStringItem*)pState)->GetValue();
         GetStatusBar().SetItemText( GetId(), msTemplate );
-- 
1.7.3.4

From 7ea894aec4644591583397e7d75d2f1c8653d439 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sat, 17 Dec 2011 11:57:17 -0430
Subject: [PATCH 11/36] Replace deprecated ISA macro for dynamic_cast.

---
 sd/source/ui/func/fubullet.cxx |    8 ++--
 sd/source/ui/func/fuconarc.cxx |   57 +++++++++++------------
 sd/source/ui/func/fuconbez.cxx |    2 +-
 sd/source/ui/func/fudraw.cxx   |   24 ++++++----
 sd/source/ui/func/fuinsert.cxx |    8 ++--
 sd/source/ui/func/fuinsfil.cxx |    4 +-
 sd/source/ui/func/fulinend.cxx |    4 +-
 sd/source/ui/func/fumorph.cxx  |   12 ++--
 sd/source/ui/func/fuolbull.cxx |    7 ++-
 sd/source/ui/func/fuoltext.cxx |    2 +-
 sd/source/ui/func/fupoor.cxx   |  101 +++++++++++++++++++++-------------------
 sd/source/ui/func/fuprlout.cxx |   30 ++++++------
 sd/source/ui/func/fuscale.cxx  |   10 ++--
 sd/source/ui/func/fusearch.cxx |    8 ++--
 sd/source/ui/func/fusel.cxx    |   22 ++++----
 sd/source/ui/func/futempl.cxx  |    4 +-
 sd/source/ui/func/futext.cxx   |   74 ++++++++++++++---------------
 sd/source/ui/func/futhes.cxx   |   10 ++--
 sd/source/ui/func/fuvect.cxx   |    2 +-
 sd/source/ui/func/sdundogr.cxx |    6 ++-
 20 files changed, 200 insertions(+), 195 deletions(-)

diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index ac1ed84..ba8e638 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -119,13 +119,13 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
     ::Outliner*   pOL = NULL;
 
     // depending on ViewShell set Outliner and OutlinerView
-    if (mpViewShell->ISA(DrawViewShell))
+    if ( dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
     {
         pOV = mpView->GetTextEditOutlinerView();
         if (pOV)
             pOL = mpView->GetTextEditOutliner();
     }
-    else if (mpViewShell->ISA(OutlineViewShell))
+    else if ( dynamic_cast<OutlineViewShell*>(mpViewShell) != NULL )
     {
         pOL = static_cast<OutlineView*>(mpView)->GetOutliner();
         pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
@@ -241,7 +241,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
         ::Outliner*   pOL = NULL;
 
         // je nach ViewShell Outliner und OutlinerView bestimmen
-        if(mpViewShell && mpViewShell->ISA(DrawViewShell))
+        if( dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
         {
             pOV = mpView->GetTextEditOutlinerView();
             if (pOV)
@@ -249,7 +249,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
                 pOL = mpView->GetTextEditOutliner();
             }
         }
-        else if(mpViewShell && mpViewShell->ISA(OutlineViewShell))
+        else if( dynamic_cast<OutlineViewShell*>(mpViewShell) != NULL )
         {
             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 1c02bf2..f64cb5f 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -278,43 +278,40 @@ SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const 
Recta
         mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
         0L, mpDoc);
 
-    if(pObj)
+    if( dynamic_cast<SdrCircObj*>(pObj) != NULL )
     {
-        if(pObj->ISA(SdrCircObj))
+        Rectangle aRect(rRectangle);
+
+        if(SID_DRAW_ARC == nID ||
+            SID_DRAW_CIRCLEARC == nID ||
+            SID_DRAW_CIRCLEPIE == nID ||
+            SID_DRAW_CIRCLEPIE_NOFILL == nID ||
+            SID_DRAW_CIRCLECUT == nID ||
+            SID_DRAW_CIRCLECUT_NOFILL == nID)
         {
-            Rectangle aRect(rRectangle);
-
-            if(SID_DRAW_ARC == nID ||
-                SID_DRAW_CIRCLEARC == nID ||
-                SID_DRAW_CIRCLEPIE == nID ||
-                SID_DRAW_CIRCLEPIE_NOFILL == nID ||
-                SID_DRAW_CIRCLECUT == nID ||
-                SID_DRAW_CIRCLECUT_NOFILL == nID)
-            {
-                // force quadratic
-                ImpForceQuadratic(aRect);
-            }
-
-            pObj->SetLogicRect(aRect);
+            // force quadratic
+            ImpForceQuadratic(aRect);
+        }
 
-            SfxItemSet aAttr(mpDoc->GetPool());
-            aAttr.Put(SdrCircStartAngleItem(9000));
-            aAttr.Put(SdrCircEndAngleItem(0));
+        pObj->SetLogicRect(aRect);
 
-            if(SID_DRAW_PIE_NOFILL == nID ||
-                SID_DRAW_CIRCLEPIE_NOFILL == nID ||
-                SID_DRAW_ELLIPSECUT_NOFILL == nID ||
-                SID_DRAW_CIRCLECUT_NOFILL == nID)
-            {
-                aAttr.Put(XFillStyleItem(XFILL_NONE));
-            }
+        SfxItemSet aAttr(mpDoc->GetPool());
+        aAttr.Put(SdrCircStartAngleItem(9000));
+        aAttr.Put(SdrCircEndAngleItem(0));
 
-            pObj->SetMergedItemSet(aAttr);
-        }
-        else
+        if(SID_DRAW_PIE_NOFILL == nID ||
+            SID_DRAW_CIRCLEPIE_NOFILL == nID ||
+            SID_DRAW_ELLIPSECUT_NOFILL == nID ||
+            SID_DRAW_CIRCLECUT_NOFILL == nID)
         {
-            OSL_FAIL("Object is NO circle object");
+            aAttr.Put(XFillStyleItem(XFILL_NONE));
         }
+
+        pObj->SetMergedItemSet(aAttr);
+    }
+    else
+    {
+        OSL_FAIL("Object is NO circle object");
     }
 
     return pObj;
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index b8b413a..05ce26a 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -399,7 +399,7 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
 
     if(pObj)
     {
-        if(pObj->ISA(SdrPathObj))
+        if( dynamic_cast<SdrPathObj*>(pObj) != NULL )
         {
             basegfx::B2DPolyPolygon aPoly;
 
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index e3cb961..5e75977 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -659,7 +659,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<E3dObject*>(pObject) && (rMarkList.GetMarkCount() == 1))
                 {
                     mpWindow->SetPointer(Pointer(POINTER_ROTATE));
                     bDefPointer = sal_False;     // Otherwise it'll be calles Joes routine and the 
mousepointer will reconfigurate again
@@ -675,7 +675,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<FuSelection*>(this) != NULL )
             {
                 sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
 
@@ -690,12 +690,12 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
                 }
             }
 
-            if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection))
+            if (pObj && pMEvt && !pMEvt->IsMod2() && dynamic_cast<FuSelection*>(this) != NULL )
             {
                 // Auf Animation oder ImageMap pruefen
                 bDefPointer = !SetPointer(pObj, aPnt);
 
-                if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+                if (bDefPointer && (dynamic_cast<SdrObjGroup*>(pObj) != NULL || 
dynamic_cast<E3dPolyScene*>(pObj) != NULL))
                 {
                     // In die Gruppe hineinschauen
                     if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, 
SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
@@ -722,7 +722,7 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
 {
     sal_Bool bSet = sal_False;
 
-    sal_Bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) &&
+    sal_Bool bAnimationInfo = (dynamic_cast<GraphicDocShell*>(mpDocSh) == NULL &&
                           mpDoc->GetAnimationInfo(pObj)) ? sal_True:sal_False;
 
     sal_Bool bImageMapInfo = sal_False;
@@ -762,7 +762,9 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
                 ******************************************************/
                 SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
 
-                if ((mpView->ISA(DrawView) &&
+                DrawView *pDrawView = dynamic_cast<DrawView*>(mpView);
+
+                if ((pDrawView &&
                       (pInfo->meClickAction == presentation::ClickAction_BOOKMARK  ||
                        pInfo->meClickAction == presentation::ClickAction_DOCUMENT  ||
                        pInfo->meClickAction == presentation::ClickAction_PREVPAGE  ||
@@ -774,7 +776,7 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
                        pInfo->meClickAction == presentation::ClickAction_MACRO     ||
                        pInfo->meClickAction == presentation::ClickAction_SOUND))
                                                                     ||
-                    (mpView->ISA(DrawView) &&
+                    (pDrawView &&
                         SlideShow::IsRunning( mpViewShell->GetViewShellBase() )   &&
                          (pInfo->meClickAction == presentation::ClickAction_VANISH            ||
                           pInfo->meClickAction == presentation::ClickAction_INVISIBLE         ||
@@ -845,7 +847,8 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt)
                     GetDispatcher()->Execute( SID_INSERT_GRAPHIC,
                                               SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
             }
-            else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) &&
+            else if ( ( dynamic_cast<SdrTextObj*>(pObj) != NULL ||
+                      dynamic_cast<SdrObjGroup*>(pObj) != NULL ) &&
                       !SD_MOD()->GetWaterCan()                            &&
                       mpViewShell->GetFrameView()->IsDoubleClickTextEdit() &&
                       !mpDocSh->IsReadOnly())
@@ -893,7 +896,8 @@ sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
 
             bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
 
-            if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+            if (!bReturn &&
+                (dynamic_cast<SdrObjGroup*>(pObj) != NULL || dynamic_cast<E3dPolyScene*>(pObj) != 
NULL))
             {
                 // In die Gruppe hineinschauen
                 SdrPageView* pPV = NULL;
@@ -945,7 +949,7 @@ sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrV
             }
         }
     }
-    else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj))
+    else if (dynamic_cast<GraphicDocShell*>(mpDocSh) == NULL && mpDoc->GetAnimationInfo(pObj))
     {
         SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
 
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 0ca60db..3923540 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -135,7 +135,7 @@ void FuInsertGraphic::DoExecute( SfxRequest&  )
         int nError = aDlg.GetGraphic(aGraphic);
         if( nError == GRFILTER_OK )
         {
-            if( mpViewShell && mpViewShell->ISA(DrawViewShell))
+            if( dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
             {
                 sal_Int8    nAction = DND_ACTION_COPY;
                 SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
@@ -229,12 +229,12 @@ void FuInsertClipboard::DoExecute( SfxRequest&  )
         {
             sal_Int8 nAction = DND_ACTION_COPY;
 
+            DrawViewShell *pDrViewSh = dynamic_cast<DrawViewShell*>(mpViewShell);
+
             if( !mpView->InsertData( aDataHelper,
                                     mpWindow->PixelToLogic( Rectangle( Point(), 
mpWindow->GetOutputSizePixel() ).Center() ),
-                                    nAction, sal_False, nFormatId ) &&
-                ( mpViewShell && mpViewShell->ISA( DrawViewShell ) ) )
+                                    nAction, sal_False, nFormatId ) && pDrViewSh )
             {
-                DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
                 INetBookmark        aINetBookmark( aEmptyStr, aEmptyStr );
 
                 if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index a54e227..d1389a4 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -271,7 +271,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
 
     SFX_APP()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, 
SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
 
-    sal_Bool                bDrawMode = mpViewShell && mpViewShell->ISA(DrawViewShell);
+    sal_Bool                bDrawMode = dynamic_cast<DrawViewShell*>(mpViewShell) != NULL;
     sal_Bool                bInserted = sal_False;
 
     if( pFilter )
@@ -366,7 +366,7 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
         SdPage* pPage = NULL;
         ::sd::View* pView = mpViewShell->GetView();
 
-        if (pView->ISA(OutlineView))
+        if ( dynamic_cast<OutlineView*>(pView) != NULL )
         {
             pPage = static_cast<OutlineView*>(pView)->GetActualPage();
         }
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index ce0036d..f428a50 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -80,7 +80,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
         const SdrObject* pNewObj;
         SdrObject* pConvPolyObj = NULL;
 
-        if( pObj->ISA( SdrPathObj ) )
+        if( dynamic_cast<const SdrPathObj*>(pObj) != NULL )
         {
             pNewObj = pObj;
         }
@@ -97,7 +97,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
             {
                 pNewObj = pConvPolyObj = pObj->ConvertToPolyObj( sal_True, sal_False );
 
-                if( !pNewObj || !pNewObj->ISA( SdrPathObj ) )
+                if( !pNewObj || dynamic_cast<const SdrPathObj*>(pNewObj) == NULL )
                     return; // Abbruch, zusaetzliche Sicherheit, die bei
                             // Gruppenobjekten aber nichts bringt.
             }
diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx
index 8464981..cdc9107 100644
--- a/sd/source/ui/func/fumorph.cxx
+++ b/sd/source/ui/func/fumorph.cxx
@@ -123,16 +123,16 @@ void FuMorph::DoExecute( SfxRequest& )
 
             while(aIter1.IsMore())
             {
-                SdrObject* pObj = aIter1.Next();
-                if(pObj && pObj->ISA(SdrPathObj))
-                    aPolyPoly1.append(((SdrPathObj*)pObj)->GetPathPoly());
+                SdrPathObj* pPath = dynamic_cast<SdrPathObj*>(aIter1.Next());
+                if(pPath)
+                    aPolyPoly1.append(pPath->GetPathPoly());
             }
 
             while(aIter2.IsMore())
             {
-                SdrObject* pObj = aIter2.Next();
-                if(pObj && pObj->ISA(SdrPathObj))
-                    aPolyPoly2.append(((SdrPathObj*)pObj)->GetPathPoly());
+                SdrPathObj* pPath = dynamic_cast<SdrPathObj*>(aIter2.Next());
+                if( pPath)
+                    aPolyPoly2.append(pPath->GetPathPoly());
             }
 
             // Morphing durchfuehren
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 684b3b1..cb6c478 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -102,10 +102,11 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
                     std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
                     SAL_WNODEPRECATED_DECLARATIONS_POP
 
-                    if (mpView->ISA(OutlineView))
+                    OutlineView *pView = dynamic_cast<OutlineView*>(mpView);
+
+                    if (pView)
                     {
-                        pOLV = static_cast<OutlineView*>(mpView)
-                            ->GetViewByWindow(mpViewShell->GetActiveWindow());
+                        pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
 
                         aGuard.reset( new OutlineViewModelChangeGuard( 
static_cast<OutlineView&>(*mpView) ) );
                     }
diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx
index df1108f..1be4333 100644
--- a/sd/source/ui/func/fuoltext.cxx
+++ b/sd/source/ui/func/fuoltext.cxx
@@ -180,7 +180,7 @@ sal_Bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
         {
             const SvxFieldData* pField = pFieldItem->GetField();
 
-            if( pField && pField->ISA( SvxURLField ) )
+            if( dynamic_cast<const SvxURLField*>(pField) != NULL )
             {
                 bReturn = sal_True;
                 mpWindow->ReleaseMouse();
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 6d2baed..d8f9ff9 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -251,10 +251,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
         {
             if(rKEvt.GetKeyCode().IsMod1())
             {
-                if(mpViewShell && mpViewShell->ISA(DrawViewShell))
+                DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+                if(pDrawViewShell)
                 {
-                    DrawViewShell* pDrawViewShell =
-                        static_cast<DrawViewShell*>(mpViewShell);
                     SdPage* pActualPage = pDrawViewShell->GetActualPage();
                     SdrTextObj* pCandidate = 0L;
 
@@ -266,7 +266,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                         {
                             SdrObject* pObj = aIter.Next();
 
-                            if(pObj && pObj->ISA(SdrTextObj))
+                            if(dynamic_cast<SdrTextObj*>(pObj) != NULL)
                             {
                                 sal_uInt32 nInv(pObj->GetObjInventor());
                                 sal_uInt16 nKnd(pObj->GetObjIdentifier());
@@ -309,12 +309,12 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                 {
                     SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
 
-                    if( pObj && pObj->ISA( SdrOle2Obj ) && !mpDocSh->IsUIActive() )
+                    if( dynamic_cast<SdrOle2Obj*>(pObj) != NULL && !mpDocSh->IsUIActive() )
                     {
                         //HMHmpView->HideMarkHdl();
                         mpViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
                     }
-                    else if( pObj && pObj->IsEmptyPresObj() && pObj->ISA( SdrGrafObj ) )
+                    else if( dynamic_cast<SdrGrafObj*>(pObj) != NULL && pObj->IsEmptyPresObj() )
                     {
                         mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_GRAPHIC, 
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
                     }
@@ -370,9 +370,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                 // Zoom vergroessern
                 mpViewShell->SetZoom(mpWindow->GetZoom() * 3 / 2);
 
-                if (mpViewShell->ISA(DrawViewShell))
-                    static_cast<DrawViewShell*>(mpViewShell)
-                        ->SetZoomOnPage(sal_False);
+                DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+                if (pShell)
+                    pShell->SetZoomOnPage(sal_False);
 
                 bReturn = sal_True;
             }
@@ -386,9 +387,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                 // Zoom verringern
                 mpViewShell->SetZoom(mpWindow->GetZoom() * 2 / 3);
 
-                if (mpViewShell->ISA(DrawViewShell))
-                    static_cast<DrawViewShell*>(mpViewShell)
-                        ->SetZoomOnPage(sal_False);
+                DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+                if (pShell)
+                    pShell->SetZoomOnPage(sal_False);
 
                 bReturn = sal_True;
             }
@@ -447,12 +449,14 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
 
         case KEY_HOME:
         {
+            DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
             if (!mpView->IsTextEdit()
-                && mpViewShell->ISA(DrawViewShell)
+                && pShell
                 && !bSlideShow)
             {
                // Sprung zu erster Seite
-               static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(0);
+               pShell->SwitchPage(0);
                bReturn = sal_True;
             }
         }
@@ -460,15 +464,15 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
 
         case KEY_END:
         {
+            DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
             if (!mpView->IsTextEdit()
-                && mpViewShell->ISA(DrawViewShell)
+                && pShell
                 && !bSlideShow)
             {
                 // Sprung zu letzter Seite
-                SdPage* pPage =
-                    static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
-                static_cast<DrawViewShell*>(mpViewShell)
-                    ->SwitchPage(mpDoc->GetSdPageCount(
+                SdPage* pPage = pShell->GetActualPage();
+                pShell->SwitchPage(mpDoc->GetSdPageCount(
                         pPage->GetPageKind()) - 1);
                 bReturn = sal_True;
             }
@@ -480,7 +484,9 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
             if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
                 break;
 
-            if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
+            DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+            if(pShell && !bSlideShow)
             {
                 // The page-up key switches layers or pages depending on the
                 // modifier key.
@@ -492,7 +498,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
 
                     // Previous page.
                     bReturn = sal_True;
-                    SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
+                    SdPage* pPage = pShell->GetActualPage();
                     sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
 
                     if (nSdPage > 0)
@@ -500,12 +506,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                         // Switch the page and send events regarding
                         // deactivation the old page and activating the new
                         // one.
-                        TabControl* pPageTabControl =
-                            static_cast<DrawViewShell*>(mpViewShell)
-                            ->GetPageTabControl();
+                        TabControl* pPageTabControl = pShell->GetPageTabControl();
                         if (pPageTabControl->IsReallyShown())
                             pPageTabControl->SendDeactivatePageEvent ();
-                        static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage - 1);
+                        pShell->SwitchPage(nSdPage - 1);
                         if (pPageTabControl->IsReallyShown())
                             pPageTabControl->SendActivatePageEvent ();
                     }
@@ -513,7 +517,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                 else if (rKEvt.GetKeyCode().IsMod1())
                 {
                     // With the CONTROL modifier we switch layers.
-                    if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
+                    if (pShell->IsLayerModeActive())
                     {
                         // Moves to the previous layer.
                         SwitchLayer (-1);
@@ -527,7 +531,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
         {
             if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
                 break;
-            if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
+
+            DrawViewShell *pShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+            if(pShell && !bSlideShow)
             {
                 // The page-down key switches layers or pages depending on the
                 // modifier key.
@@ -538,7 +545,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
 
                     // Next page.
                     bReturn = sal_True;
-                    SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
+                    SdPage* pPage = pShell->GetActualPage();
                     sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
 
                     if (nSdPage < mpDoc->GetSdPageCount(pPage->GetPageKind()) - 1)
@@ -546,11 +553,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                         // Switch the page and send events regarding
                         // deactivation the old page and activating the new
                         // one.
-                        TabControl* pPageTabControl =
-                            static_cast<DrawViewShell*>(mpViewShell)->GetPageTabControl();
+                        TabControl* pPageTabControl = pShell->GetPageTabControl();
                         if (pPageTabControl->IsReallyShown())
                             pPageTabControl->SendDeactivatePageEvent ();
-                        static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage + 1);
+                        pShell->SwitchPage(nSdPage + 1);
                         if (pPageTabControl->IsReallyShown())
                             pPageTabControl->SendActivatePageEvent ();
                     }
@@ -558,7 +564,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                 else if (rKEvt.GetKeyCode().IsMod1())
                 {
                     // With the CONTROL modifier we switch layers.
-                    if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
+                    if (pShell->IsLayerModeActive())
                     {
                         // With the layer mode active pressing page-down
                         // moves to the next layer.
@@ -675,7 +681,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                     sal_Bool bOldSuppress = false;
                     SdrEdgeObj* pEdgeObj = 0L;
 
-                    if(pHdl && pHdl->GetObj() && pHdl->GetObj()->ISA(SdrEdgeObj) && 0 == 
pHdl->GetPolyNum())
+                    if(pHdl && dynamic_cast<SdrEdgeObj*>(pHdl->GetObj()) != NULL && 0 == 
pHdl->GetPolyNum())
                     {
                         pEdgeObj = (SdrEdgeObj*)pHdl->GetObj();
 
@@ -861,7 +867,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
             {
                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
-                if(pObj->ISA(SdrTextObj) && pObj->HasTextEdit() && !pObj->ISA(SdrOle2Obj))
+                if(dynamic_cast<SdrTextObj*>(pObj) != NULL && pObj->HasTextEdit() && 
dynamic_cast<SdrOle2Obj*>(pObj) == NULL)
                 {
                     // use common IsSimpleCharInput from the EditEngine.
                     sal_Bool bPrintable(EditEngine::IsSimpleCharInput(rKEvt));
@@ -884,13 +890,12 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
             }
             else
             {
+                DrawViewShell *pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
                 // test if there is a title object there. If yes, try to
                 // set it to edit mode and start typing...
-                if(mpViewShell->ISA(DrawViewShell)
-                    && EditEngine::IsSimpleCharInput(rKEvt))
+                if(pDrawViewShell && EditEngine::IsSimpleCharInput(rKEvt))
                 {
-                    DrawViewShell* pDrawViewShell =
-                        static_cast<DrawViewShell*>(mpViewShell);
                     SdPage* pActualPage = pDrawViewShell->GetActualPage();
                     SdrTextObj* pCandidate = 0L;
 
@@ -902,14 +907,16 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
                         {
                             SdrObject* pObj = aIter.Next();
 
-                            if(pObj && pObj->ISA(SdrTextObj))
+                            SdrTextObj *pText = dynamic_cast<SdrTextObj*>(pObj);
+
+                            if(pText)
                             {
                                 sal_uInt32 nInv(pObj->GetObjInventor());
                                 sal_uInt16 nKnd(pObj->GetObjIdentifier());
 
                                 if(SdrInventor == nInv && OBJ_TITLETEXT == nKnd)
                                 {
-                                    pCandidate = (SdrTextObj*)pObj;
+                                    pCandidate = pText;
                                 }
                             }
                         }
@@ -1129,7 +1136,7 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq)
         {
             const SfxPoolItem& rItem = pSet->Get( nSlotId );
 
-            if( rItem.ISA( SfxAllEnumItem ) )
+            if( dynamic_cast<const SfxAllEnumItem*>(&rItem) != NULL )
             {
                 nSlotValue = ( ( const SfxAllEnumItem& ) rItem ).GetValue();
             }
@@ -1164,11 +1171,10 @@ void FuPoor::ImpForceQuadratic(Rectangle& rRect)
 
 void FuPoor::SwitchLayer (sal_Int32 nOffset)
 {
-    if(mpViewShell && mpViewShell->ISA(DrawViewShell))
-    {
-        DrawViewShell* pDrawViewShell =
-            static_cast<DrawViewShell*>(mpViewShell);
+    DrawViewShell *pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
 
+    if(pDrawViewShell)
+    {
         // Calculate the new index.
         sal_Int32 nIndex = pDrawViewShell->GetActiveTabLayerIndex() + nOffset;
 
@@ -1181,8 +1187,7 @@ void FuPoor::SwitchLayer (sal_Int32 nOffset)
         // Set the new active layer.
         if (nIndex != pDrawViewShell->GetActiveTabLayerIndex ())
         {
-            LayerTabBar* pLayerTabControl =
-                static_cast<DrawViewShell*>(mpViewShell)->GetLayerTabControl();
+            LayerTabBar* pLayerTabControl = pDrawViewShell->GetLayerTabControl();
             if (pLayerTabControl != NULL)
                 pLayerTabControl->SendDeactivatePageEvent ();
 
@@ -1202,7 +1207,7 @@ void FuPoor::SwitchLayer (sal_Int32 nOffset)
 */
 bool FuPoor::cancel()
 {
-    if ( !this->ISA(FuSelection) )
+    if ( dynamic_cast<FuSelection*>(this) == NULL )
     {
         mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, 
SFX_CALLMODE_ASYNCHRON);
         return true;
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index 3544ab7..ec5fd43 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -131,10 +131,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
     // wenn wir auf einer Masterpage sind, gelten die Aenderungen fuer alle
     // Seiten und Notizseiten, die das betreffende Layout benutzen
     sal_Bool bOnMaster = sal_False;
-    if( mpViewShell && mpViewShell->ISA(DrawViewShell))
+    DrawViewShell *pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
+
+    if( pDrawViewShell)
     {
-        EditMode eEditMode =
-            static_cast<DrawViewShell*>(mpViewShell)->GetEditMode();
+        EditMode eEditMode = pDrawViewShell->GetEditMode();
         if (eEditMode == EM_MASTERPAGE)
             bOnMaster = sal_True;
     }
@@ -207,7 +208,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
         // That isn't quitely 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( pDrawViewShell && !bCheckMasters )
             static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(sal_True);
 
         if (bLoad)
@@ -232,7 +233,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
         }
 
         // Blockade wieder aufheben
-        if (mpViewShell->ISA(DrawViewShell) && !bCheckMasters )
+        if (pDrawViewShell && !bCheckMasters )
             static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(sal_False);
 
         /*************************************************************************
@@ -242,13 +243,12 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
         {
             if (bOnMaster)
             {
-                if (mpViewShell->ISA(DrawViewShell))
+                if (pDrawViewShell)
                 {
-                    ::sd::View* pView =
-                          static_cast<DrawViewShell*>(mpViewShell)->GetView();
+                    ::sd::View* pView = pDrawViewShell->GetView();
                     sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum();
 
-                    if (static_cast<DrawViewShell*>(mpViewShell)->GetPageKind() == PK_NOTES)
+                    if (pDrawViewShell->GetPageKind() == PK_NOTES)
                         nPgNum++;
 
                     pView->HideSdrPage();
@@ -265,14 +265,12 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
         }
 
         // fake a mode change to repaint the page tab bar
-        if( mpViewShell && mpViewShell->ISA( DrawViewShell ) )
+        if( pDrawViewShell )
         {
-            DrawViewShell* pDrawViewSh =
-                static_cast<DrawViewShell*>(mpViewShell);
-            EditMode eMode = pDrawViewSh->GetEditMode();
-            sal_Bool bLayer = pDrawViewSh->IsLayerModeActive();
-            pDrawViewSh->ChangeEditMode( eMode, !bLayer );
-            pDrawViewSh->ChangeEditMode( eMode, bLayer );
+            EditMode eMode = pDrawViewShell->GetEditMode();
+            sal_Bool bLayer = pDrawViewShell->IsLayerModeActive();
+            pDrawViewShell->ChangeEditMode( eMode, !bLayer );
+            pDrawViewShell->ChangeEditMode( eMode, bLayer );
         }
 
         mpDocSh->SetWaitCursor( sal_False );
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index b3e7c62..9b3b2a4 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -92,10 +92,10 @@ void FuScale::DoExecute( SfxRequest& rReq )
         sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
 
         nValue = (sal_Int16) mpWindow->GetZoom();
+        DrawViewShell *pDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
 
         // Zoom auf Seitengroesse ?
-        if( mpViewShell && mpViewShell->ISA( DrawViewShell ) &&
-            static_cast<DrawViewShell*>(mpViewShell)->IsZoomOnPage() )
+        if( pDrawViewShell && pDrawViewShell->IsZoomOnPage() )
         {
             pZoomItem = new SvxZoomItem( SVX_ZOOM_WHOLEPAGE, nValue );
         }
@@ -107,7 +107,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
         // Bereich einschraenken
         if( mpViewShell )
         {
-            if( mpViewShell->ISA( DrawViewShell ) )
+            if( pDrawViewShell )
             {
                 SdrPageView* pPageView = mpView->GetSdrPageView();
                 if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) )
@@ -116,7 +116,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
                     nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
                 }
             }
-            else if( mpViewShell->ISA( OutlineViewShell ) )
+            else if( dynamic_cast<OutlineViewShell*>(mpViewShell) != NULL )
             {
                 nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
                 nZoomValues &= ~SVX_ZOOM_ENABLE_WHOLEPAGE;
@@ -175,7 +175,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
 
                 case SVX_ZOOM_OPTIMAL:
                 {
-                    if( mpViewShell->ISA( DrawViewShell ) )
+                    if( pDrawViewShell )
                     {
                         // Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte
                         // --> Wird als Optimal im Programm angeboten
diff --git a/sd/source/ui/func/fusearch.cxx b/sd/source/ui/func/fusearch.cxx
index 1ed714e..5b26bb3 100644
--- a/sd/source/ui/func/fusearch.cxx
+++ b/sd/source/ui/func/fusearch.cxx
@@ -90,12 +90,12 @@ void FuSearch::DoExecute( SfxRequest& )
 {
     mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArraySpell );
 
-    if ( mpViewShell->ISA(DrawViewShell) )
+    if ( dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
     {
         bOwnOutliner = sal_True;
         pSdOutliner = new ::sd::Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT );
     }
-    else if ( mpViewShell->ISA(OutlineViewShell) )
+    else if ( dynamic_cast<OutlineViewShell*>(mpViewShell) != NULL )
     {
         bOwnOutliner = sal_False;
         pSdOutliner = mpDoc->GetOutliner();
@@ -139,7 +139,7 @@ void FuSearch::SearchAndReplace( const SvxSearchItem* pSearchItem )
 
     if (pViewShell != NULL)
     {
-        if ( pSdOutliner && pViewShell->ISA(DrawViewShell) && !bOwnOutliner )
+        if ( pSdOutliner && dynamic_cast<DrawViewShell*>(pViewShell) != NULL && !bOwnOutliner )
         {
             pSdOutliner->EndSpelling();
 
@@ -147,7 +147,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<OutlineViewShell*>(pViewShell) && bOwnOutliner )
         {
             pSdOutliner->EndSpelling();
             delete pSdOutliner;
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 633f068..225f4fb 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -308,9 +308,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
 
                 bReturn = sal_True;
             }
-            else if(!rMEvt.IsMod2()
-                && mpViewShell->ISA(DrawViewShell)
-                )
+            else if(!rMEvt.IsMod2() && dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
             {
                 if(mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, 
SDRSEARCH_ALSOONMASTER))
                 {
@@ -318,7 +316,8 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
                     if ( ! bSelectionOnly)
                         bReturn = AnimateObj(pObj, aMDPos);
 
-                    if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+                    if (!bReturn &&
+                        (dynamic_cast<SdrObjGroup*>(pObj) != NULL || 
dynamic_cast<E3dPolyScene*>(pObj) != NULL))
                     {
                         if(rMEvt.GetClicks() == 1)
                         {
@@ -978,11 +977,12 @@ void FuSelection::Activate()
     {
         case SID_OBJECT_ROTATE:
         {
+            DrawViewShell *pDrawSh = dynamic_cast<DrawViewShell*>(mpViewShell);
+
             // (gemapter) Slot wird explizit auf Rotate gesetzt
-            if( mpViewShell->ISA(DrawViewShell) )
+            if( pDrawSh)
             {
-                sal_uInt16* pSlotArray =
-                    static_cast<DrawViewShell*>(mpViewShell)->GetSlotArray();
+                sal_uInt16* pSlotArray = pDrawSh->GetSlotArray();
                 pSlotArray[ 1 ] = SID_OBJECT_ROTATE;
             }
 
@@ -1235,8 +1235,8 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
                 bAnimated = sal_True;
             }
         }
-        else if (!mpDocSh->ISA(GraphicDocShell)        &&
-                 mpView->ISA(DrawView)                 &&
+        else if (dynamic_cast<GraphicDocShell*>(mpDocSh) == NULL &&
+                 dynamic_cast<DrawView*>(mpView) != NULL &&
                  mpDoc->GetAnimationInfo(pObj))
         {
             /**********************************************************
@@ -1435,8 +1435,8 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
         }
 
         if (!bAnimated                               &&
-            mpView->ISA(DrawView)                 &&
-            !mpDocSh->ISA(GraphicDocShell)        &&
+            dynamic_cast<DrawView*>(mpView) != NULL &&
+            dynamic_cast<GraphicDocShell*>(mpDocSh) == NULL &&
             SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) &&
             mpDoc->GetAnimationInfo(pObj))
         {
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index b67c710..5d23e72 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -567,7 +567,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
                                     while( aIter.IsMore() )
                                     {
                                         SdrObject* pObj = aIter.Next();
-                                        if( pObj->ISA(SdrPageObj) )
+                                        if( dynamic_cast<SdrPageObj*>(pObj) != NULL )
                                         {
                                             // repaint only
                                             pObj->ActionChanged();
@@ -652,7 +652,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
         case SID_STYLE_UPDATE_BY_EXAMPLE:
         {
             if ((mpView->AreObjectsMarked() && mpView->GetMarkedObjectList().GetMarkCount() == 1) 
||
-                 mpView->ISA(OutlineView))
+                 dynamic_cast<OutlineView*>(mpView) != NULL )
             {
                 pStyleSheet = mpView->GetStyleSheet();
 
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 4286ff6..17e4456 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -347,10 +347,10 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
                             ******************************************************/
                             mpView->MarkObj(aVEvt.pRootObj, pPV);
 
-                            if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
-                            {
-                                mxTextObj.reset( static_cast<SdrTextObj*>(aVEvt.pObj) );
-                            }
+                            SdrTextObj *pText = dynamic_cast<SdrTextObj*>(aVEvt.pObj);
+
+                            if (pText)
+                                mxTextObj.reset(pText);
 
                             SetInEditMode(rMEvt, sal_True);
                         }
@@ -1260,7 +1260,7 @@ sal_Bool FuText::RequestHelp(const HelpEvent& rHEvt)
         const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
         const SvxFieldData* pField = pFieldItem->GetField();
 
-        if (pField && pField->ISA(SvxURLField))
+        if ( dynamic_cast<const SvxURLField*>(pField) != NULL )
         {
             /******************************************************************
             * URL-Field
@@ -1325,10 +1325,10 @@ void FuText::ReceiveRequest(SfxRequest& rReq)
                 mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
                 mpView->MarkObj(aVEvt.pRootObj, pPV);
 
-                if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
-                {
-                    mxTextObj.reset( static_cast< SdrTextObj* >( aVEvt.pObj ) );
-                }
+                SdrTextObj *pText = dynamic_cast<SdrTextObj*>(aVEvt.pObj);
+
+                if (pText)
+                    mxTextObj.reset(pText);
             }
         }
         else if (mpView->AreObjectsMarked())
@@ -1337,12 +1337,10 @@ void FuText::ReceiveRequest(SfxRequest& rReq)
 
             if (rMarkList.GetMarkCount() == 1)
             {
-                SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+                SdrTextObj* pText = 
dynamic_cast<SdrTextObj*>(rMarkList.GetMark(0)->GetMarkedSdrObj());
 
-                if (pObj->ISA(SdrTextObj))
-                {
-                    mxTextObj.reset( static_cast< SdrTextObj* >( pObj ) );
-                }
+                if (pText)
+                    mxTextObj.reset(pText);
             }
         }
 
@@ -1398,39 +1396,37 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const 
Rectangle& rR
         mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
         0L, mpDoc);
 
-    if(pObj)
-    {
-        if(pObj->ISA(SdrTextObj))
-        {
-            SdrTextObj* pText = (SdrTextObj*)pObj;
-            pText->SetLogicRect(rRectangle);
+    SdrTextObj *pText = dynamic_cast<SdrTextObj*>(pObj);
 
-            sal_Bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == 
nID);
-            pText->SetVerticalWriting(bVertical);
+    if(pText)
+    {
+        pText->SetLogicRect(rRectangle);
 
-            ImpSetAttributesForNewTextObject(pText);
+        sal_Bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
+        pText->SetVerticalWriting(bVertical);
 
-            if (nSlotId == SID_TEXT_FITTOSIZE)
-            {
-                ImpSetAttributesFitToSize(pText);
-            }
-            else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
-            {
-                ImpSetAttributesFitToSizeVertical(pText);
-            }
-            else
-            {
-                ImpSetAttributesFitCommon(pText);
-            }
+        ImpSetAttributesForNewTextObject(pText);
 
-            // Put text object into edit mode.
-            SdrPageView* pPV = mpView->GetSdrPageView();
-            mpView->SdrBeginTextEdit(pText, pPV);
+        if (nSlotId == SID_TEXT_FITTOSIZE)
+        {
+            ImpSetAttributesFitToSize(pText);
+        }
+        else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
+        {
+            ImpSetAttributesFitToSizeVertical(pText);
         }
         else
         {
-            OSL_FAIL("Object is NO text object");
+            ImpSetAttributesFitCommon(pText);
         }
+
+        // Put text object into edit mode.
+        SdrPageView* pPV = mpView->GetSdrPageView();
+        mpView->SdrBeginTextEdit(pText, pPV);
+    }
+    else
+    {
+        OSL_FAIL("Object is NO text object");
     }
 
     return pObj;
diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx
index f96e587..13f3b05 100644
--- a/sd/source/ui/func/futhes.cxx
+++ b/sd/source/ui/func/futhes.cxx
@@ -88,7 +88,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
     SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, String(),
                              mpWindow, RID_SVXERRCTX, &DIALOG_MGR() );
 
-    if( mpViewShell && mpViewShell->ISA(DrawViewShell) )
+    if( dynamic_cast<DrawViewShell*>(mpViewShell) != NULL )
     {
         SdrTextObj* pTextObj = NULL;
 
@@ -101,9 +101,11 @@ void FuThesaurus::DoExecute( SfxRequest& )
                 SdrMark* pMark = rMarkList.GetMark(0);
                 SdrObject* pObj = pMark->GetMarkedSdrObj();
 
-                if ( pObj->ISA(SdrTextObj) )
+                SdrTextObj *pText = dynamic_cast<SdrTextObj*>(pObj);
+
+                if ( pText )
                 {
-                    pTextObj = (SdrTextObj*) pObj;
+                    pTextObj = pText;
                 }
             }
         }
@@ -135,7 +137,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
             }
         }
     }
-    else if ( mpViewShell->ISA(OutlineViewShell) )
+    else if ( dynamic_cast<OutlineViewShell*>(mpViewShell) != NULL )
     {
         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 479f656..01d6d5b 100644
--- a/sd/source/ui/func/fuvect.cxx
+++ b/sd/source/ui/func/fuvect.cxx
@@ -79,7 +79,7 @@ void FuVectorize::DoExecute( SfxRequest& )
     {
         SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
 
-        if( pObj && pObj->ISA( SdrGrafObj ) )
+        if( dynamic_cast<SdrGrafObj*>(pObj) != NULL )
         {
             SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
             AbstractSdVectorizeDlg* pDlg = pFact ? pFact->CreateSdVectorizeDlg( mpWindow, ( 
(SdrGrafObj*) pObj )->GetGraphic().GetBitmap(), mpDocSh ) : 0;
diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx
index 9d9aaa8..684987d 100644
--- a/sd/source/ui/func/sdundogr.cxx
+++ b/sd/source/ui/func/sdundogr.cxx
@@ -59,9 +59,11 @@ sal_Bool SdUndoGroup::Merge( SfxUndoAction* pNextAction )
 {
     sal_Bool bRet = sal_False;
 
-    if( pNextAction && pNextAction->ISA( SdUndoAction ) )
+    SdUndoAction *pUndo = dynamic_cast<SdUndoAction*>(pNextAction);
+
+    if(pUndo)
     {
-        SdUndoAction* pClone = static_cast< SdUndoAction* >( pNextAction )->Clone();
+        SdUndoAction* pClone = pUndo->Clone();
 
         if( pClone )
         {
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.