diff options
author | Armin Le Grand <alg@apache.org> | 2014-04-25 12:56:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-27 14:04:43 +0100 |
commit | c764a3d978beb2e6197a8d3f7df53d81ebf72467 (patch) | |
tree | 7364974218558d2477914469b91d6cb90233e194 /oox | |
parent | d19af82eabb4a356a1d29cd470c48c42952b6a7e (diff) |
Resolves: #i124703# adapt coordinate range from ms relative...
control points to our relative control points
(cherry picked from commit 8625253da753153838554fef459ae603ca8d3ecc)
Conflicts:
oox/source/drawingml/customshapeproperties.cxx
Change-Id: I356a44fdbdcc22630811467e706bcb60c41dbc2c
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 276d5bb51efd..0496dc38f518 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> +#include <basegfx/numeric/ftools.hxx> using namespace ::oox::core; using namespace ::com::sun::star; @@ -185,7 +186,15 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi } } else if ( aAdjustmentSeq.getLength() > 0 ) { EnhancedCustomShapeAdjustmentValue aAdjustmentVal; - aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32(); + + sal_Int32 nValue((*aIter).maFormula.toInt32()); + + // #i124703# 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; aAdjustmentVal.Name = (*aIter).maName; aAdjustmentSeq[ nIndex++ ] = aAdjustmentVal; |