summaryrefslogtreecommitdiff
path: root/sfx2/source/view
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/viewfrm.cxx15
-rw-r--r--sfx2/source/view/viewprn.cxx7
-rw-r--r--sfx2/source/view/viewsh.cxx5
3 files changed, 15 insertions, 12 deletions
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:
{