summaryrefslogtreecommitdiff
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
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>
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx6
-rw-r--r--basctl/source/dlged/dlged.cxx2
-rw-r--r--basctl/source/inc/dlged.hxx1
-rw-r--r--basic/source/classes/sb.cxx2
-rw-r--r--basic/source/classes/sbunoobj.cxx8
-rw-r--r--basic/source/classes/sbxmod.cxx4
-rw-r--r--basic/source/runtime/stdobj.cxx2
-rw-r--r--basic/source/runtime/stdobj1.cxx6
-rw-r--r--basic/source/sbx/sbxcoll.cxx2
-rw-r--r--basic/source/sbx/sbxobj.cxx2
-rw-r--r--basic/source/sbx/sbxvar.cxx3
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx5
-rw-r--r--editeng/source/editeng/impedit5.cxx14
-rw-r--r--editeng/source/uno/unoedhlp.cxx5
-rw-r--r--include/basic/sbx.hxx1
-rw-r--r--include/editeng/unoedhlp.hxx2
-rw-r--r--include/sfx2/event.hxx9
-rw-r--r--include/svl/hint.hxx5
-rw-r--r--include/svl/isethint.hxx2
-rw-r--r--include/svl/smplhint.hxx5
-rw-r--r--include/svl/style.hxx14
-rw-r--r--include/svx/fmshell.hxx1
-rw-r--r--include/svx/svdmodel.hxx2
-rw-r--r--include/svx/svdpntv.hxx5
-rw-r--r--include/vcl/textdata.hxx2
-rw-r--r--reportdesign/inc/RptObject.hxx1
-rw-r--r--reportdesign/source/core/sdr/RptObjectListener.cxx4
-rw-r--r--reportdesign/source/core/sdr/UndoEnv.cxx3
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx5
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx5
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx7
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx5
-rw-r--r--sc/inc/brdcst.hxx3
-rw-r--r--sc/inc/drwlayer.hxx2
-rw-r--r--sc/inc/hints.hxx8
-rw-r--r--sc/inc/unoreflist.hxx1
-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
-rw-r--r--scripting/source/basprov/basscript.cxx2
-rw-r--r--sd/source/core/stlsheet.cxx5
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx10
-rw-r--r--sd/source/ui/app/sdmod.cxx4
-rw-r--r--sd/source/ui/dlg/docprev.cxx3
-rw-r--r--sd/source/ui/inc/ViewShellHint.hxx2
-rw-r--r--sd/source/ui/sidebar/MasterPageObserver.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.cxx16
-rw-r--r--sd/source/ui/slidesorter/controller/SlsTransferableData.cxx6
-rw-r--r--sd/source/ui/tools/EventMultiplexer.cxx16
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx21
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx6
-rw-r--r--sd/source/ui/unoidl/unopback.cxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx5
-rw-r--r--sd/source/ui/view/ViewShellHint.cxx2
-rw-r--r--sd/source/ui/view/drawview.cxx2
-rw-r--r--sfx2/source/appl/appcfg.cxx2
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx9
-rw-r--r--sfx2/source/config/evntconf.cxx2
-rw-r--r--sfx2/source/control/request.cxx2
-rw-r--r--sfx2/source/dialog/basedlgs.cxx10
-rw-r--r--sfx2/source/dialog/templdlg.cxx13
-rw-r--r--sfx2/source/doc/printhelper.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx15
-rw-r--r--sfx2/source/view/viewprn.cxx7
-rw-r--r--sfx2/source/view/viewsh.cxx5
-rw-r--r--starmath/source/view.cxx5
-rw-r--r--svl/Library_svl.mk1
-rw-r--r--svl/source/items/style.cxx4
-rw-r--r--svl/source/notify/hint.cxx2
-rw-r--r--svl/source/notify/isethint.cxx3
-rw-r--r--svl/source/notify/smplhint.cxx24
-rw-r--r--svtools/source/config/accessibilityoptions.cxx5
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx24
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx4
-rw-r--r--svx/source/dialog/svxruler.cxx5
-rw-r--r--svx/source/form/filtnav.cxx30
-rw-r--r--svx/source/form/fmexpl.cxx19
-rw-r--r--svx/source/form/fmshell.cxx3
-rw-r--r--svx/source/form/fmundo.cxx12
-rw-r--r--svx/source/form/fmvwimp.cxx5
-rw-r--r--svx/source/form/navigatortree.cxx22
-rw-r--r--svx/source/form/navigatortreemodel.cxx10
-rw-r--r--svx/source/inc/fmexpl.hxx11
-rw-r--r--svx/source/mnuctrls/fntctl.cxx5
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx2
-rw-r--r--svx/source/sdr/properties/customshapeproperties.cxx4
-rw-r--r--svx/source/sdr/properties/textproperties.cxx4
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx2
-rw-r--r--svx/source/svdraw/svdmrkv.cxx4
-rw-r--r--svx/source/svdraw/svdoattr.cxx2
-rw-r--r--svx/source/svdraw/svdoedge.cxx5
-rw-r--r--svx/source/svdraw/svdpntv.cxx9
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx2
-rw-r--r--svx/source/unodraw/UnoNameItemTable.cxx2
-rw-r--r--svx/source/unodraw/unomtabl.cxx2
-rw-r--r--svx/source/unodraw/unoshape.cxx2
-rw-r--r--svx/source/unodraw/unoshtxt.cxx6
-rw-r--r--sw/inc/fmtfld.hxx1
-rw-r--r--sw/inc/redline.hxx1
-rw-r--r--sw/source/core/access/accmap.cxx2
-rw-r--r--sw/source/core/doc/docredln.cxx2
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx4
-rw-r--r--sw/source/core/txtnode/atrfld.cxx1
-rw-r--r--sw/source/core/unocore/unostyle.cxx4
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
-rw-r--r--sw/source/uibase/app/apphdl.cxx6
-rw-r--r--sw/source/uibase/app/docsh2.cxx6
-rw-r--r--sw/source/uibase/app/docstyle.cxx7
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx6
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx2
-rw-r--r--sw/source/uibase/uiview/srcview.cxx7
-rw-r--r--sw/source/uibase/uiview/view.cxx4
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx7
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx6
-rw-r--r--sw/source/uibase/utlui/navipi.cxx4
-rw-r--r--vcl/source/edit/textdata.cxx2
-rw-r--r--vcl/source/edit/vclmedit.cxx16
175 files changed, 584 insertions, 747 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 7d8001318cf4..4a829707b77f 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1560,10 +1560,10 @@ void SAL_CALL Document::disposing()
// virtual
void Document::Notify(::SfxBroadcaster &, ::SfxHint const & rHint)
{
- if (rHint.ISA(::TextHint))
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
+ if (pTextHint)
{
- ::TextHint const & rTextHint
- = static_cast< ::TextHint const & >(rHint);
+ ::TextHint const & rTextHint = *pTextHint;
switch (rTextHint.GetId())
{
case TEXT_HINT_PARAINSERTED:
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 41230f6439e8..b43f798739f9 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -66,8 +66,6 @@ static OUString aTitlePropName( "Title" );
// DlgEdHint
-TYPEINIT1( DlgEdHint, SfxHint );
-
DlgEdHint::DlgEdHint(Kind eHint)
: eKind(eHint)
, pDlgEdObj(0)
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index 8c75e5e6180d..c0e5c95ecc47 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -69,7 +69,6 @@ private:
DlgEdObj* pDlgEdObj;
public:
- TYPEINFO_OVERRIDE();
DlgEdHint (Kind);
DlgEdHint (Kind, DlgEdObj* pObj);
virtual ~DlgEdHint();
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index db8487d21574..04303b3b2317 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -2100,7 +2100,7 @@ SbxVariable* BasicCollection::Find( const OUString& rName, SbxClassType t )
void BasicCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1,
const SfxHint& rHint, const TypeId& rId2 )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint);
if( p )
{
sal_uIntPtr nId = p->GetId();
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 8a5e761ba47e..9a37a8480a40 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2030,7 +2030,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
if( bNeedIntrospection )
doIntrospection();
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
@@ -3617,7 +3617,7 @@ SbxVariable* SbUnoService::Find( const OUString& rName, SbxClassType )
void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
@@ -3838,7 +3838,7 @@ SbUnoSingleton::SbUnoSingleton( const OUString& aName_,
void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
@@ -5012,7 +5012,7 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
{
if ( !mbMemberCacheInit )
initMemberCache();
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 6f1332fb668b..2ae87f32f3e8 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -747,7 +747,7 @@ void SbModule::SetParent( SbxObject* p )
void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
@@ -1892,7 +1892,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
{
bool bDone = false;
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 9a69beadcd1c..da9edc2111d0 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -821,7 +821,7 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index 061aa646f038..3f52a8a19b2a 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -144,7 +144,7 @@ void SbStdPicture::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
@@ -269,7 +269,7 @@ SbxVariable* SbStdFont::Find( const OUString& rName, SbxClassType t )
void SbStdFont::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
@@ -438,7 +438,7 @@ SbxVariable* SbStdClipboard::Find( const OUString& rName, SbxClassType t )
void SbStdClipboard::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
if( pHint )
{
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 3d473a341224..3932587238b5 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -117,7 +117,7 @@ SbxVariable* SbxCollection::Find( const OUString& rName, SbxClassType t )
void SbxCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1,
const SfxHint& rHint, const TypeId& rId2 )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint);
if( p )
{
sal_uLong nId = p->GetId();
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 15443694a371..70c308d147bc 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -138,7 +138,7 @@ void SbxObject::Clear()
void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint);
if( p )
{
sal_uLong nId = p->GetId();
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 89b712cd2115..1bd8dfddb4ba 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -35,7 +35,6 @@ using namespace com::sun::star::uno;
///////////////////////////// SbxVariable
TYPEINIT1(SbxVariable,SbxValue)
-TYPEINIT1(SbxHint,SfxSimpleHint)
///////////////////////////// SbxVariableImpl
@@ -685,7 +684,7 @@ void SbxAlias::Broadcast( sal_uIntPtr nHt )
void SbxAlias::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint);
if( p && p->GetId() == SBX_HINT_DYING )
{
xAlias.Clear();
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index 16a7dfb38dee..183504801d00 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -154,10 +154,11 @@ bool LicenseView::IsEndReached() const
void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE(TextHint) ) )
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
+ if ( pTextHint )
{
bool bLastVal = EndReached();
- sal_uLong nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = pTextHint->GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index a884eb2fbd39..3e1a59909d95 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -146,17 +146,17 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SfxStyleSheet* pStyle = NULL;
sal_uLong nId = 0;
- if ( rHint.ISA( SfxStyleSheetHint ) )
+ const SfxStyleSheetHint* pStyleSheetHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
+ if ( pStyleSheetHint )
{
- const SfxStyleSheetHint& rH = (const SfxStyleSheetHint&) rHint;
- DBG_ASSERT( rH.GetStyleSheet()->ISA( SfxStyleSheet ), "No SfxStyleSheet!" );
- pStyle = (SfxStyleSheet*) rH.GetStyleSheet();
- nId = rH.GetHint();
+ DBG_ASSERT( pStyleSheetHint->GetStyleSheet()->ISA( SfxStyleSheet ), "No SfxStyleSheet!" );
+ pStyle = (SfxStyleSheet*) pStyleSheetHint->GetStyleSheet();
+ nId = pStyleSheetHint->GetHint();
}
- else if ( ( rHint.Type() == TYPE(SfxSimpleHint ) ) && ( rBC.ISA( SfxStyleSheet ) ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && rBC.ISA( SfxStyleSheet ) )
{
pStyle = (SfxStyleSheet*)&rBC;
- nId = ((SfxSimpleHint&)rHint).GetId();
+ nId = dynamic_cast<const SfxSimpleHint*>(&rHint)->GetId();
}
if ( pStyle )
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx
index eb42e67b546f..83a6fd3bdb4d 100644
--- a/editeng/source/uno/unoedhlp.cxx
+++ b/editeng/source/uno/unoedhlp.cxx
@@ -24,8 +24,6 @@
-TYPEINIT1( SvxEditSourceHint, TextHint );
-
SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId ) :
TextHint( _nId ),
mnStart( 0 ),
@@ -46,9 +44,6 @@ sal_uLong SvxEditSourceHint::GetValue() const
}
-TYPEINIT1( SvxEditSourceHintEndPara , SvxEditSourceHint );
-
-
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<SfxHint> SvxEditSourceHelper::EENotification2Hint( EENotify* aNotify )
{
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
index c7532a147fbd..cec5f587fe85 100644
--- a/include/basic/sbx.hxx
+++ b/include/basic/sbx.hxx
@@ -94,7 +94,6 @@ class BASIC_DLLPUBLIC SbxHint : public SfxSimpleHint
{
SbxVariable* pVar;
public:
- TYPEINFO_OVERRIDE();
SbxHint( sal_uIntPtr n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {}
SbxVariable* GetVar() const { return pVar; }
};
diff --git a/include/editeng/unoedhlp.hxx b/include/editeng/unoedhlp.hxx
index c9900a808e5c..d9cb6d830468 100644
--- a/include/editeng/unoedhlp.hxx
+++ b/include/editeng/unoedhlp.hxx
@@ -45,7 +45,6 @@ private:
sal_Int32 mnEnd;
public:
- TYPEINFO_OVERRIDE();
SvxEditSourceHint( sal_uLong nId );
SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_Int32 nStart=0, sal_Int32 nEnd=0 );
@@ -56,7 +55,6 @@ public:
class SvxEditSourceHintEndPara :public SvxEditSourceHint
{
public:
- TYPEINFO_OVERRIDE();
SvxEditSourceHintEndPara( sal_uInt32 nId )
:SvxEditSourceHint(nId) {}
SvxEditSourceHintEndPara( sal_uInt32 nId, sal_uInt32 nValue, sal_uInt32 nStart=0, sal_uInt32 nEnd=0 )
diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx
index be335ebf95b7..5b4970d571e4 100644
--- a/include/sfx2/event.hxx
+++ b/include/sfx2/event.hxx
@@ -42,7 +42,6 @@ class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
sal_uInt16 nEventId;
public:
- TYPEINFO_OVERRIDE();
SfxEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj = 0 )
: pObjShell(pObj),
aEventName(aName),
@@ -66,8 +65,6 @@ class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
::com::sun::star::uno::Reference< css::frame::XController2 > xViewController;
public:
- TYPEINFO_OVERRIDE();
-
SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController >& xController )
: SfxEventHint( nId, aName, pObj )
, xViewController( xController, css::uno::UNO_QUERY )
@@ -91,8 +88,6 @@ class SfxNamedHint : public SfxHint
OUString _aArgs;
public:
- TYPEINFO_OVERRIDE();
-
SfxNamedHint( const OUString& rName,
const OUString& rArgs,
SfxObjectShell *pObj = 0 )
@@ -119,8 +114,6 @@ class SfxPrintingHint : public SfxViewEventHint
sal_Int32 mnPrintableState;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
public:
- TYPEINFO_OVERRIDE();
-
SfxPrintingHint(
sal_Int32 nEvent,
const css::uno::Sequence < css::beans::PropertyValue >& rOpts,
@@ -141,7 +134,7 @@ public:
{}
sal_Int32 GetWhich() const { return mnPrintableState; }
- const css::uno::Sequence < css::beans::PropertyValue >& GetOptions() { return aOpts; }
+ const css::uno::Sequence < css::beans::PropertyValue >& GetOptions() const { return aOpts; }
};
#endif
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index b2c3ac14d701..70df0743b47a 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -20,13 +20,10 @@
#define INCLUDED_SVL_HINT_HXX
#include <svl/svldllapi.h>
-#include <tools/rtti.hxx>
class SVL_DLLPUBLIC SfxHint
{
public:
- TYPEINFO();
-
virtual ~SfxHint();
};
@@ -38,7 +35,6 @@ public:
Type* pObj; \
\
public: \
- TYPEINFO_OVERRIDE(); \
explicit Name( Type* Object ); \
virtual ~Name(); \
\
@@ -46,7 +42,6 @@ public:
}
#define IMPL_PTRHINT(Name, Type) \
- TYPEINIT1(Name, SfxHint); \
Name::Name( Type* pObject ) { pObj = pObject; } \
Name::~Name() {}
diff --git a/include/svl/isethint.hxx b/include/svl/isethint.hxx
index edbdd41b76d0..e7541c1d2bc7 100644
--- a/include/svl/isethint.hxx
+++ b/include/svl/isethint.hxx
@@ -32,8 +32,6 @@ class SVL_DLLPUBLIC SfxItemSetHint: public SfxHint
SfxItemSet* _pItemSet;
public:
- TYPEINFO_OVERRIDE();
-
SfxItemSetHint( const SfxItemSet &rItemSet );
virtual ~SfxItemSetHint();
diff --git a/include/svl/smplhint.hxx b/include/svl/smplhint.hxx
index 8189a005456b..058b91cd43d9 100644
--- a/include/svl/smplhint.hxx
+++ b/include/svl/smplhint.hxx
@@ -21,7 +21,7 @@
#include <svl/svldllapi.h>
#include <svl/hint.hxx>
-#include <tools/rtti.hxx>
+#include <tools/solar.h>
#define SFX_HINT_DYING 0x00000001
#define SFX_HINT_NAMECHANGED 0x00000002
@@ -62,7 +62,6 @@ class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint
private:
sal_uLong mnId;
public:
- TYPEINFO_OVERRIDE();
SfxSimpleHint( sal_uLong nId ) { mnId = nId; }
sal_uLong GetId() const { return mnId; }
};
@@ -75,14 +74,12 @@ public:
Type aObj; \
\
public: \
- TYPEINFO_OVERRIDE(); \
Name( sal_uInt16 nId, const Type& rObject ); \
virtual ~Name(); \
const Type& GetObject() const { return aObj; } \
}
#define IMPL_OBJHINT(Name, Type) \
- TYPEINIT1(Name, SfxSimpleHint); \
Name::Name( sal_uInt16 nID, const Type& rObject ): \
SfxSimpleHint( nID ), aObj(rObject) \
{ } \
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 773178d8d58f..78c1bc418b62 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -341,10 +341,8 @@ class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint
sal_uInt16 nHint;
public:
- TYPEINFO_OVERRIDE();
-
SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){}
- sal_uInt16 GetHint() const
+ sal_uInt16 GetHint() const
{ return nHint; }
};
@@ -353,15 +351,13 @@ public:
class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint
{
SfxStyleSheetBase* pStyleSh;
- sal_uInt16 nHint;
+ sal_uInt16 nHint;
public:
- TYPEINFO_OVERRIDE();
-
SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& );
SfxStyleSheetBase* GetStyleSheet() const
{ return pStyleSh; }
- sal_uInt16 GetHint() const
+ sal_uInt16 GetHint() const
{ return nHint; }
};
@@ -370,11 +366,9 @@ class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint
OUString aName;
public:
- TYPEINFO_OVERRIDE();
-
SfxStyleSheetHintExtended( sal_uInt16, const OUString& rOld,
SfxStyleSheetBase& );
- const OUString& GetOldName() { return aName; }
+ const OUString& GetOldName() const { return aName; }
};
class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >
diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx
index 1d8831c2ffd2..f8ecdcc994f6 100644
--- a/include/svx/fmshell.hxx
+++ b/include/svx/fmshell.hxx
@@ -60,7 +60,6 @@ class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
bool m_bDesignMode;
public:
- TYPEINFO_OVERRIDE();
FmDesignModeChangedHint( bool bDesMode );
virtual ~FmDesignModeChangedHint();
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 6f1c5475f6b9..0d9b03b3480a 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -124,8 +124,6 @@ public:
SdrHintKind meHint;
public:
- TYPEINFO_OVERRIDE();
-
explicit SdrHint(SdrHintKind eNewHint);
explicit SdrHint(const SdrObject& rNewObj);
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index c31e180a3d09..c248e8c83de9 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -101,9 +101,8 @@ class SVX_DLLPUBLIC SvxViewHint : public SfxHint
{
public:
enum HintType { SVX_HINT_VIEWCHANGED };
- TYPEINFO_OVERRIDE();
- explicit SvxViewHint (HintType eType);
- HintType GetHintType (void) const { return meHintType;}
+ explicit SvxViewHint(HintType eType);
+ HintType GetHintType() const { return meHintType;}
private:
HintType meHintType;
diff --git a/include/vcl/textdata.hxx b/include/vcl/textdata.hxx
index d918aecb3f37..6af42ee5a93d 100644
--- a/include/vcl/textdata.hxx
+++ b/include/vcl/textdata.hxx
@@ -128,12 +128,10 @@ private:
sal_uLong mnValue;
public:
- TYPEINFO_OVERRIDE();
TextHint( sal_uLong nId );
TextHint( sal_uLong nId, sal_uLong nValue );
sal_uLong GetValue() const { return mnValue; }
- void SetValue( sal_uLong n ) { mnValue = n; }
};
struct TEIMEInfos
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index 5fb046ad6bae..6f2cfca0da64 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -57,7 +57,6 @@ typedef ::std::multimap< sal_Int16, OUString, ::std::less< sal_Int16 > > IndexTo
DlgEdHint(DlgEdHint&);
void operator =(DlgEdHint&);
public:
- TYPEINFO_OVERRIDE();
DlgEdHint( DlgEdHintKind eHint );
virtual ~DlgEdHint();
diff --git a/reportdesign/source/core/sdr/RptObjectListener.cxx b/reportdesign/source/core/sdr/RptObjectListener.cxx
index 363b90fadb71..b645263dd97e 100644
--- a/reportdesign/source/core/sdr/RptObjectListener.cxx
+++ b/reportdesign/source/core/sdr/RptObjectListener.cxx
@@ -59,10 +59,6 @@ void SAL_CALL OObjectListener::propertyChange( const ::com::sun::star::beans::P
// DlgEdHint
-TYPEINIT1( DlgEdHint, SfxHint );
-
-
-
DlgEdHint::DlgEdHint(DlgEdHintKind eHint)
: eHintKind(eHint)
, pDlgEdObj(NULL)
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 7f4217c7fa1c..e1efd7a3ee9c 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -193,7 +193,8 @@ void OXUndoEnvironment::ModeChanged()
void OXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_MODECHANGED )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_MODECHANGED )
ModeChanged();
}
diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx
index 2702a32fde1c..75d39d6ec27c 100644
--- a/reportdesign/source/ui/misc/ColorListener.cxx
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -45,9 +45,8 @@ OColorListener::~OColorListener()
void OColorListener::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
{
- if (rHint.ISA(SfxSimpleHint)
- && (static_cast< SfxSimpleHint const & >(rHint).GetId()
- == SFX_HINT_COLORS_CHANGED))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED)
{
m_nColor = m_aExtendedColorConfig.GetColorValue(CFG_REPORTDESIGNER,m_sColorEntry).getColor();
m_nTextBoundaries = m_aColorConfig.GetColorValue(::svtools::DOCBOUNDARIES).nColor;
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 51b031fc1d57..028a826c6885 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2567,9 +2567,8 @@ IMPL_LINK( OReportController, EventLstHdl, VclWindowEvent*, _pEvent )
void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHint)
{
- if (_rHint.ISA(DlgEdHint)
- && (static_cast< DlgEdHint const & >(_rHint).GetKind()
- == RPTUI_HINT_SELECTIONCHANGED))
+ const DlgEdHint* pDlgEdHint = dynamic_cast<const DlgEdHint*>(&_rHint);
+ if (pDlgEdHint && pDlgEdHint->GetKind() == RPTUI_HINT_SELECTIONCHANGED)
{
const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
if ( m_nSelectionCount != nSelectionCount )
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index 3aa7c372a6f6..d892ef30a5f9 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -130,10 +130,11 @@ void OSectionView::MakeVisible( const Rectangle& rRect, Window& rWin )
void OSectionView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SdrView::Notify(rBC,rHint);
- if ( rHint.ISA(SdrHint) )
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if ( pSdrHint )
{
- const SdrObject* pObj = ((SdrHint&)rHint).GetObject();
- const SdrHintKind eKind = ((SdrHint&)rHint).GetKind();
+ const SdrObject* pObj = pSdrHint->GetObject();
+ const SdrHintKind eKind = pSdrHint->GetKind();
// check for change of selected object
if(HINT_OBJCHG == eKind && pObj && IsObjMarked(const_cast<SdrObject*>(pObj)))
AdjustMarkHdl();
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 357859988a65..b7e142749d38 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -241,9 +241,8 @@ void OStartMarker::setTitle(const OUString& _sTitle)
void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
{
OColorListener::Notify(rBc, rHint);
- if (rHint.ISA(SfxSimpleHint)
- && (static_cast< SfxSimpleHint const & >(rHint).GetId()
- == SFX_HINT_COLORS_CHANGED))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_COLORS_CHANGED)
{
setColor();
Invalidate(INVALIDATE_CHILDREN);
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx
index d63bb2c6b169..a11ebbd4e5d4 100644
--- a/sc/inc/brdcst.hxx
+++ b/sc/inc/brdcst.hxx
@@ -22,7 +22,6 @@
#include "global.hxx"
#include "address.hxx"
#include "simplehintids.hxx"
-#include <tools/rtti.hxx>
#include <svl/hint.hxx>
class SvtBroadcaster;
@@ -32,7 +31,6 @@ class ScHint : public SfxSimpleHint
ScAddress aAddress;
public:
- TYPEINFO_OVERRIDE();
ScHint( sal_uLong n, const ScAddress& a );
const ScAddress& GetAddress() const { return aAddress; }
ScAddress& GetAddress() { return aAddress; }
@@ -44,7 +42,6 @@ class ScAreaChangedHint : public SfxHint
private:
ScRange aNewRange;
public:
- TYPEINFO_OVERRIDE();
ScAreaChangedHint(const ScRange& rRange) : aNewRange(rRange) {}
const ScRange& GetRange() const { return aNewRange; }
};
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx
index bece16b7ae5e..40096d936aa1 100644
--- a/sc/inc/drwlayer.hxx
+++ b/sc/inc/drwlayer.hxx
@@ -40,7 +40,6 @@ class ScTabDeletedHint : public SfxHint
private:
SCTAB nTab;
public:
- TYPEINFO_OVERRIDE();
ScTabDeletedHint( SCTAB nTabNo = SCTAB_MAX );
virtual ~ScTabDeletedHint();
@@ -52,7 +51,6 @@ class ScTabSizeChangedHint : public SfxHint
private:
SCTAB nTab;
public:
- TYPEINFO_OVERRIDE();
ScTabSizeChangedHint( SCTAB nTabNo = SCTAB_MAX );
virtual ~ScTabSizeChangedHint();
diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx
index 13bde4e5972b..15a0c4dcf9bf 100644
--- a/sc/inc/hints.hxx
+++ b/sc/inc/hints.hxx
@@ -33,7 +33,6 @@ class ScPaintHint : public SfxHint
ScPaintHint(); // disabled
public:
- TYPEINFO_OVERRIDE();
ScPaintHint( const ScRange& rRng, sal_uInt16 nPaint = PAINT_ALL );
virtual ~ScPaintHint();
@@ -59,8 +58,6 @@ class ScUpdateRefHint : public SfxHint
SCsTAB nDz;
public:
- TYPEINFO_OVERRIDE();
-
ScUpdateRefHint( UpdateRefMode eMode, const ScRange& rR,
SCsCOL nX, SCsROW nY, SCsTAB nZ );
virtual ~ScUpdateRefHint();
@@ -79,7 +76,6 @@ class ScPointerChangedHint : public SfxHint
sal_uInt16 nFlags;
public:
- TYPEINFO_OVERRIDE();
virtual ~ScPointerChangedHint();
@@ -105,7 +101,6 @@ class ScLinkRefreshedHint : public SfxHint
//! also use source data for area links?
public:
- TYPEINFO_OVERRIDE();
ScLinkRefreshedHint();
virtual ~ScLinkRefreshedHint();
@@ -132,7 +127,6 @@ class ScAutoStyleHint : public SfxHint
sal_uLong nTimeout;
public:
- TYPEINFO_OVERRIDE();
ScAutoStyleHint( const ScRange& rR, const OUString& rSt1,
sal_uLong nT, const OUString& rSt2 );
virtual ~ScAutoStyleHint();
@@ -148,7 +142,6 @@ class ScDBRangeRefreshedHint : public SfxHint
ScImportParam aParam;
public:
- TYPEINFO_OVERRIDE();
ScDBRangeRefreshedHint( const ScImportParam& rP );
virtual ~ScDBRangeRefreshedHint();
@@ -160,7 +153,6 @@ class ScDataPilotModifiedHint : public SfxHint
OUString maName;
public:
- TYPEINFO_OVERRIDE();
ScDataPilotModifiedHint( const OUString& rName );
virtual ~ScDataPilotModifiedHint();
diff --git a/sc/inc/unoreflist.hxx b/sc/inc/unoreflist.hxx
index 7da2a77cdd72..51f4dc53dc37 100644
--- a/sc/inc/unoreflist.hxx
+++ b/sc/inc/unoreflist.hxx
@@ -62,7 +62,6 @@ class ScUnoRefUndoHint : public SfxHint
ScUnoRefEntry aEntry;
public:
- TYPEINFO_OVERRIDE();
ScUnoRefUndoHint( const ScUnoRefEntry& rRefEntry );
virtual ~ScUnoRefUndoHint();
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();
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index 3f7ad2209993..c6fda325a289 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -102,7 +102,7 @@ namespace basprov
// not interested in
return;
}
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
if ( pSimpleHint && ( pSimpleHint->GetId() == SFX_HINT_DYING ) )
{
m_documentBasicManager = NULL;
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 68075de2f872..aaeed2922be7 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -527,9 +527,8 @@ void SdStyleSheet::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
/* if the dummy gets a notify about a changed attribute, he takes care that
the actual ment style sheet sends broadcasts. */
- SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
- sal_uLong nId = pSimple == NULL ? 0 : pSimple->GetId();
- if (nId == SFX_HINT_DATACHANGED && nFamily == SD_STYLE_FAMILY_PSEUDO)
+ const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimple && pSimple->GetId() == SFX_HINT_DATACHANGED && nFamily == SD_STYLE_FAMILY_PSEUDO)
{
SdStyleSheet* pRealStyle = GetRealStyleSheet();
if (pRealStyle)
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 8a5b2eeff354..c4f818b63657 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -851,10 +851,10 @@ void AccessibleSlideSorterView::Implementation::Notify (
SfxBroadcaster&,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetKind())
{
case HINT_PAGEORDERCHG:
RequestUpdateChildren();
@@ -863,9 +863,9 @@ void AccessibleSlideSorterView::Implementation::Notify (
break;
}
}
- else if (rHint.ISA(sd::ViewShellHint))
+ else if (dynamic_cast<const sd::ViewShellHint*>(&rHint))
{
- sd::ViewShellHint& rViewShellHint (*PTR_CAST(sd::ViewShellHint, &rHint));
+ const sd::ViewShellHint& rViewShellHint = static_cast<const sd::ViewShellHint&>(rHint);
switch (rViewShellHint.GetHintId())
{
case sd::ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START:
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index dcdf0eb4a4fd..0d891e566344 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -132,8 +132,8 @@ SdModule::~SdModule()
/// get notifications
void SdModule::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 )
{
delete pImpressOptions, pImpressOptions = NULL;
delete pDrawOptions, pDrawOptions = NULL;
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index 2a72f6773cb6..301cc708148b 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -293,7 +293,8 @@ 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/inc/ViewShellHint.hxx b/sd/source/ui/inc/ViewShellHint.hxx
index 049e02790937..03ab7aaaf75b 100644
--- a/sd/source/ui/inc/ViewShellHint.hxx
+++ b/sd/source/ui/inc/ViewShellHint.hxx
@@ -45,8 +45,6 @@ public:
HINT_COMPLEX_MODEL_CHANGE_END
};
- TYPEINFO_OVERRIDE();
-
ViewShellHint (HintId nHintId);
HintId GetHintId (void) const { return meHintId;}
diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx
index 38df5dd28fda..4751635b10b1 100644
--- a/sd/source/ui/sidebar/MasterPageObserver.cxx
+++ b/sd/source/ui/sidebar/MasterPageObserver.cxx
@@ -221,10 +221,10 @@ void MasterPageObserver::Implementation::Notify(
SfxBroadcaster& rBroadcaster,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetKind())
{
case HINT_PAGEORDERCHG:
// Process the modified set of pages only when the number of
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 14ec004a0b2e..58e890340bae 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -281,10 +281,10 @@ void Listener::Notify (
SfxBroadcaster& rBroadcaster,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetKind())
{
case HINT_MODELCLEARED:
if (&rBroadcaster == mrSlideSorter.GetModel().GetDocument())
@@ -295,16 +295,16 @@ void Listener::Notify (
break;
case HINT_PAGEORDERCHG:
if (&rBroadcaster == mrSlideSorter.GetModel().GetDocument())
- HandleModelChange(rSdrHint.GetPage());
+ HandleModelChange(pSdrHint->GetPage());
break;
default:
break;
}
}
- else if (rHint.ISA(ViewShellHint))
+ else if (dynamic_cast<const ViewShellHint*>(&rHint))
{
- ViewShellHint& rViewShellHint (*PTR_CAST(ViewShellHint,&rHint));
+ const ViewShellHint& rViewShellHint = static_cast<const ViewShellHint&>(rHint);
switch (rViewShellHint.GetHintId())
{
case ViewShellHint::HINT_PAGE_RESIZE_START:
@@ -336,9 +336,9 @@ void Listener::Notify (
break;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else if (dynamic_cast<const SfxSimpleHint*>(&rHint))
{
- 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/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
index a3d7a5fc309b..a8500979b00f 100644
--- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
@@ -88,10 +88,10 @@ void TransferableData::DragFinished (sal_Int8 nDropAction)
void TransferableData::Notify (SfxBroadcaster&, const SfxHint& rHint)
{
- if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL)
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && mpViewShell)
{
- SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint));
- if (rSimpleHint.GetId() == SFX_HINT_DYING)
+ if (pSimpleHint->GetId() == SFX_HINT_DYING)
{
// This hint may come either from the ViewShell or from the
// document (registered by SdTransferable). We do not know
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index f3fe19d74eca..8549a749834c 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -650,10 +650,10 @@ void EventMultiplexer::Implementation::Notify (
SfxBroadcaster&,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetKind())
{
case HINT_MODELCLEARED:
case HINT_PAGEORDERCHG:
@@ -666,25 +666,25 @@ void EventMultiplexer::Implementation::Notify (
case HINT_OBJCHG:
CallListeners(EventMultiplexerEvent::EID_SHAPE_CHANGED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetPage())));
break;
case HINT_OBJINSERTED:
CallListeners(EventMultiplexerEvent::EID_SHAPE_INSERTED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetPage())));
break;
case HINT_OBJREMOVED:
CallListeners(EventMultiplexerEvent::EID_SHAPE_REMOVED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetPage())));
break;
default:
break;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else if (dynamic_cast<const SfxSimpleHint*>(&rHint))
{
- SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint));
+ const SfxSimpleHint& rSimpleHint = static_cast<const SfxSimpleHint&>(rHint);
if (rSimpleHint.GetId() == SFX_HINT_DYING)
mpDocument = NULL;
}
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 1dda905404ad..ee06476b6ffc 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -490,20 +490,15 @@ Image PreviewRenderer::ScaleBitmap (
void PreviewRenderer::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if (rHint.IsA(TYPE(SfxSimpleHint))
- && mpDocShellOfView != NULL)
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint && mpDocShellOfView && pSimpleHint->GetId() == SFX_HINT_DYING)
{
- const SfxSimpleHint* pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
- if (pSimpleHint != NULL
- && pSimpleHint->GetId() == SFX_HINT_DYING)
- {
- // The doc shell is dying. Our view uses its item pool and
- // has to be destroyed as well. The next call to
- // ProvideView will create a new one (for another
- // doc shell, of course.)
- mpView.reset();
- mpDocShellOfView = NULL;
- }
+ // The doc shell is dying. Our view uses its item pool and
+ // has to be destroyed as well. The next call to
+ // ProvideView will create a new one (for another
+ // doc shell, of course.)
+ mpView.reset();
+ mpDocShellOfView = NULL;
}
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 83da209c16df..abdda6d62be2 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -149,7 +149,7 @@ SdUnoForbiddenCharsTable::~SdUnoForbiddenCharsTable()
void SdUnoForbiddenCharsTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if( pSdrHint )
{
@@ -389,7 +389,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if( mpDoc )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if( pSdrHint )
{
@@ -410,7 +410,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- const SfxSimpleHint* pSfxHint = PTR_CAST(SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSfxHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
// did our SdDrawDocument just died?
if(pSfxHint && pSfxHint->GetId() == SFX_HINT_DYING)
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 2c24a0fe3624..8c8f396c82f1 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -80,7 +80,7 @@ SdUnoPageBackground::~SdUnoPageBackground() throw()
void SdUnoPageBackground::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if( pSdrHint )
{
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index e6a1cbb96b6e..ae6832b33c6a 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -396,9 +396,10 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
SfxViewShell::Notify(rBC, rHint);
- if (rHint.IsA(TYPE(SfxEventHint)))
+ const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
+ if (pEventHint)
{
- switch (static_cast<const SfxEventHint&>(rHint).GetEventId())
+ switch (pEventHint->GetEventId())
{
case SFX_EVENT_OPENDOC:
if( GetDocument() && GetDocument()->IsStartWithPresentation() )
diff --git a/sd/source/ui/view/ViewShellHint.cxx b/sd/source/ui/view/ViewShellHint.cxx
index 900657b2b361..06f32e614064 100644
--- a/sd/source/ui/view/ViewShellHint.cxx
+++ b/sd/source/ui/view/ViewShellHint.cxx
@@ -21,8 +21,6 @@
namespace sd {
-TYPEINIT1(ViewShellHint, SfxHint);
-
ViewShellHint::ViewShellHint (HintId eHintId)
: SfxHint(),
meHintId(eHintId)
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 3a0a2b88cf99..780f6eb701d1 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -373,7 +373,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- if ( mpDrawViewShell && rHint.ISA(SdrHint) )
+ if ( mpDrawViewShell && dynamic_cast<const SdrHint*>(&rHint) )
{
SdrHintKind eHintKind = ( (SdrHint&) rHint).GetKind();
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 23d464219295..8ced478adf56 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -97,7 +97,7 @@ public:
void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
{
pTimer->Stop();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index bd965ad423e4..115c95451681 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -365,17 +365,16 @@ void SfxPickList::ExecuteMenuEntry( sal_uInt16 nId )
void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE( SfxStringHint )))
+ const SfxStringHint* pStringHint = dynamic_cast<const SfxStringHint*>(&rHint);
+ if ( pStringHint )
{
- SfxStringHint* pStringHint = (SfxStringHint*) &rHint;
-
if ( pStringHint->GetId() == SID_OPENURL )
INetURLHistory::GetOrCreate()->PutUrl( INetURLObject( pStringHint->GetObject() ));
}
- if ( rHint.IsA( TYPE( SfxEventHint )))
+ const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
+ if ( pEventHint )
{
- SfxEventHint* pEventHint = PTR_CAST(SfxEventHint,&rHint);
// only ObjectShell-related events with media interest
SfxObjectShell* pDocSh = pEventHint ? pEventHint->GetObjShell() : NULL;
if( !pDocSh )
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 9c43b48a5d46..33dfd04b1c73 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -49,9 +49,7 @@
#include <com/sun/star/uno/Reference.hxx>
-TYPEINIT1(SfxEventHint, SfxHint);
TYPEINIT1(SfxEventNamesItem, SfxPoolItem);
-TYPEINIT1(SfxViewEventHint, SfxEventHint);
using namespace com::sun::star;
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index a98302b79fcc..47031aab3cbd 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -98,7 +98,7 @@ struct SfxRequest_Impl: public SfxListener
void SfxRequest_Impl::Notify( SfxBroadcaster&, const SfxHint &rHint )
{
- SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pAnti->Cancel();
}
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 59ea7c2ceab6..9bb8497cb81d 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -58,9 +58,10 @@ public:
void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSimpleHint->GetId() )
{
case SFX_HINT_DYING:
pMgr->Destroy();
@@ -82,9 +83,10 @@ public:
void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSimpleHint->GetId() )
{
case SFX_HINT_DYING:
pMgr->Destroy();
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 6c428468373d..5cf9fa7e3065 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1572,9 +1572,10 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, pTim )
void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
// tap update
- if(rHint.Type() == TYPE(SfxSimpleHint))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if(pSfxSimpleHint)
{
- switch(((SfxSimpleHint&) rHint ).GetId())
+ switch(pSfxSimpleHint->GetId())
{
case SFX_HINT_UPDATEDONE:
{
@@ -1644,12 +1645,12 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
// possible that a new one is registered after the timer is up -
// works bad in UpdateStyles_Impl ()!
- sal_uIntPtr nId = rHint.ISA(SfxSimpleHint) ? ( (SfxSimpleHint&)rHint ).GetId() : 0;
+ sal_uIntPtr nId = pSfxSimpleHint ? pSfxSimpleHint->GetId() : 0;
if(!bDontUpdate && nId != SFX_HINT_DYING &&
- (rHint.Type() == TYPE(SfxStyleSheetPoolHint)||
- rHint.Type() == TYPE(SfxStyleSheetHint) ||
- rHint.Type() == TYPE( SfxStyleSheetHintExtended )))
+ (dynamic_cast<const SfxStyleSheetPoolHint*>(&rHint) ||
+ dynamic_cast<const SfxStyleSheetHint*>(&rHint) ||
+ dynamic_cast<const SfxStyleSheetHintExtended*>(&rHint)))
{
if(!pTimer)
{
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 70590590b0ef..ab3c4049a932 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -795,7 +795,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
+ const SfxPrintingHint* pPrintHint = dynamic_cast<const SfxPrintingHint*>(&rHint);
if ( &rBC != m_pObjectShell
|| !pPrintHint
|| pPrintHint->GetWhich() == SFX_PRINTABLESTATE_CANCELJOB )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index eac066e2fb72..8defb3e522f1 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2746,11 +2746,11 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
if ( &rBC == m_pData->m_pObjectShell )
{
- SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DOCCHANGED )
changing();
- SfxEventHint* pNamedHint = PTR_CAST( SfxEventHint, &rHint );
+ const SfxEventHint* pNamedHint = dynamic_cast<const SfxEventHint*>(&rHint);
if ( pNamedHint )
{
@@ -2819,7 +2819,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
}
- SfxViewEventHint* pViewHint = PTR_CAST( SfxViewEventHint, &rHint );
+ const SfxViewEventHint* pViewHint = dynamic_cast<const SfxViewEventHint*>(&rHint);
postEvent_Impl( pNamedHint->GetEventName(), pViewHint ? pViewHint->GetController() : Reference< frame::XController2 >() );
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 479dde2f9022..0a89ad9d3dda 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -245,9 +245,10 @@ public:
void SfxViewNotificatedFrameList_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSimpleHint->GetId() )
{
case SFX_HINT_DYING:
SfxViewFrame* pFrame = (SfxViewFrame*) &rBC;
@@ -1261,9 +1262,10 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
return;
// we know only SimpleHints
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSimpleHint->GetId() )
{
case SFX_HINT_MODECHANGED:
{
@@ -1327,12 +1329,13 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
- else if ( rHint.IsA(TYPE(SfxEventHint)) )
+ else if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
+ const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
// When the Document is loaded asynchronously, was the Dispatcher
// set as ReadOnly, to what must be returned when the document itself
// is not read only, and the loading is finished.
- switch ( ((SfxEventHint&)rHint).GetEventId() )
+ switch ( pEventHint->GetEventId() )
{
case SFX_EVENT_MODIFYCHANGED:
{
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 56ac2e64e931..1463248fc425 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -54,8 +54,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-TYPEINIT1(SfxPrintingHint, SfxViewEventHint);
-
class SfxPrinterController : public vcl::PrinterController, public SfxListener
{
Any maCompleteSelection;
@@ -170,9 +168,10 @@ SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_
void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSimpleHint->GetId() == SFX_HINT_DYING )
{
EndListening(*mpViewShell);
EndListening(*mpObjectShell);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e02c25f00321..9b40bb40f6de 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1560,9 +1560,10 @@ SfxViewShell* SfxViewShell::GetNext
void SfxViewShell::Notify( SfxBroadcaster& rBC,
const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxEventHint)) )
+ const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
+ if ( pEventHint )
{
- switch ( ((SfxEventHint&)rHint).GetEventId() )
+ switch ( pEventHint->GetEventId() )
{
case SFX_EVENT_LOADFINISHED:
{
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index c934e90ef4f3..a03e497f22c3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -2037,9 +2037,10 @@ IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSimpleHint->GetId() )
{
case SFX_HINT_MODECHANGED:
case SFX_HINT_DOCCHANGED:
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 7b2b2ee399d7..18225fbff3ee 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -127,7 +127,6 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/notify/isethint \
svl/source/notify/listener \
svl/source/notify/lstner \
- svl/source/notify/smplhint \
svl/source/numbers/numfmuno \
svl/source/numbers/numhead \
svl/source/numbers/numuno \
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 541fa95cbcbc..2f41cf85a496 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -58,10 +58,6 @@ TYPEINIT0(SfxStyleSheetBase)
TYPEINIT3(SfxStyleSheet, SfxStyleSheetBase, SfxListener, SfxBroadcaster)
-TYPEINIT1(SfxStyleSheetHint, SfxHint);
-TYPEINIT1(SfxStyleSheetHintExtended, SfxStyleSheetHint);
-TYPEINIT1(SfxStyleSheetPoolHint, SfxHint);
-
SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
(
sal_uInt16 nAction, // SFX_STYLESHEET_... (see above)
diff --git a/svl/source/notify/hint.cxx b/svl/source/notify/hint.cxx
index 28ef4e06d165..183b12af9c91 100644
--- a/svl/source/notify/hint.cxx
+++ b/svl/source/notify/hint.cxx
@@ -21,8 +21,6 @@
#include <svl/hint.hxx>
-TYPEINIT0(SfxHint);
-
// virtual dtor for the typical base-class Hint
SfxHint::~SfxHint()
diff --git a/svl/source/notify/isethint.cxx b/svl/source/notify/isethint.cxx
index 3c2dd49eb2aa..9577aefda0c4 100644
--- a/svl/source/notify/isethint.cxx
+++ b/svl/source/notify/isethint.cxx
@@ -22,8 +22,6 @@
#include <svl/itemset.hxx>
-TYPEINIT1(SfxItemSetHint, SfxHint);
-
/**
* Copies the SfxItemSet passed as a parameter.
*/
@@ -32,7 +30,6 @@ SfxItemSetHint::SfxItemSetHint( const SfxItemSet &rItemSet )
{
}
-
SfxItemSetHint::~SfxItemSetHint()
{
delete _pItemSet;
diff --git a/svl/source/notify/smplhint.cxx b/svl/source/notify/smplhint.cxx
deleted file mode 100644
index b85173431150..000000000000
--- a/svl/source/notify/smplhint.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <svl/smplhint.hxx>
-
-TYPEINIT1(SfxSimpleHint, SfxHint);
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 126af32bdb92..1ef43d1c05e4 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -652,9 +652,10 @@ SvtAccessibilityOptions::~SvtAccessibilityOptions()
void SvtAccessibilityOptions::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
NotifyListeners(0);
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSfxSimpleHint )
{
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_ACCESSIBILITY_CHANGED )
+ if ( pSfxSimpleHint->GetId() == SFX_HINT_ACCESSIBILITY_CHANGED )
SetVCLSettings();
}
}
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index d2d0ac252d42..043718365ae8 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -316,7 +316,7 @@ namespace accessibility
void AccessibleEmptyEditSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if( pSdrHint && pSdrHint->GetKind() == HINT_BEGEDIT &&
&mrObj == pSdrHint->GetObject() && mpEditSource.get() )
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index f73bceeaba77..32444e634ffe 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -1064,8 +1064,8 @@ namespace accessibility
mnParasChanged != -1 )
{
// determine hint type
- const TextHint* pTextHint = PTR_CAST( TextHint, pEvent );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, pEvent );
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>( pEvent );
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( pEvent );
if( !pEditSourceHint && pTextHint &&
(pTextHint->GetId() == TEXT_HINT_PARAINSERTED ||
@@ -1234,11 +1234,11 @@ namespace accessibility
const SfxHint& rHint = *(pHint.get());
// determine hint type
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>( &rHint );
+ const SvxViewHint* pViewHint = dynamic_cast<const SvxViewHint*>( &rHint );
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( &rHint );
try
{
@@ -1415,11 +1415,11 @@ namespace accessibility
mbInNotify = true;
// determine hint type
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>( &rHint );
+ const SvxViewHint* pViewHint = dynamic_cast<const SvxViewHint*>( &rHint );
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( &rHint );
try
{
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 085bbb99dd46..0838e3138ffa 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -816,7 +816,7 @@ Rectangle SvxGraphCtrlAccessibleContext::GetBoundingBox( void ) throw( RuntimeEx
void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if( pSdrHint )
{
@@ -852,7 +852,7 @@ void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster& /*rBC*/, const SfxHi
}
else
{
- const SfxSimpleHint* pSfxHint = PTR_CAST(SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSfxHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
// Has our SdDrawDocument just died?
if(pSfxHint && pSfxHint->GetId() == SFX_HINT_DYING)
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index bf12a85572aa..60ace556fe04 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3368,9 +3368,10 @@ void SvxRuler::Notify(SfxBroadcaster&, const SfxHint& rHint)
*/
// start update
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
if(bActive &&
- rHint.Type() == TYPE(SfxSimpleHint) &&
- ((SfxSimpleHint&) rHint ).GetId() == SFX_HINT_UPDATEDONE )
+ pSimpleHint &&
+ pSimpleHint->GetId() == SFX_HINT_UPDATEDONE )
{
Update();
EndListening(*pBindings);
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 4b1b2dd5b30e..828acb1ac2ba 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -231,11 +231,9 @@ class FmFilterHint : public SfxHint
FmFilterData* m_pData;
public:
- TYPEINFO_OVERRIDE();
FmFilterHint(FmFilterData* pData):m_pData(pData){}
FmFilterData* GetData() const { return m_pData; }
};
-TYPEINIT1( FmFilterHint, SfxHint );
class FmFilterInsertedHint : public FmFilterHint
@@ -243,54 +241,42 @@ class FmFilterInsertedHint : public FmFilterHint
sal_uLong m_nPos; // Position relative to the parent of the data
public:
- TYPEINFO_OVERRIDE();
FmFilterInsertedHint(FmFilterData* pData, sal_uLong nRelPos)
:FmFilterHint(pData)
,m_nPos(nRelPos){}
sal_uLong GetPos() const { return m_nPos; }
};
-TYPEINIT1( FmFilterInsertedHint, FmFilterHint );
class FmFilterRemovedHint : public FmFilterHint
{
public:
- TYPEINFO_OVERRIDE();
FmFilterRemovedHint(FmFilterData* pData)
:FmFilterHint(pData){}
-
};
-TYPEINIT1( FmFilterRemovedHint, FmFilterHint );
class FmFilterTextChangedHint : public FmFilterHint
{
public:
- TYPEINFO_OVERRIDE();
FmFilterTextChangedHint(FmFilterData* pData)
:FmFilterHint(pData){}
-
};
-TYPEINIT1( FmFilterTextChangedHint, FmFilterHint );
class FilterClearingHint : public SfxHint
{
public:
- TYPEINFO_OVERRIDE();
FilterClearingHint(){}
};
-TYPEINIT1( FilterClearingHint, SfxHint );
class FmFilterCurrentChangedHint : public SfxHint
{
public:
- TYPEINFO_OVERRIDE();
FmFilterCurrentChangedHint(){}
};
-TYPEINIT1( FmFilterCurrentChangedHint, SfxHint );
// class FmFilterAdapter, Listener an den FilterControls
@@ -1483,28 +1469,28 @@ bool FmFilterNavigator::Select( SvTreeListEntry* pEntry, bool bSelect )
void FmFilterNavigator::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(FmFilterInsertedHint))
+ if ( dynamic_cast<const FmFilterInsertedHint*>(&rHint) )
{
- FmFilterInsertedHint* pHint = (FmFilterInsertedHint*)&rHint;
+ const FmFilterInsertedHint* pHint = dynamic_cast<const FmFilterInsertedHint*>(&rHint);
Insert(pHint->GetData(), pHint->GetPos());
}
- else if( rHint.ISA(FilterClearingHint) )
+ else if( dynamic_cast<const FilterClearingHint*>(&rHint) )
{
SvTreeListBox::Clear();
}
- else if( rHint.ISA(FmFilterRemovedHint) )
+ else if( dynamic_cast<const FmFilterRemovedHint*>(&rHint) )
{
- FmFilterRemovedHint* pHint = (FmFilterRemovedHint*)&rHint;
+ const FmFilterRemovedHint* pHint = dynamic_cast<const FmFilterRemovedHint*>(&rHint);
Remove(pHint->GetData());
}
- else if( rHint.ISA(FmFilterTextChangedHint) )
+ else if( dynamic_cast<const FmFilterTextChangedHint*>(&rHint) )
{
- FmFilterTextChangedHint* pHint = (FmFilterTextChangedHint*)&rHint;
+ const FmFilterTextChangedHint* pHint = dynamic_cast<const FmFilterTextChangedHint*>(&rHint);
SvTreeListEntry* pEntry = FindEntry(pHint->GetData());
if (pEntry)
SetEntryText( pEntry, pHint->GetData()->GetText());
}
- else if( rHint.ISA(FmFilterCurrentChangedHint) )
+ else if( dynamic_cast<const FmFilterCurrentChangedHint*>(&rHint) )
{
// invalidate the entries
for (SvTreeListEntry* pEntry = First(); pEntry != NULL;
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index ca585ae128d8..4c24ad1c73cc 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -69,8 +69,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
-TYPEINIT1( FmNavInsertedHint, SfxHint );
-
FmNavInsertedHint::FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos )
:pEntryData( pInsertedEntryData )
,nPos( nRelPos )
@@ -87,8 +85,6 @@ FmNavInsertedHint::~FmNavInsertedHint()
// class FmNavInsertedHint
-TYPEINIT1( FmNavModelReplacedHint, SfxHint );
-
FmNavModelReplacedHint::FmNavModelReplacedHint( FmEntryData* pAffectedEntryData )
:pEntryData( pAffectedEntryData )
{
@@ -99,8 +95,6 @@ FmNavModelReplacedHint::~FmNavModelReplacedHint()
{
}
-TYPEINIT1( FmNavRemovedHint, SfxHint );
-
FmNavRemovedHint::FmNavRemovedHint( FmEntryData* pRemovedEntryData )
:pEntryData( pRemovedEntryData )
{
@@ -111,8 +105,6 @@ FmNavRemovedHint::~FmNavRemovedHint()
{
}
-TYPEINIT1( FmNavNameChangedHint, SfxHint );
-
FmNavNameChangedHint::FmNavNameChangedHint( FmEntryData* pData, const OUString& rNewName )
:pEntryData( pData )
,aNewName( rNewName )
@@ -124,8 +116,6 @@ FmNavNameChangedHint::~FmNavNameChangedHint()
{
}
-TYPEINIT1( FmNavClearedHint, SfxHint );
-
FmNavClearedHint::FmNavClearedHint()
{
}
@@ -136,15 +126,6 @@ FmNavClearedHint::~FmNavClearedHint()
}
-// class FmNavRequestSelectHint
-
-TYPEINIT1(FmNavRequestSelectHint, SfxHint);
-
-
-// class FmNavViewMarksChanged
-
-TYPEINIT1(FmNavViewMarksChanged, SfxHint);
-
FmEntryDataList::FmEntryDataList()
{
}
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 80fc7441674e..36671195d898 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -144,9 +144,6 @@ using namespace ::com::sun::star::form::runtime;
using namespace ::com::sun::star::frame;
using namespace ::svxform;
-TYPEINIT1( FmDesignModeChangedHint, SfxHint );
-
-
FmDesignModeChangedHint::FmDesignModeChangedHint( bool bDesMode )
:m_bDesignMode( bDesMode )
{
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 11487c780f28..6d0e16747ebd 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -287,9 +287,9 @@ void FmXUndoEnvironment::ModeChanged()
void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(SdrHint))
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
- SdrHint* pSdrHint = (SdrHint*)&rHint;
switch( pSdrHint->GetKind() )
{
case HINT_OBJINSERTED:
@@ -307,9 +307,9 @@ void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else if (dynamic_cast<const SfxSimpleHint*>(&rHint))
{
- switch ( ((SfxSimpleHint&)rHint).GetId() )
+ switch ( static_cast<const SfxSimpleHint*>(&rHint)->GetId() )
{
case SFX_HINT_DYING:
dispose();
@@ -320,9 +320,9 @@ void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(SfxEventHint))
+ else if (dynamic_cast<const SfxEventHint*>(&rHint))
{
- switch (((SfxEventHint&)rHint).GetEventId())
+ switch ( static_cast<const SfxEventHint*>(&rHint)->GetEventId() )
{
case SFX_EVENT_CREATEDOC:
case SFX_EVENT_OPENDOC:
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 850eda9f15e3..c9b1b60e7cb6 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1675,8 +1675,9 @@ FmXFormView::ObjectRemoveListener::ObjectRemoveListener( FmXFormView* pParent )
void FmXFormView::ObjectRemoveListener::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(SdrHint) && (((SdrHint&)rHint).GetKind() == HINT_OBJREMOVED))
- m_pParent->ObjectRemovedInAliveMode(((SdrHint&)rHint).GetObject());
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint && pSdrHint->GetKind() == HINT_OBJREMOVED)
+ m_pParent->ObjectRemovedInAliveMode(pSdrHint->GetObject());
}
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 187a1cb7af17..262d00afa15d 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -549,24 +549,24 @@ namespace svxform
void NavigatorTree::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA(FmNavRemovedHint) )
+ if( dynamic_cast<const FmNavRemovedHint*>(&rHint) )
{
- FmNavRemovedHint* pRemovedHint = (FmNavRemovedHint*)&rHint;
+ const FmNavRemovedHint* pRemovedHint = static_cast<const FmNavRemovedHint*>(&rHint);
FmEntryData* pEntryData = pRemovedHint->GetEntryData();
Remove( pEntryData );
}
- else if( rHint.ISA(FmNavInsertedHint) )
+ else if( dynamic_cast<const FmNavInsertedHint*>(&rHint) )
{
- FmNavInsertedHint* pInsertedHint = (FmNavInsertedHint*)&rHint;
+ const FmNavInsertedHint* pInsertedHint = static_cast<const FmNavInsertedHint*>(&rHint);
FmEntryData* pEntryData = pInsertedHint->GetEntryData();
sal_uInt32 nRelPos = pInsertedHint->GetRelPos();
Insert( pEntryData, nRelPos );
}
- else if( rHint.ISA(FmNavModelReplacedHint) )
+ else if( dynamic_cast<const FmNavModelReplacedHint*>(&rHint) )
{
- FmEntryData* pData = ((FmNavModelReplacedHint*)&rHint)->GetEntryData();
+ FmEntryData* pData = static_cast<const FmNavModelReplacedHint*>(&rHint)->GetEntryData();
SvTreeListEntry* pEntry = FindEntry( pData );
if (pEntry)
{ // das Image neu setzen
@@ -575,14 +575,14 @@ namespace svxform
}
}
- else if( rHint.ISA(FmNavNameChangedHint) )
+ else if( dynamic_cast<const FmNavNameChangedHint*>(&rHint) )
{
- FmNavNameChangedHint* pNameChangedHint = (FmNavNameChangedHint*)&rHint;
+ const FmNavNameChangedHint* pNameChangedHint = static_cast<const FmNavNameChangedHint*>(&rHint);
SvTreeListEntry* pEntry = FindEntry( pNameChangedHint->GetEntryData() );
SetEntryText( pEntry, pNameChangedHint->GetNewName() );
}
- else if( rHint.ISA(FmNavClearedHint) )
+ else if( dynamic_cast<const FmNavClearedHint*>(&rHint) )
{
SvTreeListBox::Clear();
@@ -592,10 +592,10 @@ namespace svxform
m_pRootEntry = InsertEntry( SVX_RESSTR(RID_STR_FORMS), aRootImage, aRootImage,
NULL, false, 0, NULL );
}
- else if (!m_bMarkingObjects && rHint.ISA(FmNavRequestSelectHint))
+ else if (!m_bMarkingObjects && dynamic_cast<const FmNavRequestSelectHint*>(&rHint))
{ // wenn m_bMarkingObjects sal_True ist, markiere ich gerade selber Objekte, und da der ganze Mechanismus dahinter synchron ist,
// ist das genau der Hint, der durch mein Markieren ausgeloest wird, also kann ich ihn ignorieren
- FmNavRequestSelectHint* pershHint = (FmNavRequestSelectHint*)&rHint;
+ FmNavRequestSelectHint* pershHint = const_cast<FmNavRequestSelectHint*>(static_cast<const FmNavRequestSelectHint*>(&rHint));
FmEntryDataArray& arredToSelect = pershHint->GetItems();
SynchronizeSelection(arredToSelect);
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index 672692eef518..215060641680 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -691,9 +691,9 @@ namespace svxform
void NavigatorTreeModel::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA(SdrHint) )
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if( pSdrHint )
{
- SdrHint* pSdrHint = (SdrHint*)&rHint;
switch( pSdrHint->GetKind() )
{
case HINT_OBJINSERTED:
@@ -707,13 +707,13 @@ namespace svxform
}
}
// hat sich die shell verabschiedet?
- else if ( rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint*>(&rHint)->GetId() == SFX_HINT_DYING)
UpdateContent((FmFormShell*)NULL);
// hat sich die Markierung der Controls veraendert ?
- else if (rHint.ISA(FmNavViewMarksChanged))
+ else if (dynamic_cast<const FmNavViewMarksChanged*>(&rHint))
{
- FmNavViewMarksChanged* pvmcHint = (FmNavViewMarksChanged*)&rHint;
+ const FmNavViewMarksChanged* pvmcHint = static_cast<const FmNavViewMarksChanged*>(&rHint);
BroadcastMarkedObjects( pvmcHint->GetAffectedView()->GetMarkedObjectList() );
}
}
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index fbfa8d8e6bf2..edec6ffffa10 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -67,7 +67,6 @@ class FmNavInsertedHint : public SfxHint
sal_uInt32 nPos;
public:
- TYPEINFO_OVERRIDE();
FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos );
virtual ~FmNavInsertedHint();
@@ -81,7 +80,6 @@ class FmNavModelReplacedHint : public SfxHint
FmEntryData* pEntryData; // die Daten des Eintrages, der ein neues Model bekommen hat
public:
- TYPEINFO_OVERRIDE();
FmNavModelReplacedHint( FmEntryData* pAffectedEntryData );
virtual ~FmNavModelReplacedHint();
@@ -94,7 +92,6 @@ class FmNavRemovedHint : public SfxHint
FmEntryData* pEntryData;
public:
- TYPEINFO_OVERRIDE();
FmNavRemovedHint( FmEntryData* pInsertedEntryData );
virtual ~FmNavRemovedHint();
@@ -108,7 +105,6 @@ class FmNavNameChangedHint : public SfxHint
OUString aNewName;
public:
- TYPEINFO_OVERRIDE();
FmNavNameChangedHint( FmEntryData* pData, const OUString& rNewName );
virtual ~FmNavNameChangedHint();
@@ -120,7 +116,6 @@ public:
class FmNavClearedHint : public SfxHint
{
public:
- TYPEINFO_OVERRIDE();
FmNavClearedHint();
virtual ~FmNavClearedHint();
};
@@ -130,11 +125,10 @@ class FmNavViewMarksChanged : public SfxHint
{
FmFormView* pView;
public:
- TYPEINFO_OVERRIDE();
FmNavViewMarksChanged(FmFormView* pWhichView) { pView = pWhichView; }
virtual ~FmNavViewMarksChanged() {}
- FmFormView* GetAffectedView() { return pView; }
+ const FmFormView* GetAffectedView() const { return pView; }
};
@@ -225,7 +219,6 @@ class FmNavRequestSelectHint : public SfxHint
FmEntryDataArray m_arredToSelect;
bool m_bMixedSelection;
public:
- TYPEINFO_OVERRIDE();
FmNavRequestSelectHint()
: m_bMixedSelection(false)
{
@@ -233,7 +226,7 @@ public:
virtual ~FmNavRequestSelectHint() {}
void SetMixedSelection(bool bMixedSelection) { m_bMixedSelection = bMixedSelection; }
- bool IsMixedSelection() { return m_bMixedSelection; }
+ bool IsMixedSelection() const { return m_bMixedSelection; }
void AddItem(FmEntryData* pEntry) { m_arredToSelect.insert(pEntry); }
void ClearItems() { m_arredToSelect.clear(); }
FmEntryDataArray& GetItems() { return m_arredToSelect; }
diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx
index 65ca2d5073d9..5f4e7966d570 100644
--- a/svx/source/mnuctrls/fntctl.cxx
+++ b/svx/source/mnuctrls/fntctl.cxx
@@ -119,8 +119,9 @@ void SvxFontMenuControl::StateChanged(
void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.Type() != TYPE(SfxSimpleHint) &&
- ( (SfxSimpleHint&)rHint ).GetId() == SFX_HINT_DOCCHANGED )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if ( pSimpleHint &&
+ pSimpleHint->GetId() == SFX_HINT_DOCCHANGED )
FillMenu();
}
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 454d7b974506..5ad4d9e0b956 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -522,7 +522,7 @@ namespace sdr
{
bool bHintUsed(false);
- SfxStyleSheetHint *pStyleHint = PTR_CAST(SfxStyleSheetHint, &rHint);
+ const SfxStyleSheetHint* pStyleHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
if(pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet())
{
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx
index 716dfb50c469..afb4b68f032a 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -212,8 +212,8 @@ namespace sdr
TextProperties::Notify( rBC, rHint );
bool bRemoveRenderGeometry = false;
- const SfxStyleSheetHint *pStyleHint = PTR_CAST( SfxStyleSheetHint, &rHint );
- const SfxSimpleHint *pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxStyleSheetHint* pStyleHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if ( pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet() )
{
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index e4a2a5f89744..0196faa3b44d 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -554,7 +554,7 @@ namespace sdr
const svx::ITextProvider& rTextProvider(getTextProvider());
if(HAS_BASE(SfxStyleSheet, &rBC))
{
- SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
sal_uInt32 nId(pSimple ? pSimple->GetId() : 0L);
if(SFX_HINT_DATACHANGED == nId)
@@ -595,7 +595,7 @@ namespace sdr
}
else if(HAS_BASE(SfxStyleSheetBasePool, &rBC))
{
- SfxStyleSheetHintExtended* pExtendedHint = PTR_CAST(SfxStyleSheetHintExtended, &rHint);
+ const SfxStyleSheetHintExtended* pExtendedHint = dynamic_cast<const SfxStyleSheetHintExtended*>(&rHint);
if(pExtendedHint
&& SFX_STYLESHEET_MODIFIED == pExtendedHint->GetHint())
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 390835469ede..6945d2f66aca 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -143,7 +143,7 @@ void SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
SdrGlueEditView::Notify(rBC,rHint);
// change of printer while editing
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if (pSdrHint!=NULL && pTextEditOutliner!=NULL) {
SdrHintKind eKind=pSdrHint->GetKind();
if (eKind==HINT_REFDEVICECHG) {
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index bb2b68a97b00..4e7d9313738a 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -2015,8 +2015,6 @@ const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImpleme
-TYPEINIT1(SdrHint,SfxHint);
-
SdrHint::SdrHint(SdrHintKind eNewHint)
: mpPage(0L),
mpObj(0L),
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 2f3686af0eb4..8b066f0ab6e8 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -175,8 +175,8 @@ SdrMarkView::~SdrMarkView()
void SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
- if (pSdrHint!=NULL)
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint)
{
SdrHintKind eKind=pSdrHint->GetKind();
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 24146a18ee59..727c06122a71 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -124,7 +124,7 @@ void SdrAttrObj::SetModel(SdrModel* pNewModel)
void SdrAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- SfxSimpleHint *pSimple = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
bool bDataChg(pSimple && SFX_HINT_DATACHANGED == pSimple->GetId());
if(bDataChg)
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 1e690bfe8b78..a743cc3ce901 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -164,7 +164,6 @@ sdr::contact::ViewContact* SdrEdgeObj::CreateObjectSpecificViewContact()
}
-
TYPEINIT1(SdrEdgeObj,SdrTextObj);
SdrEdgeObj::SdrEdgeObj()
@@ -1567,7 +1566,7 @@ line (CL). The number of object margins per object varies between 0 and 3:
void SdrEdgeObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- SfxSimpleHint* pSimple=PTR_CAST(SfxSimpleHint,&rHint);
+ const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
sal_uIntPtr nId=pSimple==0 ? 0 : pSimple->GetId();
bool bDataChg=nId==SFX_HINT_DATACHANGED;
bool bDying=nId==SFX_HINT_DYING;
@@ -1587,7 +1586,7 @@ void SdrEdgeObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
SdrTextObj::Notify(rBC,rHint);
if (nNotifyingCount==0) { // a locking flag
((SdrEdgeObj*)this)->nNotifyingCount++;
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if (bDataChg) { // StyleSheet changed
ImpSetAttrToEdgeInfo(); // when changing templates, copy values from Pool to aEdgeInfo
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 3ab08d480cd4..bc790703b41f 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -120,8 +120,6 @@ OutputDevice* SdrPaintView::GetFirstOutputDevice() const
-TYPEINIT1( SvxViewHint, SfxHint );
-
SvxViewHint::SvxViewHint (HintType eHintType)
: meHintType(eHintType)
{
@@ -258,15 +256,16 @@ void SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
//If the stylesheet has been destroyed
if (&rBC == pDefaultStyleSheet)
{
- 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)
pDefaultStyleSheet = NULL;
return;
}
bool bObjChg=!bSomeObjChgdFlag; // if true, evaluate for ComeBack timer
if (bObjChg) {
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
- if (pSdrHint!=NULL) {
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ if (pSdrHint) {
SdrHintKind eKind=pSdrHint->GetKind();
if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || eKind==HINT_OBJREMOVED) {
if (bObjChg) {
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index c3753afbe0e5..0d8ad1a2b725 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -247,7 +247,7 @@ SvxColorDockingWindow::~SvxColorDockingWindow()
void SvxColorDockingWindow::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
+ const SfxPoolItemHint* pPoolItemHint = dynamic_cast<const SfxPoolItemHint*>(&rHint);
if ( pPoolItemHint
&& ( pPoolItemHint->GetObject()->ISA( SvxColorListItem ) ) )
{
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index 345ec9cabe39..b82bec79aeb4 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -72,7 +72,7 @@ void SvxUnoNameItemTable::dispose()
void SvxUnoNameItemTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetKind() )
dispose();
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index ed262d86fc14..bf07bc4e889b 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -123,7 +123,7 @@ void SvxUnoMarkerTable::dispose()
// SfxListener
void SvxUnoMarkerTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetKind() )
dispose();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 9d414580646f..3c7371095033 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1019,7 +1019,7 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
// #i55919# HINT_OBJCHG is only interesting if it's for this object
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
if (!pSdrHint || ( /* (pSdrHint->GetKind() != HINT_OBJREMOVED) && */
(pSdrHint->GetKind() != HINT_MODELCLEARED) &&
// #110094#-9 (pSdrHint->GetKind() != HINT_OBJLISTCLEAR) &&
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 209c473a0417..c893adb96c6c 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -328,9 +328,9 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
// #i105988 keep reference to this object
rtl::Reference< SvxTextEditSourceImpl > xThis( this );
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
+ const SvxViewHint* pViewHint = dynamic_cast<const SvxViewHint*>(&rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if (pSimpleHint)
{
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 6245f20da7f9..3c637414126b 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -136,7 +136,6 @@ public:
, pView(pV)
{}
- TYPEINFO_OVERRIDE();
const SwFmtFld* GetField() const { return pFld; }
sal_Int16 Which() const { return nWhich; }
const SwView* GetView() const { return pView; }
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 6ca6e4779f17..45aff0922159 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -370,7 +370,6 @@ public:
, pView(pV)
{}
- TYPEINFO_OVERRIDE();
const SwRangeRedline* GetRedline() const { return pRedline; }
sal_Int16 Which() const { return nWhich; }
const SwView* GetView() const { return pView; }
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 14822d85831d..0ad03a881067 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -150,7 +150,7 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
{
// do not broadcast notifications for writer fly frames, because there
// are no shapes that need to know about them.
- const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrHint *pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
if ( !pSdrHint ||
( pSdrHint->GetObject() &&
( pSdrHint->GetObject()->ISA(SwFlyDrawObj) ||
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 9fb4aa624a2f..0c2d096cdac4 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -48,8 +48,6 @@
using namespace com::sun::star;
-TYPEINIT1(SwRedlineHint, SfxHint);
-
#ifdef DBG_UTIL
void sw_DebugRedline( const SwDoc* pDoc )
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index dd0b9567f215..c0ee2d7357c4 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -42,7 +42,7 @@ SwURLStateChanged::~SwURLStateChanged()
void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if( rHint.ISA( INetURLHistoryHint ) && pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() )
+ if( dynamic_cast<const INetURLHistoryHint*>(&rHint) && pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() )
{
// This URL has been changed:
const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject();
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2488b4c86025..a4efd89c7459 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3216,9 +3216,9 @@ void SwFrmHolder::Reset()
void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rBC == pFrm )
{
- if ( ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DYING && &rBC == pFrm )
pFrm = 0;
}
}
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 327768f58c1c..732b7220b9b8 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -39,7 +39,6 @@
#include <svl/smplhint.hxx>
TYPEINIT3(SwFmtFld, SfxPoolItem, SwModify, SfxBroadcaster)
-TYPEINIT1(SwFmtFldHint, SfxHint);
// constructor for default item in attribute-pool
SwFmtFld::SwFmtFld( sal_uInt16 nWhich )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2f9912c45ea6..f9d7fb4773b1 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -977,7 +977,7 @@ void SAL_CALL SwXStyleFamily::removeVetoableChangeListener( const OUString&, con
void SwXStyleFamily::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint *pHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
if( pHint && ( pHint->GetId() & SFX_HINT_DYING ) )
{
pBasePool = 0;
@@ -3274,7 +3274,7 @@ uno::Any SwXStyle::getPropertyDefault(const OUString& rPropertyName)
void SwXStyle::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
if( pHint )
{
if(( pHint->GetId() & SFX_HINT_DYING ) || ( pHint->GetId() & SFX_STYLESHEET_ERASED))
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 349bbaed6c18..6ad8133c4b84 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1272,7 +1272,7 @@ AddressMultiLineEdit::~AddressMultiLineEdit()
void AddressMultiLineEdit::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if (m_aSelectionLink.IsSet() && rHint.ISA(TextHint))
+ if (m_aSelectionLink.IsSet() && dynamic_cast<const TextHint*>(&rHint))
{
const TextHint& rTextHint = static_cast<const TextHint&>(rHint);
if (rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED ||
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 44781a6cd877..6bc7f33a1683 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -654,7 +654,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
// Catch hint for DocInfo
void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA( SfxEventHint ) )
+ if( dynamic_cast<const SfxEventHint*>(&rHint) )
{
SfxEventHint& rEvHint = (SfxEventHint&) rHint;
SwDocShell* pDocSh = PTR_CAST( SwDocShell, rEvHint.GetObjShell() );
@@ -705,7 +705,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
}
- else if(rHint.ISA(SfxItemSetHint))
+ else if(dynamic_cast<const SfxItemSetHint*>(&rHint))
{
if( SFX_ITEM_SET == ((SfxItemSetHint&)rHint).GetItemSet().GetItemState(SID_ATTR_PATHNAME))
{
@@ -715,7 +715,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
pList->Update();
}
}
- else if(rHint.ISA(SfxSimpleHint))
+ else if(dynamic_cast<const SfxSimpleHint*>(&rHint))
{
sal_uInt16 nHintId = ((SfxSimpleHint&)rHint).GetId();
if(SFX_HINT_DEINITIALIZING == nHintId)
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index f3b7b9c39050..38adecf52f48 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -215,7 +215,7 @@ void SwDocShell::DoFlushDocInfo()
static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint )
{
using namespace com::sun::star::script::vba::VBAEventId;
- if ( rHint.ISA( SfxEventHint ) )
+ if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
uno::Sequence< uno::Any > aArgs;
sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
@@ -244,7 +244,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
lcl_processCompatibleSfxHint( xVbaEvents, rHint );
sal_uInt16 nAction = 0;
- if( rHint.ISA(SfxSimpleHint) )
+ if( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
// switch for more actions
switch( ((SfxSimpleHint&) rHint).GetId() )
@@ -255,7 +255,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if( rHint.ISA(SfxEventHint) &&
+ else if( dynamic_cast<const SfxEventHint*>(&rHint) &&
((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
{
// #i38126# - own action id
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 0fa8e68f412c..3da6a018c318 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -3039,10 +3039,11 @@ void SwStyleSheetIterator::InvalidateIterator()
void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// search and remove from View-List!!
- if( rHint.ISA( SfxStyleSheetHint ) &&
- SFX_STYLESHEET_ERASED == ((SfxStyleSheetHint&) rHint).GetHint() )
+ const SfxStyleSheetHint* pStyleSheetHint = dynamic_cast<const SfxStyleSheetHint*>(&rHint);
+ if( pStyleSheetHint &&
+ SFX_STYLESHEET_ERASED == pStyleSheetHint->GetHint() )
{
- SfxStyleSheetBase* pStyle = ((SfxStyleSheetHint&)rHint).GetStyleSheet();
+ SfxStyleSheetBase* pStyle = pStyleSheetHint->GetStyleSheet();
if (pStyle)
aLst.RemoveName(pStyle->GetFamily(), pStyle->GetName());
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 6c1b7f350d03..b1ce47bb70b3 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -255,7 +255,7 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxEventHint) ) )
+ if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
sal_uInt32 nId = ((SfxEventHint&)rHint).GetEventId();
if ( nId == SW_EVENT_LAYOUT_FINISHED )
@@ -267,7 +267,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if ( rHint.IsA(TYPE(SfxSimpleHint) ) )
+ else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId();
switch ( nId )
@@ -312,7 +312,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if ( rHint.IsA(TYPE(SwFmtFldHint) ) )
+ else if ( dynamic_cast<const SwFmtFldHint*>(&rHint) )
{
const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint);
SwFmtFld* pFld = const_cast <SwFmtFld*>( rFmtHint.GetField() );
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index c1ff04e01f47..6a97983a234b 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -727,7 +727,7 @@ void SwSrcEditWindow::ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineO
void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ if ( dynamic_cast<const TextHint*>(&rHint) )
{
const TextHint& rTextHint = (const TextHint&)rHint;
if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 696916637a0b..af86372e7e39 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -767,11 +767,12 @@ sal_Int32 SwSrcView::PrintSource(
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) &&
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if ( pSimpleHint &&
(
- ((SfxSimpleHint&) rHint).GetId() == SFX_HINT_MODECHANGED ||
+ pSimpleHint->GetId() == SFX_HINT_MODECHANGED ||
(
- ((SfxSimpleHint&) rHint).GetId() == SFX_HINT_TITLECHANGED &&
+ pSimpleHint->GetId() == SFX_HINT_TITLECHANGED &&
!GetDocShell()->IsReadOnly() && aEditWin.IsReadonly()
)
)
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 5ed48eb213ae..452d8329d4a7 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1591,7 +1591,7 @@ SwGlossaryHdl* SwView::GetGlosHdl()
void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
bool bCallBase = true;
- if ( rHint.ISA(SfxSimpleHint) )
+ if ( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId();
switch ( nId )
@@ -1663,7 +1663,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
}
}
- else if(rHint.ISA(FmDesignModeChangedHint))
+ else if(dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
{
bool bDesignMode = ((FmDesignModeChangedHint&)rHint).GetDesignMode();
if (!bDesignMode && GetDrawFuncPtr())
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index deb0019eac84..3095807f4be6 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -786,9 +786,10 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
{
if ( &_rBC == &xDocSh )
{ // it's our document
- if ( _rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &_rHint );
+ if ( pSimpleHint )
{
- if ( SFX_HINT_DEINITIALIZING == static_cast< const SfxSimpleHint& >( _rHint ).GetId() )
+ if ( SFX_HINT_DEINITIALIZING == pSimpleHint->GetId() )
{
// our document is dying (possibly because we're shuting down, and the document was notified
// earlier than we are?)
@@ -798,7 +799,7 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
xDocSh.Clear();
}
}
- else if(_rHint.ISA(SfxEventHint))
+ else if(dynamic_cast<const SfxEventHint*>(&_rHint))
{
if(SFX_EVENT_PREPARECLOSEDOC == static_cast< const SfxEventHint& >( _rHint ).GetEventId())
{
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index db549530b40d..063c304301aa 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -137,10 +137,10 @@ public:
bool IsValid() const {return bValid;}
};
-void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
+void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA(SfxSimpleHint) &&
- (((SfxSimpleHint&) rHint).GetId() == SFX_HINT_DYING))
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
+ if( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING)
bValid = false;
}
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2c35600cc2bd..d6f60cd96530 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -999,14 +999,14 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
{
if(&rBrdc == pCreateView)
{
- if(rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ if(dynamic_cast<const SfxSimpleHint*>(&rHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
{
pCreateView = 0;
}
}
else
{
- if(rHint.ISA(SfxEventHint))
+ if(dynamic_cast<const SfxEventHint*>(&rHint))
{
if( pxObjectShell &&
((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_CLOSEAPP)
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index f375525e7d4a..195bf8529f07 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -268,8 +268,6 @@ void IdleFormatter::ForceTimeout()
}
}
-TYPEINIT1( TextHint, SfxSimpleHint );
-
TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
{
mnValue = 0;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index c26016faf2f0..6dee58f92c99 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -512,17 +512,17 @@ OUString ImpVclMEdit::GetTextLines( LineEnd aSeparator ) const
void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
if ( mpHScrollBar )
ImpSetHScrollBarThumbPos();
if ( mpVScrollBar )
mpVScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().Y() );
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
{
@@ -534,7 +534,7 @@ void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
ImpSetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTFORMATTED )
{
if ( mpHScrollBar )
{
@@ -547,16 +547,16 @@ void ImpVclMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if( rTextHint.GetId() == TEXT_HINT_MODIFIED )
+ else if( pTextHint->GetId() == TEXT_HINT_MODIFIED )
{
ImpUpdateSrollBarVis(pVclMultiLineEdit->GetStyle());
pVclMultiLineEdit->Modify();
}
- else if( rTextHint.GetId() == TEXT_HINT_VIEWSELECTIONCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_VIEWSELECTIONCHANGED )
{
pVclMultiLineEdit->SelectionChanged();
}
- else if( rTextHint.GetId() == TEXT_HINT_VIEWCARETCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_VIEWCARETCHANGED )
{
pVclMultiLineEdit->CaretChanged();
}