You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/09/24 17:30:19 UTC

svn commit: r1389432 - in /incubator/ooo/trunk/main/oox: inc/oox/drawingml/customshapeproperties.hxx source/drawingml/customshapeproperties.cxx source/drawingml/shape.cxx source/token/properties.txt

Author: alg
Date: Mon Sep 24 15:30:19 2012
New Revision: 1389432

URL: http://svn.apache.org/viewvc?rev=1389432&view=rev
Log:
#119920# added handling of missing TextRotateAngle for CustomShape import for ooxml import

Modified:
    incubator/ooo/trunk/main/oox/inc/oox/drawingml/customshapeproperties.hxx
    incubator/ooo/trunk/main/oox/source/drawingml/customshapeproperties.cxx
    incubator/ooo/trunk/main/oox/source/drawingml/shape.cxx
    incubator/ooo/trunk/main/oox/source/token/properties.txt

Modified: incubator/ooo/trunk/main/oox/inc/oox/drawingml/customshapeproperties.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/inc/oox/drawingml/customshapeproperties.hxx?rev=1389432&r1=1389431&r2=1389432&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/inc/oox/drawingml/customshapeproperties.hxx (original)
+++ incubator/ooo/trunk/main/oox/inc/oox/drawingml/customshapeproperties.hxx Mon Sep 24 15:30:19 2012
@@ -130,6 +130,9 @@ public:
 	void								setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
 	void								setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
 
+    // #119920# Add missing extra text rotation
+    void setTextRotation(sal_Int32 nTextRotation) { mnTextRotation = nTextRotation; }
+
 	double getValue( const std::vector< CustomShapeGuide >&, sal_uInt32 nIndex ) const;
 	static sal_Int32 SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide );
 	static sal_Int32 GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const rtl::OUString& rFormulaName );
@@ -148,6 +151,9 @@ private:
 									maSegments;
 	sal_Bool						mbMirroredX;
 	sal_Bool						mbMirroredY;
+
+    // #119920# Add missing extra text rotation
+    sal_Int32                       mnTextRotation;
 };
 
 } }

Modified: incubator/ooo/trunk/main/oox/source/drawingml/customshapeproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/drawingml/customshapeproperties.cxx?rev=1389432&r1=1389431&r2=1389432&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/drawingml/customshapeproperties.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/drawingml/customshapeproperties.cxx Mon Sep 24 15:30:19 2012
@@ -45,6 +45,7 @@ namespace oox { namespace drawingml {
 CustomShapeProperties::CustomShapeProperties()
 : mbMirroredX	( sal_False )
 , mbMirroredY	( sal_False )
+, mnTextRotation(0) // #119920# Add missing extra text rotation
 {
 }
 CustomShapeProperties::~CustomShapeProperties()
@@ -94,7 +95,23 @@ void CustomShapeProperties::pushToPropSe
         if( xDefaulter.is() )
             xDefaulter->createCustomShapeDefaults( maShapePresetType );
 
-		if ( maAdjustmentGuideList.size() )
+        PropertyMap aPropertyMap;
+        
+        aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
+        aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
+
+        if(mnTextRotation)
+        {
+            // #119920# Handle missing text rotation
+            aPropertyMap[ PROP_TextRotateAngle ] <<= Any(mnTextRotation);
+        }
+
+        // converting the vector to a sequence
+        Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
+        PropertySet aPropSet( xPropSet );
+        aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
+
+        if ( maAdjustmentGuideList.size() )
 		{
 			const OUString sType = CREATE_OUSTRING( "Type" );
 			const OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) );
@@ -146,6 +163,12 @@ void CustomShapeProperties::pushToPropSe
         aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
 		aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
 		aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
+
+        if(mnTextRotation)
+        {
+            aPropertyMap[ PROP_TextRotation ] <<= Any(mnTextRotation);
+        }
+
 		awt::Size aSize( xShape->getSize() );
 		awt::Rectangle aViewBox( 0, 0, aSize.Width * 360, aSize.Height * 360 );
 		if ( maPath2DList.size() )

Modified: incubator/ooo/trunk/main/oox/source/drawingml/shape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/drawingml/shape.cxx?rev=1389432&r1=1389431&r2=1389432&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/drawingml/shape.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/drawingml/shape.cxx Mon Sep 24 15:30:19 2012
@@ -475,6 +475,18 @@ Reference< XShape > Shape::createAndInse
 				mpCustomShapePropertiesPtr->setMirroredX( sal_True );
 			if ( mbFlipV )
 				mpCustomShapePropertiesPtr->setMirroredY( sal_True );
+
+            // #119920 Handle missing text rotation
+            if(getTextBody())
+            {
+                const sal_Int32 nTextRotation(getTextBody()->getTextProperties().moRotation.get(0));
+
+                if(nTextRotation)
+                {
+                    mpCustomShapePropertiesPtr->setTextRotation((nTextRotation * -1) / 60000);
+                }
+            }
+
             mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape );
 		}
 

Modified: incubator/ooo/trunk/main/oox/source/token/properties.txt
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/token/properties.txt?rev=1389432&r1=1389431&r2=1389432&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/token/properties.txt (original)
+++ incubator/ooo/trunk/main/oox/source/token/properties.txt Mon Sep 24 15:30:19 2012
@@ -445,6 +445,7 @@ TextLeftDistance
 TextLowerDistance
 TextOverlap
 TextRightDistance
+TextRotateAngle
 TextRotation
 TextUpperDistance
 TextVerticalAdjust