summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-01-11 15:24:27 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-01-11 17:14:45 +0530
commit0b63bb1d5f37ad673b0aadefe4bfe1e61ae667b9 (patch)
tree2bf5be4c1bd532e2b5035b04dfdc323e606b028e /svx
parentf5113dbaf26b9f617ac346c915ce1734bdf317d5 (diff)
n#734734: Text rotation fixes.
PPTX would need rotation of text _inside_ text/object boundaries, rather than the rotation of the text/object itself. cherrypick: 5c4d1b05faa8a3d704fc74a186a173f8cc019cc1
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdoashp.hxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx5
3 files changed, 12 insertions, 3 deletions
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 3d91549fa44d..013e1508239b 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -149,7 +149,7 @@ public:
void SetMirroredY( const sal_Bool bMirroredY );
double GetObjectRotation() const;
- double GetExtraTextRotation() const;
+ double GetExtraTextRotation( const bool bPreRotation = false ) const;
TYPEINFO();
SdrObjCustomShape();
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 2e63da2fb9f7..85628caf7ce3 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -160,6 +160,14 @@ namespace sdr
// #i101684# get the text range unrotated and absolute to the object range
const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
+ // Rotation before scaling
+ if(!basegfx::fTools::equalZero(GetCustomShapeObj().GetExtraTextRotation(true)))
+ {
+ basegfx::B2DVector aTranslation(0.5, 0.5);
+ aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
+ aTextBoxMatrix.rotate((360.0 - GetCustomShapeObj().GetExtraTextRotation(true)) * F_PI180);
+ aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
+ }
// give text object a size
aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index f8df28b792b8..48720080d75d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -538,12 +538,13 @@ double SdrObjCustomShape::GetObjectRotation() const
return fObjectRotation;
}
-double SdrObjCustomShape::GetExtraTextRotation() const
+double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const
{
const com::sun::star::uno::Any* pAny;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
- pAny = rGeometryItem.GetPropertyValueByName( sTextRotateAngle );
+ const rtl::OUString sTextPreRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextPreRotateAngle" ) );
+ pAny = rGeometryItem.GetPropertyValueByName( bPreRotation ? sTextPreRotateAngle : sTextRotateAngle );
double fExtraTextRotateAngle = 0.0;
if ( pAny )
*pAny >>= fExtraTextRotateAngle;