diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-09-07 17:00:41 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-09-07 17:00:41 +0200 |
commit | 2f902237f59d13a7f0db1d6734e6083acc7fb009 (patch) | |
tree | 02c0a5bfb724baa686b5ecdee88dfe8c3056aa92 /oox/source | |
parent | 91d909ac8ec53ea135401babe8227f9c41b779b8 (diff) |
Replace macro with lambda
Change-Id: I47810e067d9dab0e40b5b1583193c01ad8c91759
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/lineproperties.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index c30f4537302b..534bc2a0cb9a 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -242,11 +242,11 @@ void lclPushMarkerProperties( ShapePropertyMap& rPropMap, TODO: this can be optimized by using a map. */ if( !rPropMap.hasNamedLineMarkerInTable( aMarkerName ) ) { -// pass X and Y as percentage to OOX_ARROW_POINT -#define OOX_ARROW_POINT( x, y ) awt::Point( static_cast< sal_Int32 >( fArrowWidth * ( x ) ), static_cast< sal_Int32 >( fArrowLength * ( y ) ) ) + // pass X and Y as percentage to OOX_ARROW_POINT + auto OOX_ARROW_POINT = [fArrowLength, fArrowWidth]( double x, double y ) { return awt::Point( static_cast< sal_Int32 >( fArrowWidth * x ), static_cast< sal_Int32 >( fArrowLength * y ) ); }; // tdf#100491 Arrow line marker, unlike other markers, depends on line width. // So calculate width of half line (more convenient during drawing) taking into account - // further conversions/scaling done in OOX_ARROW_POINT macro and scaling to nMarkerWidth. + // further conversions/scaling done in OOX_ARROW_POINT and scaling to nMarkerWidth. const double fArrowLineHalfWidth = ::std::max< double >( 100.0 * 0.5 * nLineWidth / nMarkerWidth, 1 ); ::std::vector< awt::Point > aPoints; @@ -301,7 +301,6 @@ void lclPushMarkerProperties( ShapePropertyMap& rPropMap, aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); break; } -#undef OOX_ARROW_POINT OSL_ENSURE( !aPoints.empty(), "lclPushMarkerProperties - missing arrow coordinates" ); if( !aPoints.empty() ) |