diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-27 16:57:21 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-06 15:47:44 -0500 |
commit | 5bce32904091ffe28884fd5c0f4801ee82bad101 (patch) | |
tree | fc2573078a858de456a0dc7b7810176d433241c7 /reportdesign | |
parent | 10143717834d8401d85fdf9564e782a58b9983ec (diff) |
SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.
Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/inc/RptObject.hxx | 1 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/RptObjectListener.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/UndoEnv.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/ColorListener.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/ui/report/SectionView.cxx | 7 | ||||
-rw-r--r-- | reportdesign/source/ui/report/StartMarker.cxx | 5 |
7 files changed, 12 insertions, 18 deletions
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); |