--- svx/source/sdr/contact/viewcontactofunocontrol.cxx 2007-06-27 19:47:02.000000000 +0100 +++ svx/source/sdr/contact/viewcontactofunocontrol.cxx 2007-11-18 15:58:25.000000000 +0000 @@ -74,6 +74,7 @@ #include #endif +#include //........................................................................ namespace sdr { namespace contact { //........................................................................ @@ -211,14 +212,23 @@ namespace sdr { namespace contact { // since the VCL window is not moved to the proper position. // #i72694# / 2006-12-18 / frank.schoenheit@sun.com + const ViewObjectContactOfUnoControl& rVOC( dynamic_cast< const ViewObjectContactOfUnoControl& >( _rAssociatedVOC ) ); // #i74769# to not resize and position at each DrawLayer() use FormControl flag if(_rDisplayInfo.GetControlLayerPainting()) { - const ViewObjectContactOfUnoControl& rVOC( dynamic_cast< const ViewObjectContactOfUnoControl& >( _rAssociatedVOC ) ); rVOC.positionControlForPaint( _rDisplayInfo ); } - return ViewContactOfSdrObj::ShouldPaintObject( _rDisplayInfo, _rAssociatedVOC ); + Reference< com::sun::star::awt::XWindow2 > xControlWindow( rVOC.getExistentControl(), com::sun::star::uno::UNO_QUERY ); + + // i#82791 design mode overrides Visible preference at XWindow + if ( xControlWindow.is() ) + { + SdrPageView* pPageView = _rDisplayInfo.GetPageView(); + bool bIsDesignMode = pPageView ? pPageView->GetView().IsDesignMode() : false; + return bIsDesignMode ? ViewContactOfSdrObj::ShouldPaintObject( _rDisplayInfo, _rAssociatedVOC ) : xControlWindow->isVisible(); + } + return ViewContactOfSdrObj::ShouldPaintObject( _rDisplayInfo, _rAssociatedVOC ); } //........................................................................