summaryrefslogtreecommitdiff
path: root/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx')
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 6dbb1298a0..80121e5a8f 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