From 8c599b37627245b5aaf8f43a190ce4e7b1c69c46 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Wed, 3 Nov 2004 15:03:37 +0000 Subject: INTEGRATION: CWS jmf3 (1.3.68); FILE MERGED 2004/10/04 10:33:12 ka 1.3.68.1: watch for correct cast --- svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'svx/source/sdr') diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx index 87b89830f8be..dc9352c50a42 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewobjectcontactofsdrmediaobj.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2004-08-24 07:20:33 $ + * last change: $Author: rt $ $Date: 2004-11-03 16:03:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,9 +180,15 @@ void ViewObjectContactOfSdrMediaObj::PaintObject(DisplayInfo& rDisplayInfo) Window* ViewObjectContactOfSdrMediaObj::getWindow() const { - OutputDevice& rOutDev = static_cast< ObjectContactOfPageView& >( GetObjectContact() ).GetPageViewWindow().GetOutputDevice(); + ObjectContactOfPageView* pOC = dynamic_cast< ObjectContactOfPageView* >( &GetObjectContact() ); - return( ( rOutDev.GetOutDevType() == OUTDEV_WINDOW ) ? static_cast< Window* >( &rOutDev ) : NULL ); + if( pOC) + { + OutputDevice& rOutDev = pOC->GetPageViewWindow().GetOutputDevice(); + return( ( rOutDev.GetOutDevType() == OUTDEV_WINDOW ) ? static_cast< Window* >( &rOutDev ) : NULL ); + } + + return NULL; } // ------------------------------------------------------------------------------ -- cgit