diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-02-04 17:59:58 +0100 |
commit | 2bfec91ae18312354921e670aa7f8a7bed60ec17 (patch) | |
tree | a84c420aa987c600cd765a5cad4a35bc1be38976 /svx/source/sdr | |
parent | d961a721ab9ded5dfedc00d874f2d8215bc2b2df (diff) | |
parent | 1813942ec2be139a3cd7992f9e25671b2280334c (diff) |
CWS svxsplit: merge with m71
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 23 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 16 |
2 files changed, 27 insertions, 12 deletions
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index e07f6b4d37..8e428a6c29 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -68,11 +68,10 @@ namespace sdr // no need to correct if no extra text range if(aTextRange != aObjectRange) { - const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation()); const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); // only correct when rotation and/or shear is used - if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation)) + if(rGeoStat.nShearWink || rGeoStat.nDrehWink ) { // text range needs to be corrected by // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's @@ -96,11 +95,6 @@ namespace sdr aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } - if(!basegfx::fTools::equalZero(fExtraTextRotation)) - { - aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); - } - aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); aRotObjectRange.transform(aRotMatrix); @@ -189,6 +183,16 @@ namespace sdr aTextRange.getMinY() - aObjectRange.getMinimum().getY()); } + if(!basegfx::fTools::equalZero(fExtraTextRotation)) + { + basegfx::B2DVector aTranslation( + ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ), + ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) ); + aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() ); + aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); + aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() ); + } + if(rGeoStat.nShearWink) { aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); @@ -199,11 +203,6 @@ namespace sdr aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } - if(!basegfx::fTools::equalZero(fExtraTextRotation)) - { - aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); - } - // give text it's target position aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); } 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 |