From 853497c4a7d7a481235569ab59b511f63e1051fa Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Thu, 21 Jan 2010 07:52:26 +0000 Subject: reverting the fix for #i108325#, which caused #i108423#. Adding another, less invasive workaround. Still not the final solution, which is covered by issue 108357 --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 ------ svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 92420fb6da3a..bb7635913dce 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -373,12 +373,6 @@ namespace drawinglayer aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY())); } - else if( xControlWindow.is() ) - { - Window* pWin = VCLUnoHelper::GetWindow( rXControl->getPeer() ); - if( pWin ) - pWin->Invalidate(); - } // restore original graphics xControlView->setGraphics(xOriginalGraphics); 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; } }; @@ -297,6 +299,15 @@ namespace sdr { namespace contact { m_xControlView->setZoom( (float)_rScale.getX(), (float)_rScale.getY() ); } + //-------------------------------------------------------------------- + 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 { @@ -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 -- cgit v1.2.3