summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-27 16:57:21 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-06 15:47:44 -0500
commit5bce32904091ffe28884fd5c0f4801ee82bad101 (patch)
treefc2573078a858de456a0dc7b7810176d433241c7 /sc/source
parent10143717834d8401d85fdf9564e782a58b9983ec (diff)
SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify where the if statement had the check the wrong way around. Change-Id: I611e8929c65818191e36bd80f2b985820ada4411 Reviewed-on: https://gerrit.libreoffice.org/11147 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/bcaslot.cxx3
-rw-r--r--sc/source/core/data/documen3.cxx5
-rw-r--r--sc/source/core/data/drwlayer.cxx3
-rw-r--r--sc/source/core/data/stlsheet.cxx6
-rw-r--r--sc/source/core/tool/hints.cxx8
-rw-r--r--sc/source/core/tool/lookupcache.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibilityHints.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx93
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx41
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx11
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx6
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx14
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx35
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx9
-rw-r--r--sc/source/ui/app/scmod.cxx5
-rw-r--r--sc/source/ui/app/uiitems.cxx3
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx4
-rw-r--r--sc/source/ui/docshell/docsh.cxx22
-rw-r--r--sc/source/ui/docshell/docsh4.cxx14
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx5
-rw-r--r--sc/source/ui/docshell/servobj.cxx18
-rw-r--r--sc/source/ui/inc/AccessibilityHints.hxx4
-rw-r--r--sc/source/ui/inc/uiitems.hxx9
-rw-r--r--sc/source/ui/navipi/navipi.cxx9
-rw-r--r--sc/source/ui/unoobj/addruno.cxx4
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx50
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx19
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx8
-rw-r--r--sc/source/ui/unoobj/confuno.cxx4
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx12
-rw-r--r--sc/source/ui/unoobj/datauno.cxx18
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx4
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx8
-rw-r--r--sc/source/ui/unoobj/docuno.cxx35
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx4
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx4
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx4
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx4
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx4
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx4
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx33
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx14
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx4
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx12
-rw-r--r--sc/source/ui/unoobj/targuno.cxx6
-rw-r--r--sc/source/ui/unoobj/textuno.cxx4
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx3
-rw-r--r--sc/source/ui/unoobj/unoreflist.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx4
-rw-r--r--sc/source/ui/view/drawvie3.cxx9
-rw-r--r--sc/source/ui/view/prevwsh2.cxx6
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx10
57 files changed, 321 insertions, 339 deletions
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index db35f207dd85..ad340a18b82d 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -58,9 +58,6 @@
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1( ScHint, SfxSimpleHint );
-TYPEINIT1( ScAreaChangedHint, SfxHint );
-
struct ScSlotData
{
SCROW nStartRow; // first row of this segment
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 5b86ed962378..d439a44dee49 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -913,8 +913,9 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
// The listener calls must be processed after completing the broadcast,
// because they can add or remove objects from pUnoBroadcaster.
- if ( pUnoListenerCalls && rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DATACHANGED &&
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pUnoListenerCalls && pSimpleHint &&
+ pSimpleHint->GetId() == SFX_HINT_DATACHANGED &&
!bInUnoListenerCall )
{
// Listener calls may lead to BroadcastUno calls again. The listener calls
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index a6dc6e7323c9..43354e14ca71 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -85,9 +85,6 @@ using namespace ::com::sun::star;
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1(ScTabDeletedHint, SfxHint);
-TYPEINIT1(ScTabSizeChangedHint, SfxHint);
-
static ScDrawObjFactory* pFac = NULL;
static E3dObjFactory* pF3d = NULL;
static sal_uInt16 nInst = 0;
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 68e70950075b..466a43f92c1e 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -255,9 +255,9 @@ bool ScStyleSheet::IsUsed() const
void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
- GetItemSet().SetParent( NULL );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ GetItemSet().SetParent( NULL );
}
// schmutzige Tricks, um die Standard-Vorlage immer als "Standard" zu speichern,
diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx
index 28c8873cf80c..3d7a69bb46f7 100644
--- a/sc/source/core/tool/hints.cxx
+++ b/sc/source/core/tool/hints.cxx
@@ -19,14 +19,6 @@
#include "hints.hxx"
-TYPEINIT1(ScPaintHint, SfxHint);
-TYPEINIT1(ScUpdateRefHint, SfxHint);
-TYPEINIT1(ScPointerChangedHint, SfxHint);
-TYPEINIT1(ScLinkRefreshedHint, SfxHint);
-TYPEINIT1(ScAutoStyleHint, SfxHint);
-TYPEINIT1(ScDBRangeRefreshedHint, SfxHint);
-TYPEINIT1(ScDataPilotModifiedHint, SfxHint);
-
// ScPaintHint - info what has to be repainted
ScPaintHint::ScPaintHint( const ScRange& rRng, sal_uInt16 nPaint ) :
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index 15d161bda9e1..08c56e52db47 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -109,7 +109,7 @@ void ScLookupCache::Notify( const SfxHint& rHint )
{
if (!mpDoc->IsInDtorClear())
{
- const ScHint* p = PTR_CAST( ScHint, &rHint );
+ const ScHint* p = dynamic_cast<const ScHint*>(&rHint);
if (p && (p->GetId() & SC_HINT_DATACHANGED))
{
mpDoc->RemoveLookupCache( *this);
diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx
index 5dd4f22784fb..f7309f6010ff 100644
--- a/sc/source/ui/Accessibility/AccessibilityHints.cxx
+++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx
@@ -21,8 +21,6 @@
using namespace ::com::sun::star;
-TYPEINIT1(ScAccWinFocusLostHint, SfxHint);
-
// ScAccWinFocusLostHint - the current window lost its focus (to another application, view or document)
ScAccWinFocusLostHint::ScAccWinFocusLostHint(
@@ -36,8 +34,6 @@ ScAccWinFocusLostHint::~ScAccWinFocusLostHint()
{
}
-TYPEINIT1(ScAccWinFocusGotHint, SfxHint);
-
// ScAccWinFocusGotHint - the window got the focus (from another application, view or document)
ScAccWinFocusGotHint::ScAccWinFocusGotHint(
@@ -51,8 +47,6 @@ ScAccWinFocusGotHint::~ScAccWinFocusGotHint()
{
}
-TYPEINIT1(ScAccGridWinFocusLostHint, SfxHint);
-
// ScAccGridWinFocusLostHint - the current grid window lost its focus (to another application, view or document)
ScAccGridWinFocusLostHint::ScAccGridWinFocusLostHint(ScSplitPos eOld,
@@ -67,8 +61,6 @@ ScAccGridWinFocusLostHint::~ScAccGridWinFocusLostHint()
{
}
-TYPEINIT1(ScAccGridWinFocusGotHint, SfxHint);
-
// ScAccGridWinFocusGotHint - the grid window got the focus (from another application, view or document)
ScAccGridWinFocusGotHint::ScAccGridWinFocusGotHint(ScSplitPos eNew,
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index 1ad86a414267..445fba0f8041 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -127,10 +127,10 @@ void SAL_CALL ScAccessibleContextBase::release()
void ScAccessibleContextBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- if (rRef.GetId() == SFX_HINT_DYING)
+ if (pSimpleHint->GetId() == SFX_HINT_DYING)
{
// it seems the Broadcaster is dying, since the view is dying
dispose();
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index c38a8dc4df76..17fee2ad72d3 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -405,48 +405,45 @@ void ScChildrenShapes::SetDrawBroadcaster()
void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if ( rHint.ISA( SdrHint ) )
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- if (pSdrHint)
+ SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
+ if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) &&
+ (pObj->GetPage() == pObj->GetObjList()) ) //only do something if the object lies direct on the page
{
- SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
- if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) &&
- (pObj->GetPage() == pObj->GetObjList()) ) //only do something if the object lies direct on the page
+ switch (pSdrHint->GetKind())
{
- switch (pSdrHint->GetKind())
+ case HINT_OBJCHG : // Objekt geaendert
{
- case HINT_OBJCHG : // Objekt geaendert
+ uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
+ if (xShape.is())
{
- uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- if (xShape.is())
- {
- ScShapeDataLess aLess;
- std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), aLess); // sort, because the z index or layer could be changed
- CheckWhetherAnchorChanged(xShape);
- }
- }
- break;
- case HINT_OBJINSERTED : // Neues Zeichenobjekt eingefuegt
- {
- uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- if (xShape.is())
- AddShape(xShape, true);
- }
- break;
- case HINT_OBJREMOVED : // Zeichenobjekt aus Liste entfernt
- {
- uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
- if (xShape.is())
- RemoveShape(xShape);
- }
- break;
- default :
- {
- // other events are not interesting
+ ScShapeDataLess aLess;
+ std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), aLess); // sort, because the z index or layer could be changed
+ CheckWhetherAnchorChanged(xShape);
}
- break;
}
+ break;
+ case HINT_OBJINSERTED : // Neues Zeichenobjekt eingefuegt
+ {
+ uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
+ if (xShape.is())
+ AddShape(xShape, true);
+ }
+ break;
+ case HINT_OBJREMOVED : // Zeichenobjekt aus Liste entfernt
+ {
+ uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
+ if (xShape.is())
+ RemoveShape(xShape);
+ }
+ break;
+ default :
+ {
+ // other events are not interesting
+ }
+ break;
}
}
}
@@ -1516,10 +1513,10 @@ IMPL_LINK( ScAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEve
void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( ScAccGridWinFocusLostHint ) )
+ if (dynamic_cast<const ScAccGridWinFocusLostHint*>(&rHint) )
{
- const ScAccGridWinFocusLostHint& rRef = (const ScAccGridWinFocusLostHint&)rHint;
- if (rRef.GetOldGridWin() == meSplitPos)
+ const ScAccGridWinFocusLostHint* pFocusLostHint = static_cast<const ScAccGridWinFocusLostHint *>(&rHint);
+ if (pFocusLostHint->GetOldGridWin() == meSplitPos)
{
if (mxTempAcc.is() && mpTempAccEdit)
mpTempAccEdit->LostFocus();
@@ -1529,10 +1526,10 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusLost();
}
}
- else if (rHint.ISA( ScAccGridWinFocusGotHint ) )
+ else if (dynamic_cast<const ScAccGridWinFocusGotHint*>(&rHint) )
{
- const ScAccGridWinFocusGotHint& rRef = (const ScAccGridWinFocusGotHint&)rHint;
- if (rRef.GetNewGridWin() == meSplitPos)
+ const ScAccGridWinFocusGotHint* pFocusGotHint = static_cast<const ScAccGridWinFocusGotHint*>(&rHint);
+ if (pFocusGotHint->GetNewGridWin() == meSplitPos)
{
uno::Reference<XAccessible> xAccessible;
if (mpChildrenShapes)
@@ -1560,11 +1557,11 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if (rHint.ISA( SfxSimpleHint ))
+ else if (dynamic_cast<const SfxSimpleHint*>(&rHint))
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
+ const SfxSimpleHint* pSimpleHint = static_cast<const SfxSimpleHint*>(&rHint);
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_ACC_TABLECHANGED) &&
+ if ((pSimpleHint->GetId() == SC_HINT_ACC_TABLECHANGED) &&
mpAccessibleSpreadsheet)
{
FreeAccessibleSpreadsheet();
@@ -1588,12 +1585,12 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if (mpAccessibleSpreadsheet)
mpAccessibleSpreadsheet->FireFirstCellFocus();
}
- else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
if (mpChildrenShapes)
mpChildrenShapes->SetDrawBroadcaster();
}
- else if ((rRef.GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
+ else if ((pSimpleHint->GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
{
if (mpViewShell->GetViewData().HasEditView(meSplitPos))
{
@@ -1617,7 +1614,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if (rRef.GetId() == SC_HINT_ACC_LEAVEEDITMODE)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_LEAVEEDITMODE)
{
if (mxTempAcc.is())
{
@@ -1632,7 +1629,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusGained();
}
}
- else if ((rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) || (rRef.GetId() == SC_HINT_ACC_WINDOWRESIZED))
+ else if ((pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) || (pSimpleHint->GetId() == SC_HINT_ACC_WINDOWRESIZED))
{
Rectangle aOldVisArea(maVisArea);
maVisArea = GetVisibleArea_Impl();
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 1afaa5bfe0af..d4d7251a45d5 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -748,26 +748,23 @@ void ScShapeChildren::SetDrawBroadcaster()
void ScShapeChildren::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if ( rHint.ISA( SdrHint ) )
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
+ if (pSdrHint)
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- if (pSdrHint)
+ SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
+ if (pObj && (pObj->GetPage() == GetDrawPage()))
{
- SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
- if (pObj && (pObj->GetPage() == GetDrawPage()))
+ switch (pSdrHint->GetKind())
{
- switch (pSdrHint->GetKind())
+ case HINT_OBJCHG : // Objekt geaendert
{
- case HINT_OBJCHG : // Objekt geaendert
- {
- }
- break;
- default :
- {
- // other events are not interesting
- }
- break;
}
+ break;
+ default :
+ {
+ // other events are not interesting
+ }
+ break;
}
}
}
@@ -1298,11 +1295,11 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
{
if (mpTable) // if there is no table there is nothing to notify, because no one recongnizes the change
{
@@ -1352,11 +1349,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
}
}
}
- else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
GetShapeChildren()->SetDrawBroadcaster();
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
Size aOutputSize;
Window* pSizeWindow = mpViewShell->GetWindow();
@@ -1374,11 +1371,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
CommitChange(aEvent);
}
}
- else if ( rHint.ISA(ScAccWinFocusLostHint) )
+ else if ( dynamic_cast<const ScAccWinFocusLostHint*>(&rHint) )
{
CommitFocusLost();
}
- else if ( rHint.ISA(ScAccWinFocusGotHint) )
+ else if ( dynamic_cast<const ScAccWinFocusGotHint*>(&rHint) )
{
CommitFocusGained();
}
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index cd202683ba61..4eafb7a46005 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -123,11 +123,11 @@ void SAL_CALL ScAccessiblePageHeader::disposing()
void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
{
ScHFAreas aOldAreas(maAreas);
std::for_each(aOldAreas.begin(), aOldAreas.end(), Acquire());
@@ -161,7 +161,7 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
std::for_each(aOldAreas.begin(), aOldAreas.end(), Release());
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 78f8579726b5..68682e0675c2 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -90,11 +90,11 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing()
void ScAccessiblePageHeaderArea::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
mpTextHelper->UpdateChildren();
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index d2cc20171cf3..3f6b018126b1 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -81,14 +81,11 @@ void SAL_CALL ScAccessiblePreviewCell::disposing()
void ScAccessiblePreviewCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
- {
- if (mpTextHelper)
- mpTextHelper->UpdateChildren();
- }
+ if (mpTextHelper)
+ mpTextHelper->UpdateChildren();
}
ScAccessibleContextBase::Notify(rBC, rHint);
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index fdfa6eeb2834..12221e5d0117 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -115,10 +115,10 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- sal_uLong nId = rRef.GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if (nId == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index f8e0e99726a8..79a67150840b 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -87,17 +87,17 @@ void SAL_CALL ScAccessiblePreviewTable::disposing()
void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- sal_uLong nId = rRef.GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DATACHANGED )
{
// column / row layout may change with any document change,
// so it must be invalidated
DELETEZ( mpTableInfo );
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index ef9b834054e5..896d2bd6abee 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -418,10 +418,10 @@ void ScAccessibleSpreadsheet::VisAreaChanged()
void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- if ((rRef.GetId() == SC_HINT_ACC_CURSORCHANGED))
+ if (pSimpleHint->GetId() == SC_HINT_ACC_CURSORCHANGED)
{
if (mpViewShell)
{
@@ -432,7 +432,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
{
NotifyRefMode();
m_bFormulaLastMode = true;
- return ;
+ return;
}
if (m_bFormulaLastMode)
{//Last Notify Mode Is Formula Mode.
@@ -599,7 +599,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
m_LastMarkedRanges = *mpMarkedRanges;
}
}
- else if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ else if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
{
if (!mbDelIns)
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
@@ -657,9 +657,9 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}*/
}
- else if (rHint.ISA( ScUpdateRefHint ))
+ else if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
+ const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint);
if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //test whether table is inserted or deleted
{
if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index a6bf37e629f8..3dc8ba52fdd7 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -729,9 +729,10 @@ ScAccessibleCellTextData::~ScAccessibleCellTextData()
void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -991,9 +992,10 @@ ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData()
void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpWindow = NULL;
@@ -1254,9 +1256,10 @@ ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData()
void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -1331,9 +1334,10 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData()
void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -1453,9 +1457,10 @@ ScAccessibleTextData* ScAccessibleHeaderTextData::Clone() const
void ScAccessibleHeaderTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL;// invalid now
@@ -1567,9 +1572,10 @@ ScAccessibleTextData* ScAccessibleNoteTextData::Clone() const
void ScAccessibleNoteTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL;// invalid now
@@ -1707,9 +1713,10 @@ ScAccessibleCsvTextData::~ScAccessibleCsvTextData()
void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if( nId == SFX_HINT_DYING )
{
mpWindow = NULL;
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index 56c028b17ba2..844bf114e222 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -54,7 +54,7 @@ void SAL_CALL ScDrawModelBroadcaster::removeEventListener( const uno::Reference<
void ScDrawModelBroadcaster::Notify( SfxBroadcaster&,
const SfxHint& rHint )
{
- const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if( !pSdrHint )
return;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 37cf7d53a977..ee993c14ce70 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2205,15 +2205,16 @@ void ScPosWnd::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( !bFormulaMode )
{
// Does the list of range names need updating?
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSimpleHint->GetId();
if ( nHintId == SC_HINT_AREAS_CHANGED || nHintId == SC_HINT_NAVIGATOR_UPDATEALL)
FillRangeNames();
}
- else if ( rHint.ISA(SfxEventHint) )
+ else if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = static_cast<const SfxEventHint*>(&rHint)->GetEventId();
if ( nEventId == SFX_EVENT_ACTIVATEDOC )
FillRangeNames();
}
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 72ccfbd12a7b..213782e88d56 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -321,9 +321,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
void ScModule::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSimpleHint->GetId();
if ( nHintId == SFX_HINT_DEINITIALIZING )
{
// ConfigItems must be removed before ConfigManager
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index 9b12278b7b35..e2c3e89b968c 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -37,9 +37,6 @@ TYPEINIT1(ScPivotItem, SfxPoolItem);
TYPEINIT1(ScSolveItem, SfxPoolItem);
TYPEINIT1(ScTabOpItem, SfxPoolItem);
-TYPEINIT1(ScTablesHint, SfxHint);
-TYPEINIT1(ScEditViewHint, SfxHint);
-TYPEINIT1(ScIndexHint, SfxHint);
/**
* Status update for entry field
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index d8b33a23f2fa..fa54d2afce6e 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -459,7 +459,7 @@ void UpdateStyleList(ListBox& rLbStyle, ScDocument* pDoc)
void ScConditionFrmtEntry::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- SfxStyleSheetHint* pHint = PTR_CAST(SfxStyleSheetHint, &rHint);
+ const SfxStyleSheetHint* pHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
if(!pHint)
return;
@@ -1286,7 +1286,7 @@ void ScDateFrmtEntry::SetInactive()
void ScDateFrmtEntry::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- SfxStyleSheetHint* pHint = PTR_CAST(SfxStyleSheetHint, &rHint);
+ const SfxStyleSheetHint* pHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
if(!pHint)
return;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 7c4721284eb1..0d06c524622c 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -599,16 +599,16 @@ bool ScDocShell::Load( SfxMedium& rMedium )
void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (rHint.ISA(ScTablesHint) )
+ const ScTablesHint* pScHint = dynamic_cast< const ScTablesHint* >( &rHint );
+ if (pScHint)
{
- const ScTablesHint& rScHint = static_cast< const ScTablesHint& >( rHint );
- if (rScHint.GetId() == SC_TAB_INSERTED)
+ if (pScHint->GetId() == SC_TAB_INSERTED)
{
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = aDocument.GetVbaEventProcessor();
if ( xVbaEvents.is() ) try
{
uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[0] <<= rScHint.GetTab1();
+ aArgs[0] <<= pScHint->GetTab1();
xVbaEvents->processVbaEvent( script::vba::VBAEventId::WORKBOOK_NEWSHEET, aArgs );
}
catch( uno::Exception& )
@@ -617,9 +617,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
- if (rHint.ISA(SfxSimpleHint)) // Without parameter
+ if ( dynamic_cast<const SfxSimpleHint*>(&rHint) ) // Without parameter
{
- sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nSlot = static_cast<const SfxSimpleHint&>(rHint).GetId();
switch ( nSlot )
{
case SFX_HINT_TITLECHANGED:
@@ -629,9 +629,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(SfxStyleSheetHint)) // Template changed
- NotifyStyle((const SfxStyleSheetHint&) rHint);
- else if (rHint.ISA(ScAutoStyleHint))
+ else if ( dynamic_cast<const SfxStyleSheetHint*>(&rHint) ) // Template changed
+ NotifyStyle( static_cast<const SfxStyleSheetHint&>(rHint) );
+ else if ( dynamic_cast<const ScAutoStyleHint*>(&rHint) )
{
//! direct call for AutoStyles
@@ -649,9 +649,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
pAutoStyleList = new ScAutoStyleList(this);
pAutoStyleList->AddInitial( aRange, aName1, nTimeout, aName2 );
}
- else if ( rHint.ISA( SfxEventHint ) )
+ else if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = static_cast<const SfxEventHint*>(&rHint)->GetEventId();
switch ( nEventId )
{
case SFX_EVENT_LOADFINISHED:
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ea1409111256..13aa479e23a0 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1292,9 +1292,9 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
OUString aNewName = pStyle->GetName();
OUString aOldName = aNewName;
- bool bExtended = rHint.ISA(SfxStyleSheetHintExtended); // Name geaendert?
- if (bExtended)
- aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
+ const SfxStyleSheetHintExtended* pExtendedHint = dynamic_cast<const SfxStyleSheetHintExtended*>(&rHint); // Name geaendert?
+ if (pExtendedHint)
+ aOldName = pExtendedHint->GetOldName();
if ( aNewName != aOldName )
aDocument.RenamePageStyleInUse( aOldName, aNewName );
@@ -1310,7 +1310,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
aModificator.SetDocumentModified();
- if (bExtended)
+ if (pExtendedHint)
{
SfxBindings* pBindings = GetViewBindings();
if (pBindings)
@@ -1330,9 +1330,9 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
OUString aNewName = pStyle->GetName();
OUString aOldName = aNewName;
- bool bExtended = rHint.ISA(SfxStyleSheetHintExtended);
- if (bExtended)
- aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
+ const SfxStyleSheetHintExtended* pExtendedHint = dynamic_cast<const SfxStyleSheetHintExtended*>(&rHint);
+ if (pExtendedHint)
+ aOldName = pExtendedHint->GetOldName();
if ( aNewName != aOldName )
{
for(SCTAB i = 0; i < aDocument.GetTableCount(); ++i)
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 6757d36291e8..adcf1e98e931 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -3012,9 +3012,10 @@ void ScExternalRefManager::transformUnsavedRefToSavedRef( SfxObjectShell* pShell
void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxEventHint ) )
+ const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
+ if ( pEventHint )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = pEventHint->GetEventId();
switch ( nEventId )
{
case SFX_EVENT_PREPARECLOSEDOC:
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 39d3ee1494df..664887ee59af 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -203,7 +203,8 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if ( &rBC == pDocSh )
{
// from DocShell, only SFX_HINT_DYING is interesting
- if ( rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocSh = NULL;
EndListening(*SfxGetpApp());
@@ -212,8 +213,9 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else if (rBC.ISA(SfxApplication))
{
- if ( !aItemStr.isEmpty() && rHint.ISA(SfxSimpleHint) &&
- ((const SfxSimpleHint&)rHint).GetId() == SC_HINT_AREAS_CHANGED )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if ( !aItemStr.isEmpty() && pSimpleHint &&
+ pSimpleHint->GetId() == SC_HINT_AREAS_CHANGED )
{
// check if named range was modified
ScRange aNew;
@@ -225,21 +227,21 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// must be from Area broadcasters
- const ScHint* pScHint = PTR_CAST( ScHint, &rHint );
+ const ScHint* pScHint = dynamic_cast<const ScHint*>( &rHint );
if (pScHint && (pScHint->GetId() & SC_HINT_DATACHANGED))
bDataChanged = true;
- else if (rHint.ISA(ScAreaChangedHint)) // position of broadcaster changed
+ else if ( dynamic_cast<const ScAreaChangedHint*>(&rHint) ) // position of broadcaster changed
{
- ScRange aNewRange = ((const ScAreaChangedHint&)rHint).GetRange();
+ ScRange aNewRange = static_cast<const ScAreaChangedHint&>(rHint).GetRange();
if ( aRange != aNewRange )
{
bRefreshListener = true;
bDataChanged = true;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId();
if (nId == SFX_HINT_DYING)
{
// If the range is being deleted, listening must be restarted
diff --git a/sc/source/ui/inc/AccessibilityHints.hxx b/sc/source/ui/inc/AccessibilityHints.hxx
index 4161442a6eea..dcba897768a2 100644
--- a/sc/source/ui/inc/AccessibilityHints.hxx
+++ b/sc/source/ui/inc/AccessibilityHints.hxx
@@ -39,7 +39,6 @@ class ScAccWinFocusLostHint : public SfxHint
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
xOldAccessible;
public:
- TYPEINFO_OVERRIDE();
ScAccWinFocusLostHint(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld );
virtual ~ScAccWinFocusLostHint();
@@ -53,7 +52,6 @@ class ScAccWinFocusGotHint : public SfxHint
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
xNewAccessible;
public:
- TYPEINFO_OVERRIDE();
ScAccWinFocusGotHint(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew );
virtual ~ScAccWinFocusGotHint();
@@ -66,7 +64,6 @@ class ScAccGridWinFocusLostHint : public ScAccWinFocusLostHint
{
ScSplitPos eOldGridWin;
public:
- TYPEINFO_OVERRIDE();
ScAccGridWinFocusLostHint( ScSplitPos eOldGridWin,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld );
virtual ~ScAccGridWinFocusLostHint();
@@ -78,7 +75,6 @@ class ScAccGridWinFocusGotHint : public ScAccWinFocusGotHint
{
ScSplitPos eNewGridWin;
public:
- TYPEINFO_OVERRIDE();
ScAccGridWinFocusGotHint( ScSplitPos eNewGridWin,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew );
virtual ~ScAccGridWinFocusGotHint();
diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx
index 0cbbbb221204..ae988e6dd84e 100644
--- a/sc/source/ui/inc/uiitems.hxx
+++ b/sc/source/ui/inc/uiitems.hxx
@@ -101,11 +101,10 @@ class ScTablesHint : public SfxHint
SCTAB nTab2;
public:
- TYPEINFO_OVERRIDE();
ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
virtual ~ScTablesHint();
- sal_uInt16 GetId() const { return nId; }
+ sal_uInt16 GetId() const { return nId; }
SCTAB GetTab1() const { return nTab1; }
SCTAB GetTab2() const { return nTab2; }
};
@@ -116,7 +115,6 @@ class ScEditViewHint : public SfxHint
ScAddress aCursorPos;
public:
- TYPEINFO_OVERRIDE();
ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
virtual ~ScEditViewHint();
@@ -135,12 +133,11 @@ class ScIndexHint : public SfxHint
sal_uInt16 nIndex;
public:
- TYPEINFO_OVERRIDE();
ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx);
virtual ~ScIndexHint();
- sal_uInt16 GetId() const { return nId; }
- sal_uInt16 GetIndex() const { return nIndex; }
+ sal_uInt16 GetId() const { return nId; }
+ sal_uInt16 GetIndex() const { return nIndex; }
};
// Parameter item for the sort dialog:
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index a2191840d5ae..f60f4b25d804 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -810,9 +810,10 @@ void ScNavigatorDlg::DoResize()
void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if ( pSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSimpleHint->GetId();
if ( nHintId == SC_HINT_DOCNAME_CHANGED )
{
@@ -868,9 +869,9 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA(SfxEventHint) )
+ else if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = static_cast<const SfxEventHint&>(rHint).GetEventId();
if ( nEventId == SFX_EVENT_ACTIVATEDOC )
{
aLbEntries.ActiveDocChanged();
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index d7a273c240da..a9dd77d18066 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -48,8 +48,8 @@ ScAddressConversionObj::~ScAddressConversionObj()
void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // invalid
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 5e859a869f2b..1089af3ee3d5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1527,7 +1527,7 @@ const ScMarkData* ScCellRangesBase::GetMarkData()
void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
@@ -1567,7 +1567,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
rDoc.AddUnoRefChange( nObjectId, *pUndoRanges );
}
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
@@ -1626,7 +1626,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
bGotDataChangedHint = true;
}
}
- else if ( rHint.ISA( ScUnoRefUndoHint ) )
+ else if ( dynamic_cast<const ScUnoRefUndoHint*>(&rHint) )
{
const ScUnoRefUndoHint& rUndoHint = static_cast<const ScUnoRefUndoHint&>(rHint);
if ( rUndoHint.GetObjectId() == nObjectId )
@@ -2747,7 +2747,7 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence<
IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
{
- if ( pDocShell && pHint && pHint->ISA( SfxSimpleHint ) &&
+ if ( pDocShell && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) &&
(((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED))
{
// This may be called several times for a single change, if several formulas
@@ -9002,13 +9002,13 @@ ScCellsObj::~ScCellsObj()
void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
aRanges.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
@@ -9120,13 +9120,13 @@ void ScCellsEnumeration::Advance_Impl()
void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pRefHint = dynamic_cast<const ScUpdateRefHint*>(&rHint);
+ if ( pRefHint )
{
if (pDocShell)
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- aRanges.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
- rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
+ aRanges.UpdateReference( pRefHint->GetMode(), &pDocShell->GetDocument(), pRefHint->GetRange(),
+ pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() );
delete pMark; // aus verschobenen Bereichen neu erzeugen
pMark = NULL;
@@ -9135,8 +9135,8 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
ScRangeList aNew;
aNew.Append(ScRange(aPos));
- aNew.UpdateReference( rRef.GetMode(), &pDocShell->GetDocument(), rRef.GetRange(),
- rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
+ aNew.UpdateReference( pRefHint->GetMode(), &pDocShell->GetDocument(), pRefHint->GetRange(),
+ pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() );
if (aNew.size()==1)
{
aPos = aNew[ 0 ]->aStart;
@@ -9145,8 +9145,8 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
+ static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -9194,12 +9194,12 @@ ScCellFormatsObj::~ScCellFormatsObj()
void ScCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! aTotalRange...
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
+ static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -9361,13 +9361,13 @@ ScCellRangeObj* ScCellFormatsEnumeration::NextObject_Impl()
void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! und nun ???
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId();
if ( nId == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
@@ -9422,13 +9422,13 @@ ScUniqueCellFormatsObj::~ScUniqueCellFormatsObj()
void ScUniqueCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! aTotalRange...
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId();
if ( nId == SFX_HINT_DYING )
pDocShell = NULL; // ungueltig geworden
}
@@ -9678,11 +9678,11 @@ ScUniqueCellFormatsEnumeration::~ScUniqueCellFormatsEnumeration()
void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! und nun ???
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 55d4c542d091..7ba85d176556 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1017,8 +1017,8 @@ ScChart2DataProvider::~ScChart2DataProvider()
void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
m_pDocument = NULL;
}
@@ -2417,8 +2417,8 @@ ScChart2DataSource::~ScChart2DataSource()
void ScChart2DataSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
m_pDocument = NULL;
}
@@ -2839,9 +2839,10 @@ void ScChart2DataSequence::CopyData(const ScChart2DataSequence& r)
void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId ==SFX_HINT_DYING )
{
m_pDocument = NULL;
@@ -2874,7 +2875,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
m_bGotDataChangedHint = true;
}
}
- else if ( rHint.ISA( ScUpdateRefHint ) )
+ else if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
// Create a range list from the token list, have the range list
// updated, and bring the change back to the token list.
@@ -2919,7 +2920,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
m_pDocument->AddUnoRefChange(m_nObjectId, *pUndoRanges);
}
}
- else if ( rHint.ISA( ScUnoRefUndoHint ) )
+ else if ( dynamic_cast<const ScUnoRefUndoHint*>(&rHint) )
{
const ScUnoRefUndoHint& rUndoHint = static_cast<const ScUnoRefUndoHint&>(rHint);
@@ -2954,7 +2955,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
{
- if ( m_pDocument && pHint && pHint->ISA( SfxSimpleHint ) &&
+ if ( m_pDocument && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) &&
((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED)
{
// This may be called several times for a single change, if several formulas
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 155f14641775..9750e70d9e8e 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -104,8 +104,8 @@ void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -463,8 +463,8 @@ void ScChartObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 9b838fe8b2a0..5891036bb6c5 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -97,8 +97,8 @@ void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index cd4e0a2b1652..59c5c5a4956d 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -296,8 +296,8 @@ void ScDataPilotTablesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -639,8 +639,8 @@ void ScDataPilotDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update?
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1338,12 +1338,12 @@ void SAL_CALL ScDataPilotTableObj::removeModifyListener( const uno::Reference<ut
void ScDataPilotTableObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA(ScDataPilotModifiedHint) &&
+ if ( dynamic_cast<const ScDataPilotModifiedHint*>(&rHint) &&
static_cast<const ScDataPilotModifiedHint&>(rHint).GetName() == aName )
{
Refreshed_Impl();
}
- else if ( rHint.ISA( ScUpdateRefHint ) )
+ else if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
ScRange aRange( 0, 0, nTab );
ScRangeList aRanges;
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 0dc0bcf639ba..bcf8c77eb037 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1004,9 +1004,10 @@ ScFilterDescriptorBase::~ScFilterDescriptorBase()
void ScFilterDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
pDocSh = NULL; // invalid
@@ -1659,9 +1660,10 @@ ScDatabaseRangeObj::~ScDatabaseRangeObj()
void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // ungueltig geworden
- else if ( rHint.ISA (ScDBRangeRefreshedHint) )
+ else if ( dynamic_cast<const ScDBRangeRefreshedHint*>(&rHint) )
{
ScDBData* pDBData = GetDBData_Impl();
const ScDBRangeRefreshedHint& rRef = (const ScDBRangeRefreshedHint&)rHint;
@@ -2216,8 +2218,8 @@ void ScDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -2411,8 +2413,8 @@ void ScUnnamedDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index a091677a8d99..8c098aff5aa1 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -88,8 +88,8 @@ ScDocDefaultsObj::~ScDocDefaultsObj()
void ScDocDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index c1c178ad8397..ff084b900688 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -83,8 +83,8 @@ ScDispatchProviderInterceptor::~ScDispatchProviderInterceptor()
void ScDispatchProviderInterceptor::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pViewShell = NULL;
}
@@ -210,8 +210,8 @@ ScDispatch::~ScDispatch()
void ScDispatch::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pViewShell = NULL;
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2893974ced06..c4c5b0a71e78 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -598,9 +598,10 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// Not interested in reference update hints here
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
pDocShell = NULL; // has become invalid
@@ -640,7 +641,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA( ScPointerChangedHint ) )
+ else if ( dynamic_cast<const ScPointerChangedHint*>(&rHint) )
{
sal_uInt16 nFlags = ((const ScPointerChangedHint&)rHint).GetFlags();
if (nFlags & SC_POINTERCHANGED_NUMFMT)
@@ -2432,8 +2433,8 @@ void ScDrawPagesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -2542,8 +2543,8 @@ void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -2948,11 +2949,11 @@ ScTableColumnsObj::~ScTableColumnsObj()
void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
@@ -3214,11 +3215,11 @@ ScTableRowsObj::~ScTableRowsObj()
void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
@@ -3491,8 +3492,8 @@ void ScSpreadsheetSettingsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -3543,8 +3544,8 @@ void ScAnnotationsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! nTab bei Referenz-Update anpassen!!!
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -3671,11 +3672,11 @@ ScScenariosObj::~ScScenariosObj()
void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 1604dc437ef7..d27a29320179 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -41,8 +41,8 @@ ScDrawDefaultsObj::~ScDrawDefaultsObj() throw ()
void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index 2f6e9a955b1d..d642c8a13e20 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -192,11 +192,11 @@ void ScAnnotationEditSource::UpdateData()
void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index ab62b5397a50..79e2971fd3fd 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -44,8 +44,8 @@ ScSheetEventsObj::~ScSheetEventsObj()
void ScSheetEventsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! reference update
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
mpDocShell = NULL;
}
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 1eb650134bda..4e3a4b7f7c37 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -311,11 +311,11 @@ ScCellFieldsObj::~ScCellFieldsObj()
void ScCellFieldsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index bfaa5a2196b9..6f1562fd67f1 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -59,8 +59,8 @@ ScForbiddenCharsObj::~ScForbiddenCharsObj()
void ScForbiddenCharsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 4d4a9b723c50..d2d3583653fc 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -189,8 +189,8 @@ ScFunctionAccess::~ScFunctionAccess()
void ScFunctionAccess::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) &&
- ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DEINITIALIZING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DEINITIALIZING )
{
// document must not be used anymore
aDocCache.Clear();
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 18a4a2c4f1b1..2f895d80bb80 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -91,12 +91,13 @@ void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
//! notify if links in document are changed
// UpdateRef is not needed here
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) )
{
const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
if ( rLH.GetLinkType() == SC_LINKREFTYPE_SHEET && rLH.GetUrl() == aFileName )
@@ -387,8 +388,8 @@ void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -615,12 +616,13 @@ void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
//! notify if links in document are changed
// UpdateRef is not needed here
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) )
{
const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
if ( rLH.GetLinkType() == SC_LINKREFTYPE_AREA )
@@ -929,8 +931,8 @@ void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1056,12 +1058,13 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
//! notify if links in document are changed
// UpdateRef is not needed here
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else if ( dynamic_cast<const ScLinkRefreshedHint*>(&rHint) )
{
const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
if ( rLH.GetLinkType() == SC_LINKREFTYPE_DDE &&
@@ -1251,8 +1254,8 @@ void ScDDELinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index ff09c0e675e5..4989cd07a6da 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -100,7 +100,8 @@ void ScNamedRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// reference update is of no interest
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // became invalid
}
@@ -480,8 +481,8 @@ void ScNamedRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// reference update is of no interest
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // became invalid
}
@@ -942,7 +943,8 @@ void ScLabelRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Ref-Update !!!
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // became invalid
}
@@ -1060,8 +1062,8 @@ void ScLabelRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// reference update is of no interest
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // became invalid
}
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index ca70be593a2a..fed3a83f161f 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -77,13 +77,13 @@ ScAnnotationObj::~ScAnnotationObj()
void ScAnnotationObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) &&
((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index bd88df76eac8..a79af3dbeb67 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -411,8 +411,8 @@ void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -626,8 +626,8 @@ void ScStyleFamilyObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1016,8 +1016,8 @@ void ScStyleObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 84beb009ede8..9ec5b0e416c2 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -81,7 +81,8 @@ ScLinkTargetTypesObj::~ScLinkTargetTypesObj()
void ScLinkTargetTypesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // document gone
}
@@ -147,7 +148,8 @@ ScLinkTargetTypeObj::~ScLinkTargetTypeObj()
void ScLinkTargetTypeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 4bbf90522451..841f6fa6311d 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -1021,13 +1021,13 @@ void ScCellTextData::UpdateData()
void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index f739a5ef4d14..74396315a16c 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -78,7 +78,8 @@ ScFormulaParserObj::~ScFormulaParserObj()
void ScFormulaParserObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
mpDocShell = NULL;
}
diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx
index c9689a0017d7..598b25bfcf94 100644
--- a/sc/source/ui/unoobj/unoreflist.cxx
+++ b/sc/source/ui/unoobj/unoreflist.cxx
@@ -44,8 +44,6 @@ void ScUnoRefList::Undo( ScDocument* pDoc )
}
}
-TYPEINIT1(ScUnoRefUndoHint, SfxHint);
-
ScUnoRefUndoHint::ScUnoRefUndoHint( const ScUnoRefEntry& rRefEntry ) :
aEntry( rRefEntry )
{
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index fcbdceaf9ba1..9a255233e384 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -135,8 +135,8 @@ ScViewPaneBase::~ScViewPaneBase()
void ScViewPaneBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pViewShell = NULL;
}
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index f4a702525df3..2d23728a16e4 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -162,7 +162,7 @@ void adjustAnchoredPosition(const SdrHint& rHint, const ScDocument& rDoc, SCTAB
void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA(ScTabDeletedHint)) // Tabelle geloescht
+ if (dynamic_cast<const ScTabDeletedHint*>(&rHint)) // Tabelle geloescht
{
SCTAB nDelTab = ((ScTabDeletedHint&)rHint).GetTab();
if (ValidTab(nDelTab))
@@ -172,15 +172,14 @@ void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
HideSdrPage();
}
}
- else if (rHint.ISA(ScTabSizeChangedHint)) // Groesse geaendert
+ else if (dynamic_cast<const ScTabSizeChangedHint*>(&rHint)) // Groesse geaendert
{
if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
UpdateWorkArea();
}
- else if ( rHint.ISA( SdrHint ) )
+ else if ( const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint ) )
{
- if (const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ))
- adjustAnchoredPosition(*pSdrHint, *pDoc, nTab);
+ adjustAnchoredPosition(*pSdrHint, *pDoc, nTab);
FmFormView::Notify( rBC,rHint );
}
else
diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx
index 136c797939b2..1c10cc9c0174 100644
--- a/sc/source/ui/view/prevwsh2.cxx
+++ b/sc/source/ui/view/prevwsh2.cxx
@@ -32,7 +32,7 @@ void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
bool bDataChanged = false;
- if (rHint.ISA(SfxSimpleHint))
+ if (dynamic_cast<const SfxSimpleHint*>(&rHint))
{
sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
switch ( nSlot )
@@ -50,7 +50,7 @@ void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(ScPaintHint))
+ else if (dynamic_cast<const ScPaintHint*>(&rHint))
{
if ( ((const ScPaintHint&)rHint).GetPrintFlag() )
{
@@ -59,7 +59,7 @@ void ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
bDataChanged = true;
}
}
- else if (rHint.ISA(SdrHint))
+ else if (dynamic_cast<const SdrHint*>(&rHint))
{
// SdrHints are no longer used for invalidating, thus react on objectchange instead
if(HINT_OBJCHG == ((const SdrHint&)rHint).GetKind())
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 53223c4e5853..e2c77bd65011 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -42,7 +42,7 @@
void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
+ if (dynamic_cast<const SfxSimpleHint*>(&rHint)) // ohne Parameter
{
sal_uLong nSlot = ((SfxSimpleHint&)rHint).GetId();
switch ( nSlot )
@@ -131,7 +131,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(ScPaintHint)) // neu zeichnen
+ else if (dynamic_cast<const ScPaintHint*>(&rHint)) // neu zeichnen
{
ScPaintHint* pHint = (ScPaintHint*) &rHint;
sal_uInt16 nParts = pHint->GetParts();
@@ -166,7 +166,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
HideNoteMarker();
}
}
- else if (rHint.ISA(ScEditViewHint)) // Edit-View anlegen
+ else if (dynamic_cast<const ScEditViewHint*>(&rHint)) // Edit-View anlegen
{
// ScEditViewHint kommt nur an aktiver View an
@@ -197,7 +197,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if (rHint.ISA(ScTablesHint)) // Tabelle eingefuegt / geloescht
+ else if (dynamic_cast<const ScTablesHint*>(&rHint)) // Tabelle eingefuegt / geloescht
{
// aktuelle Tabelle zuerst holen (kann bei DeleteTab an ViewData geaendert werden)
SCTAB nActiveTab = GetViewData().GetTabNo();
@@ -288,7 +288,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
bool bForce = !bStayOnActiveTab;
SetTabNo( nNewTab, bForce, false, bStayOnActiveTab );
}
- else if (rHint.ISA(ScIndexHint))
+ else if (dynamic_cast<const ScIndexHint*>(&rHint))
{
const ScIndexHint& rIndexHint = (const ScIndexHint&)rHint;
sal_uInt16 nId = rIndexHint.GetId();