[Libreoffice-commits] .: oox/source svx/inc svx/source

Muthu Subramanian sumuthu at kemper.freedesktop.org
Mon Apr 9 05:41:30 PDT 2012


 oox/source/drawingml/customshapeproperties.cxx        |    1 +
 oox/source/token/properties.txt                       |    1 +
 svx/inc/svx/EnhancedCustomShape2d.hxx                 |    1 +
 svx/inc/svx/svdoashp.hxx                              |    1 +
 svx/source/customshapes/EnhancedCustomShape2d.cxx     |    5 +++++
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx |   10 ++++++++--
 svx/source/svdraw/svdoashp.cxx                        |   11 +++++++++++
 7 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 1c44b263d789b4c20e9178c6432300e301df94d6
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Mon Apr 9 18:24:11 2012 +0530

    fdo43752: PPTX import fix affected odp imports.
    
    Related bugs: n#719989, n#719997

diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 071f37a..90c0027 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -158,6 +158,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
         aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
         aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
         aPropertyMap[ PROP_TextPreRotateAngle ] <<= Any( mnTextRotateAngle );
+        aPropertyMap[ PROP_IsPostRotateAngle ] <<= true; // For OpenXML Imports
         Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
         aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
 
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 7ad1a4c..a86df72 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -244,6 +244,7 @@ IsLoaded
 IsNumbering
 IsOutlineSymbolsSet
 IsPlaceholderDependent
+IsPostRotateAngle
 IsSharedFormula
 IsStartOfNewPage
 IsTextWrapped
diff --git a/svx/inc/svx/EnhancedCustomShape2d.hxx b/svx/inc/svx/EnhancedCustomShape2d.hxx
index 415385c..0d9da95 100644
--- a/svx/inc/svx/EnhancedCustomShape2d.hxx
+++ b/svx/inc/svx/EnhancedCustomShape2d.hxx
@@ -182,6 +182,7 @@ class EnhancedCustomShape2d : public SfxItemSet
         sal_Bool                    IsFlipVert() { return bFlipV; };
         sal_Bool                    IsFlipHorz() { return bFlipH; };
         sal_Int32                   GetRotateAngle() { return nRotateAngle; };
+        SVX_DLLPUBLIC bool          IsPostRotate() const;
 
         SVX_DLLPUBLIC SdrObject*                    CreateLineGeometry();
         SVX_DLLPUBLIC SdrObject*                    CreateObject( sal_Bool bLineGeometryNeededOnly );
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 013e150..0f54019 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -145,6 +145,7 @@ public:
 
     sal_Bool IsMirroredX() const;
     sal_Bool IsMirroredY() const;
+    bool     IsPostRotate() const;
     void SetMirroredX( const sal_Bool bMirroredX );
     void SetMirroredY( const sal_Bool bMirroredY );
 
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 3087526..39a7709 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2332,6 +2332,11 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
     }
 }
 
+bool EnhancedCustomShape2d::IsPostRotate() const
+{
+    return pCustomShapeObj->ISA( SdrObjCustomShape ) ? ((SdrObjCustomShape*)pCustomShapeObj)->IsPostRotate() : false;
+}
+
 SdrObject* EnhancedCustomShape2d::CreateLineGeometry()
 {
     return CreateObject( sal_True );
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 3be2cd4..cfb8c41 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -276,6 +276,7 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
 
         EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
         sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
+        bool bPostRotateAngle = aCustomShape2d.IsPostRotate();
 
         sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
         sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
@@ -315,6 +316,11 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
                 }
                 pRenderedShape->Shear( pSdrObjCustomShape->GetSnapRect().Center(), nShearWink, nTan, sal_False);
             }
+            if( !bPostRotateAngle && nRotateAngle )
+            {
+                double a = nRotateAngle * F_PI18000;
+                pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
+            }
             if ( bFlipV )
             {
                 Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
@@ -327,8 +333,8 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
                 Point aBottom( aTop.X(), aTop.Y() + 1000 );
                 pRenderedShape->NbcMirror( aTop, aBottom );
             }
-            // Note that the rotation needs be done after flipping
-            if( nRotateAngle )
+            // Specifically for pptx imports
+            if( bPostRotateAngle && nRotateAngle )
             {
                 double a = nRotateAngle * F_PI18000;
                 pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 62adfb7..23898e1 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -536,6 +536,17 @@ double SdrObjCustomShape::GetObjectRotation() const
     return fObjectRotation;
 }
 
+bool SdrObjCustomShape::IsPostRotate() const
+{
+    const com::sun::star::uno::Any* pAny;
+    bool bPostRotate = false;
+    SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+    pAny = rGeometryItem.GetPropertyValueByName( "IsPostRotateAngle" );
+    if ( pAny )
+        *pAny >>= bPostRotate;
+    return bPostRotate;
+}
+
 double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const
 {
     const com::sun::star::uno::Any* pAny;


More information about the Libreoffice-commits mailing list