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 2014/04/25 14:56:20 UTC

svn commit: r1590014 - /openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx

Author: alg
Date: Fri Apr 25 12:56:19 2014
New Revision: 1590014

URL: http://svn.apache.org/r1590014
Log:
i124703 adapt coordinate range from ms relative control points to aoo relative control points

Modified:
    openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx

Modified: openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx?rev=1590014&r1=1590013&r2=1590014&view=diff
==============================================================================
--- openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx (original)
+++ openoffice/trunk/main/oox/source/drawingml/customshapeproperties.cxx Fri Apr 25 12:56:19 2014
@@ -31,6 +31,7 @@
 #include <com/sun/star/graphic/XGraphicTransformer.hpp>
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
+#include <basegfx/numeric/ftools.hxx>
 
 using rtl::OUString;
 using namespace ::oox::core;
@@ -194,7 +195,15 @@ void CustomShapeProperties::pushToPropSe
 								if ( ( nAdjustmentIndex >= 0 ) && ( nAdjustmentIndex < aAdjustmentSeq.getLength() ) )
 								{
 									EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
-									aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32();
+
+                                    sal_Int32 nValue((*aIter).maFormula.toInt32());
+
+                                    // #124703# The ms control point coordinates are relative to the
+                                    // object center in the range [-50000 .. 50000] while our customshapes
+                                    // use a range from [0 .. 21600], so adapt the value as needed
+                                    nValue = basegfx::fround((double(nValue) + 50000.0) * (21600.0 / 100000.0));
+
+									aAdjustmentVal.Value <<= nValue;
 									aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
 									aAdjustmentSeq[ nAdjustmentIndex ] = aAdjustmentVal;
 								}