diff options
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 245a8e84a690..95fb6ac185c3 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -4,9 +4,9 @@ * * $RCSfile: viewobjectcontactofunocontrol.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: obo $ $Date: 2007-03-06 14:40:01 $ + * last change: $Author: kz $ $Date: 2007-05-10 10:09:18 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1816,11 +1816,16 @@ namespace sdr { namespace contact { } #endif - // don't paint if there's a "alive control" which paints itself - SdrPageView* pPageView = _rDisplayInfo.GetPageView(); - bool bIsDesignMode = pPageView ? pPageView->GetView().IsDesignMode() : true; + // don't paint if there's a "visible control" which paints itself + bool bVisibleControl = false; + try + { + Reference< XWindow2 > xControlWindow( m_pImpl->getExistentControl(), UNO_QUERY_THROW ); + bVisibleControl = xControlWindow->isVisible(); + } + catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - if ( bIsDesignMode ) + if ( !bVisibleControl ) { OSL_ENSURE( _rDisplayInfo.GetOutputDevice(), "UnoControlWindowContact::doPaintObject: invalid output device!" ); if ( !_rDisplayInfo.GetOutputDevice() ) |