diff options
author | Mark Hung <marklh9@gmail.com> | 2016-11-06 12:28:00 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2016-11-12 03:18:12 +0000 |
commit | 4c742c4726e9dee47f6ae9fa3654bfb486b86e54 (patch) | |
tree | 48c762f7faf0ac3ff7dea25214a0620d34b40530 | |
parent | 1a31df1225b3149bf35ca40a76859b52c9c07886 (diff) |
tdf#100733 oox: imports RefR and RefAngle of polar handles.
RefR and RefAngle was ignored when importing polar
handles for customshapes.
Change-Id: I2d2aa1b0e54cf4946417c6dc81ecdbe58f6b50e9
Reviewed-on: https://gerrit.libreoffice.org/30601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r-- | oox/source/drawingml/customshapegeometry.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/customshapeproperties.cxx | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index 13a81988545b..56d00f322c04 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -706,6 +706,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler2Helper& rPare const OUString aEmptyDefault; if ( rAttribs.hasAttribute( XML_gdRefR ) ) { + mrAdjustHandle.polar = true ; mrAdjustHandle.gdRef1 = GetGeomGuideName( rAttribs.getString( XML_gdRefR, aEmptyDefault ) ); } if ( rAttribs.hasAttribute( XML_minR ) ) @@ -718,6 +719,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler2Helper& rPare } if ( rAttribs.hasAttribute( XML_gdRefAng ) ) { + mrAdjustHandle.polar = true ; mrAdjustHandle.gdRef2 = GetGeomGuideName( rAttribs.getString( XML_gdRefAng, aEmptyDefault ) ); } if ( rAttribs.hasAttribute( XML_minAng ) ) @@ -732,6 +734,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler2Helper& rPare ContextHandlerRef PolarAdjustHandleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) { + // mrAdjustHandle.pos uses planar coordinates. if ( aElementToken == A_TOKEN( pos ) ) return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D return nullptr; diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 3ef04b412d08..5fddf1961c4a 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -328,7 +328,25 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi // adjustment value is decisive if ( maAdjustHandleList[ i ].polar ) { + // Polar handles in DrawingML + // 1. don't have reference center, so PROP_Polar isn't needed. + // 2. position always use planar coordinates. + // 3. use RefAngle and RefR to specify adjustment value to be updated. + // 4. The unit of angular adjustment values are 6000th degree. + aHandle.setProperty( PROP_Position, maAdjustHandleList[ i ].pos); + if ( maAdjustHandleList[ i ].gdRef1.has() ) + { + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef1.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefR, nIndex); + } + if ( maAdjustHandleList[ i ].gdRef2.has() ) + { + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef2.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefAngle, nIndex); + } if ( maAdjustHandleList[ i ].min1.has() ) aHandle.setProperty( PROP_RadiusRangeMinimum, maAdjustHandleList[ i ].min1.get()); if ( maAdjustHandleList[ i ].max1.has() ) |