diff options
Diffstat (limited to 'svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 5f7bf41386e0..81d19df1e2fa 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -238,6 +238,8 @@ namespace sdr { namespace contact { getGraphics() const { return m_xControlView->getGraphics(); } inline void draw( const Point& _rTopLeft ) const { m_xControlView->draw( _rTopLeft.X(), _rTopLeft.Y() ); } + void invalidate() const; + public: inline const Reference< XControl >& getControl() const { return m_xControl; } }; @@ -298,6 +300,15 @@ namespace sdr { namespace contact { } //-------------------------------------------------------------------- + void ControlHolder::invalidate() const + { + Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); + OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); + if ( pWindow ) + pWindow->Invalidate(); + } + + //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { // no check whether we're valid, this is the responsibility of the caller @@ -1666,6 +1677,8 @@ namespace sdr { namespace contact { double fRotate, fShearX; _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX ); #endif + const bool bHadControl = m_pVOCImpl->getExistentControl().is(); + // force control here to make it a VCL ChildWindow. Will be fetched // and used below by getExistentControl() m_pVOCImpl->ensureControl( &_rViewInformation.getObjectToViewTransformation() ); @@ -1676,6 +1689,9 @@ namespace sdr { namespace contact { Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() ); const ControlHolder& rControl( m_pVOCImpl->getExistentControl() ); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) + rControl.invalidate(); + // check if we already have an XControl. if ( !xControlModel.is() || !rControl.is() ) // use the default mechanism. This will create a ControlPrimitive2D without |