LCOV - code coverage report
Current view: top level - oox/source/drawingml - lineproperties.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 184 218 84.4 %
Date: 2014-04-11 Functions: 15 15 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "oox/drawingml/lineproperties.hxx"
      21             : #include <vector>
      22             : #include <rtl/ustrbuf.hxx>
      23             : #include <com/sun/star/beans/NamedValue.hpp>
      24             : #include <com/sun/star/container/XNameContainer.hpp>
      25             : #include <com/sun/star/drawing/FlagSequence.hpp>
      26             : #include <com/sun/star/drawing/LineDash.hpp>
      27             : #include <com/sun/star/drawing/LineJoint.hpp>
      28             : #include <com/sun/star/drawing/LineStyle.hpp>
      29             : #include <com/sun/star/drawing/PointSequence.hpp>
      30             : #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
      31             : #include "oox/drawingml/drawingmltypes.hxx"
      32             : #include "oox/drawingml/shapepropertymap.hxx"
      33             : #include "oox/helper/containerhelper.hxx"
      34             : #include "oox/helper/graphichelper.hxx"
      35             : #include "oox/token/tokens.hxx"
      36             : 
      37             : using namespace ::com::sun::star;
      38             : using namespace ::com::sun::star::beans;
      39             : using namespace ::com::sun::star::drawing;
      40             : 
      41             : using ::com::sun::star::uno::Any;
      42             : using ::com::sun::star::uno::Reference;
      43             : using ::com::sun::star::container::XNameContainer;
      44             : 
      45             : namespace oox {
      46             : namespace drawingml {
      47             : 
      48             : 
      49             : 
      50             : namespace {
      51             : 
      52          25 : void lclSetDashData( LineDash& orLineDash, sal_Int16 nDots, sal_Int32 nDotLen,
      53             :         sal_Int16 nDashes, sal_Int32 nDashLen, sal_Int32 nDistance )
      54             : {
      55          25 :     orLineDash.Dots = nDots;
      56          25 :     orLineDash.DotLen = nDotLen;
      57          25 :     orLineDash.Dashes = nDashes;
      58          25 :     orLineDash.DashLen = nDashLen;
      59          25 :     orLineDash.Distance = nDistance;
      60          25 : }
      61             : 
      62             : /** Converts the specified preset dash to API dash.
      63             : 
      64             :     Line length and dot length are set relative to line width and have to be
      65             :     multiplied by the actual line width after this function.
      66             :  */
      67          25 : void lclConvertPresetDash( LineDash& orLineDash, sal_Int32 nPresetDash )
      68             : {
      69          25 :     switch( nPresetDash )
      70             :     {
      71           0 :         case XML_dot:           lclSetDashData( orLineDash, 1, 1, 0, 0, 3 );    break;
      72          17 :         case XML_dash:          lclSetDashData( orLineDash, 0, 0, 1, 4, 3 );    break;
      73           0 :         case XML_dashDot:       lclSetDashData( orLineDash, 1, 1, 1, 4, 3 );    break;
      74             : 
      75           4 :         case XML_lgDash:        lclSetDashData( orLineDash, 0, 0, 1, 8, 3 );    break;
      76           0 :         case XML_lgDashDot:     lclSetDashData( orLineDash, 1, 1, 1, 8, 3 );    break;
      77           0 :         case XML_lgDashDotDot:  lclSetDashData( orLineDash, 2, 1, 1, 8, 3 );    break;
      78             : 
      79           2 :         case XML_sysDot:        lclSetDashData( orLineDash, 1, 1, 0, 0, 1 );    break;
      80           2 :         case XML_sysDash:       lclSetDashData( orLineDash, 0, 0, 1, 3, 1 );    break;
      81           0 :         case XML_sysDashDot:    lclSetDashData( orLineDash, 1, 1, 1, 3, 1 );    break;
      82           0 :         case XML_sysDashDotDot: lclSetDashData( orLineDash, 2, 1, 1, 3, 1 );    break;
      83             : 
      84             :         default:
      85             :             OSL_FAIL( "lclConvertPresetDash - unsupported preset dash" );
      86           0 :             lclSetDashData( orLineDash, 0, 0, 1, 4, 3 );
      87             :     }
      88          25 : }
      89             : 
      90             : /** Converts the passed custom dash to API dash.
      91             : 
      92             :     Line length and dot length are set relative to line width and have to be
      93             :     multiplied by the actual line width after this function.
      94             :  */
      95           5 : void lclConvertCustomDash( LineDash& orLineDash, const LineProperties::DashStopVector& rCustomDash )
      96             : {
      97           5 :     if( rCustomDash.empty() )
      98             :     {
      99             :         OSL_FAIL( "lclConvertCustomDash - unexpected empty custom dash" );
     100           0 :         lclSetDashData( orLineDash, 0, 0, 1, 4, 3 );
     101           5 :         return;
     102             :     }
     103             : 
     104             :     // count dashes and dots (stops equal or less than 2 are assumed to be dots)
     105           5 :     sal_Int16 nDots = 0;
     106           5 :     sal_Int32 nDotLen = 0;
     107           5 :     sal_Int16 nDashes = 0;
     108           5 :     sal_Int32 nDashLen = 0;
     109           5 :     sal_Int32 nDistance = 0;
     110          10 :     for( LineProperties::DashStopVector::const_iterator aIt = rCustomDash.begin(), aEnd = rCustomDash.end(); aIt != aEnd; ++aIt )
     111             :     {
     112           5 :         if( aIt->first <= 2 )
     113             :         {
     114           0 :             ++nDots;
     115           0 :             nDotLen += aIt->first;
     116             :         }
     117             :         else
     118             :         {
     119           5 :             ++nDashes;
     120           5 :             nDashLen += aIt->first;
     121             :         }
     122           5 :         nDistance += aIt->second;
     123             :     }
     124           5 :     orLineDash.DotLen = (nDots > 0) ? ::std::max< sal_Int32 >( nDotLen / nDots, 1 ) : 0;
     125           5 :     orLineDash.Dots = nDots;
     126           5 :     orLineDash.DashLen = (nDashes > 0) ? ::std::max< sal_Int32 >( nDashLen / nDashes, 1 ) : 0;
     127           5 :     orLineDash.Dashes = nDashes;
     128           5 :     orLineDash.Distance = ::std::max< sal_Int32 >( nDistance / rCustomDash.size(), 1 );
     129             : }
     130             : 
     131          30 : DashStyle lclGetDashStyle( sal_Int32 nToken )
     132             : {
     133             :     OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0);
     134          30 :     switch( nToken )
     135             :     {
     136          19 :         case XML_rnd:   return DashStyle_ROUNDRELATIVE;
     137           0 :         case XML_sq:    return DashStyle_RECTRELATIVE;
     138          11 :         case XML_flat:  return DashStyle_RECT;
     139             :     }
     140           0 :     return DashStyle_ROUNDRELATIVE;
     141             : }
     142             : 
     143        1163 : LineJoint lclGetLineJoint( sal_Int32 nToken )
     144             : {
     145             :     OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0);
     146        1163 :     switch( nToken )
     147             :     {
     148         461 :         case XML_round: return LineJoint_ROUND;
     149          85 :         case XML_bevel: return LineJoint_BEVEL;
     150         617 :         case XML_miter: return LineJoint_MITER;
     151             :     }
     152           0 :     return LineJoint_ROUND;
     153             : }
     154             : 
     155             : const sal_Int32 OOX_ARROWSIZE_SMALL     = 0;
     156             : const sal_Int32 OOX_ARROWSIZE_MEDIUM    = 1;
     157             : const sal_Int32 OOX_ARROWSIZE_LARGE     = 2;
     158             : 
     159         230 : sal_Int32 lclGetArrowSize( sal_Int32 nToken )
     160             : {
     161             :     OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0);
     162         230 :     switch( nToken )
     163             :     {
     164           2 :         case XML_sm:    return OOX_ARROWSIZE_SMALL;
     165         228 :         case XML_med:   return OOX_ARROWSIZE_MEDIUM;
     166           0 :         case XML_lg:    return OOX_ARROWSIZE_LARGE;
     167             :     }
     168           0 :     return OOX_ARROWSIZE_MEDIUM;
     169             : }
     170             : 
     171             : 
     172             : 
     173        6096 : void lclPushMarkerProperties( ShapePropertyMap& rPropMap,
     174             :         const LineArrowProperties& rArrowProps, sal_Int32 nLineWidth, bool bLineEnd )
     175             : {
     176             :     /*  Store the marker polygon and the marker name in a single value, to be
     177             :         able to pass both to the ShapePropertyMap::setProperty() function. */
     178        6096 :     NamedValue aNamedMarker;
     179             : 
     180       12192 :     OUStringBuffer aBuffer;
     181        6096 :     sal_Int32 nMarkerWidth = 0;
     182        6096 :     bool bMarkerCenter = false;
     183        6096 :     sal_Int32 nArrowType = rArrowProps.moArrowType.get( XML_none );
     184             :     OSL_ASSERT((nArrowType & sal_Int32(0xFFFF0000))==0);
     185        6096 :     switch( nArrowType )
     186             :     {
     187             :         case XML_triangle:
     188          88 :             aBuffer.append( "msArrowEnd" );
     189          88 :         break;
     190             :         case XML_arrow:
     191          11 :             aBuffer.append( "msArrowOpenEnd" );
     192          11 :         break;
     193             :         case XML_stealth:
     194           4 :             aBuffer.append( "msArrowStealthEnd" );
     195           4 :         break;
     196             :         case XML_diamond:
     197          12 :             aBuffer.append( "msArrowDiamondEnd" );
     198          12 :             bMarkerCenter = true;
     199          12 :         break;
     200             :         case XML_oval:
     201           0 :             aBuffer.append( "msArrowOvalEnd" );
     202           0 :             bMarkerCenter = true;
     203           0 :         break;
     204             :     }
     205             : 
     206        6096 :     if( !aBuffer.isEmpty() )
     207             :     {
     208         115 :         sal_Int32 nLength = lclGetArrowSize( rArrowProps.moArrowLength.get( XML_med ) );
     209         115 :         sal_Int32 nWidth  = lclGetArrowSize( rArrowProps.moArrowWidth.get( XML_med ) );
     210             : 
     211         115 :         sal_Int32 nNameIndex = nWidth * 3 + nLength + 1;
     212         115 :         aBuffer.append( ' ' ).append( nNameIndex );
     213         115 :         OUString aMarkerName = aBuffer.makeStringAndClear();
     214             : 
     215         115 :         bool bIsArrow = nArrowType == XML_arrow;
     216         115 :         double fArrowLength = 1.0;
     217         115 :         switch( nLength )
     218             :         {
     219           1 :             case OOX_ARROWSIZE_SMALL:   fArrowLength = (bIsArrow ? 3.5 : 2.0); break;
     220         114 :             case OOX_ARROWSIZE_MEDIUM:  fArrowLength = (bIsArrow ? 4.5 : 3.0); break;
     221           0 :             case OOX_ARROWSIZE_LARGE:   fArrowLength = (bIsArrow ? 6.0 : 5.0); break;
     222             :         }
     223         115 :         double fArrowWidth = 1.0;
     224         115 :         switch( nWidth )
     225             :         {
     226           1 :             case OOX_ARROWSIZE_SMALL:   fArrowWidth = (bIsArrow ? 3.5 : 2.0);  break;
     227         114 :             case OOX_ARROWSIZE_MEDIUM:  fArrowWidth = (bIsArrow ? 4.5 : 3.0);  break;
     228           0 :             case OOX_ARROWSIZE_LARGE:   fArrowWidth = (bIsArrow ? 6.0 : 5.0);  break;
     229             :         }
     230             :         // set arrow width relative to line width
     231         115 :         sal_Int32 nBaseLineWidth = ::std::max< sal_Int32 >( nLineWidth, 70 );
     232         115 :         nMarkerWidth = static_cast< sal_Int32 >( fArrowWidth * nBaseLineWidth );
     233             : 
     234             :         /*  Test if the marker already exists in the marker table, do not
     235             :             create it again in this case. If markers are inserted explicitly
     236             :             instead by their name, the polygon will be created always.
     237             :             TODO: this can be optimized by using a map. */
     238         115 :         if( !rPropMap.hasNamedLineMarkerInTable( aMarkerName ) )
     239             :         {
     240             : // pass X and Y as percentage to OOX_ARROW_POINT
     241             : #define OOX_ARROW_POINT( x, y ) awt::Point( static_cast< sal_Int32 >( fArrowWidth * x ), static_cast< sal_Int32 >( fArrowLength * y ) )
     242             : 
     243          26 :             ::std::vector< awt::Point > aPoints;
     244             :             OSL_ASSERT((rArrowProps.moArrowType.get() & sal_Int32(0xFFFF0000))==0);
     245          26 :             switch( rArrowProps.moArrowType.get() )
     246             :             {
     247             :                 case XML_triangle:
     248          12 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     249          12 :                     aPoints.push_back( OOX_ARROW_POINT( 100, 100 ) );
     250          12 :                     aPoints.push_back( OOX_ARROW_POINT(   0, 100 ) );
     251          12 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     252          12 :                 break;
     253             :                 case XML_arrow:
     254           6 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     255           6 :                     aPoints.push_back( OOX_ARROW_POINT( 100,  91 ) );
     256           6 :                     aPoints.push_back( OOX_ARROW_POINT(  85, 100 ) );
     257           6 :                     aPoints.push_back( OOX_ARROW_POINT(  50,  36 ) );
     258           6 :                     aPoints.push_back( OOX_ARROW_POINT(  15, 100 ) );
     259           6 :                     aPoints.push_back( OOX_ARROW_POINT(   0,  91 ) );
     260           6 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     261           6 :                 break;
     262             :                 case XML_stealth:
     263           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     264           4 :                     aPoints.push_back( OOX_ARROW_POINT( 100, 100 ) );
     265           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50,  60 ) );
     266           4 :                     aPoints.push_back( OOX_ARROW_POINT(   0, 100 ) );
     267           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     268           4 :                 break;
     269             :                 case XML_diamond:
     270           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     271           4 :                     aPoints.push_back( OOX_ARROW_POINT( 100,  50 ) );
     272           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50, 100 ) );
     273           4 :                     aPoints.push_back( OOX_ARROW_POINT(   0,  50 ) );
     274           4 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     275           4 :                 break;
     276             :                 case XML_oval:
     277           0 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     278           0 :                     aPoints.push_back( OOX_ARROW_POINT(  75,   7 ) );
     279           0 :                     aPoints.push_back( OOX_ARROW_POINT(  93,  25 ) );
     280           0 :                     aPoints.push_back( OOX_ARROW_POINT( 100,  50 ) );
     281           0 :                     aPoints.push_back( OOX_ARROW_POINT(  93,  75 ) );
     282           0 :                     aPoints.push_back( OOX_ARROW_POINT(  75,  93 ) );
     283           0 :                     aPoints.push_back( OOX_ARROW_POINT(  50, 100 ) );
     284           0 :                     aPoints.push_back( OOX_ARROW_POINT(  25,  93 ) );
     285           0 :                     aPoints.push_back( OOX_ARROW_POINT(   7,  75 ) );
     286           0 :                     aPoints.push_back( OOX_ARROW_POINT(   0,  50 ) );
     287           0 :                     aPoints.push_back( OOX_ARROW_POINT(   7,  25 ) );
     288           0 :                     aPoints.push_back( OOX_ARROW_POINT(  25,   7 ) );
     289           0 :                     aPoints.push_back( OOX_ARROW_POINT(  50,   0 ) );
     290           0 :                 break;
     291             :             }
     292             : #undef OOX_ARROW_POINT
     293             : 
     294             :             OSL_ENSURE( !aPoints.empty(), "lclPushMarkerProperties - missing arrow coordinates" );
     295          26 :             if( !aPoints.empty() )
     296             :             {
     297          26 :                 PolyPolygonBezierCoords aMarkerCoords;
     298          26 :                 aMarkerCoords.Coordinates.realloc( 1 );
     299          26 :                 aMarkerCoords.Coordinates[ 0 ] = ContainerHelper::vectorToSequence( aPoints );
     300             : 
     301          52 :                 ::std::vector< PolygonFlags > aFlags( aPoints.size(), PolygonFlags_NORMAL );
     302          26 :                 aMarkerCoords.Flags.realloc( 1 );
     303          26 :                 aMarkerCoords.Flags[ 0 ] = ContainerHelper::vectorToSequence( aFlags );
     304             : 
     305          26 :                 aNamedMarker.Name = aMarkerName;
     306          52 :                 aNamedMarker.Value <<= aMarkerCoords;
     307          26 :             }
     308             :         }
     309             :         else
     310             :         {
     311             :             /*  Named marker object exists already in the marker table, pass
     312             :                 its name only. This will set the name as property value, but
     313             :                 does not create a new object in the marker table. */
     314          89 :             aNamedMarker.Name = aMarkerName;
     315         115 :         }
     316             :     }
     317             : 
     318             :     // push the properties (filled aNamedMarker.Name indicates valid marker)
     319        6096 :     if( !aNamedMarker.Name.isEmpty() )
     320             :     {
     321         115 :         if( bLineEnd )
     322             :         {
     323          81 :             rPropMap.setProperty( SHAPEPROP_LineEnd, aNamedMarker );
     324          81 :             rPropMap.setProperty( SHAPEPROP_LineEndWidth, nMarkerWidth );
     325          81 :             rPropMap.setProperty( SHAPEPROP_LineEndCenter, bMarkerCenter );
     326             :         }
     327             :         else
     328             :         {
     329          34 :             rPropMap.setProperty( SHAPEPROP_LineStart, aNamedMarker );
     330          34 :             rPropMap.setProperty( SHAPEPROP_LineStartWidth, nMarkerWidth );
     331          34 :             rPropMap.setProperty( SHAPEPROP_LineStartCenter, bMarkerCenter );
     332             :         }
     333        6096 :     }
     334        6096 : }
     335             : 
     336             : } // namespace
     337             : 
     338             : 
     339             : 
     340        6492 : void LineArrowProperties::assignUsed( const LineArrowProperties& rSourceProps )
     341             : {
     342        6492 :     moArrowType.assignIfUsed( rSourceProps.moArrowType );
     343        6492 :     moArrowWidth.assignIfUsed( rSourceProps.moArrowWidth );
     344        6492 :     moArrowLength.assignIfUsed( rSourceProps.moArrowLength );
     345        6492 : }
     346             : 
     347             : 
     348             : 
     349        3246 : void LineProperties::assignUsed( const LineProperties& rSourceProps )
     350             : {
     351        3246 :     maStartArrow.assignUsed( rSourceProps.maStartArrow );
     352        3246 :     maEndArrow.assignUsed( rSourceProps.maEndArrow );
     353        3246 :     maLineFill.assignUsed( rSourceProps.maLineFill );
     354        3246 :     if( !rSourceProps.maCustomDash.empty() )
     355           5 :         maCustomDash = rSourceProps.maCustomDash;
     356        3246 :     moLineWidth.assignIfUsed( rSourceProps.moLineWidth );
     357        3246 :     moPresetDash.assignIfUsed( rSourceProps.moPresetDash );
     358        3246 :     moLineCompound.assignIfUsed( rSourceProps.moLineCompound );
     359        3246 :     moLineCap.assignIfUsed( rSourceProps.moLineCap );
     360        3246 :     moLineJoint.assignIfUsed( rSourceProps.moLineJoint );
     361        3246 : }
     362             : 
     363        3115 : void LineProperties::pushToPropMap( ShapePropertyMap& rPropMap,
     364             :         const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr ) const
     365             : {
     366             :     // line fill type must exist, otherwise ignore other properties
     367        3115 :     if( maLineFill.moFillType.has() )
     368             :     {
     369             :         // line style (our core only supports none and solid)
     370        3048 :         drawing::LineStyle eLineStyle = (maLineFill.moFillType.get() == XML_noFill) ? drawing::LineStyle_NONE : drawing::LineStyle_SOLID;
     371             : 
     372             :         // convert line width from EMUs to 1/100mm
     373        3048 :         sal_Int32 nLineWidth = getLineWidth();
     374             : 
     375             :         // create line dash from preset dash token (not for invisible line)
     376        3048 :         if( (eLineStyle != drawing::LineStyle_NONE) && (moPresetDash.differsFrom( XML_solid ) || !maCustomDash.empty()) )
     377             :         {
     378          30 :             LineDash aLineDash;
     379          30 :             aLineDash.Style = lclGetDashStyle( moLineCap.get( XML_rnd ) );
     380             : 
     381             :             // convert preset dash or custom dash
     382          30 :             if( moPresetDash.differsFrom( XML_solid ) )
     383          25 :                 lclConvertPresetDash( aLineDash, moPresetDash.get() );
     384             :             else
     385           5 :                 lclConvertCustomDash( aLineDash, maCustomDash );
     386             : 
     387             :             // convert relative dash/dot length to absolute length
     388          30 :             sal_Int32 nBaseLineWidth = ::std::max< sal_Int32 >( nLineWidth, 35 );
     389          30 :             aLineDash.DotLen *= nBaseLineWidth;
     390          30 :             aLineDash.DashLen *= nBaseLineWidth;
     391          30 :             aLineDash.Distance *= nBaseLineWidth;
     392             : 
     393          30 :             if( rPropMap.setProperty( SHAPEPROP_LineDash, aLineDash ) )
     394          30 :                 eLineStyle = drawing::LineStyle_DASH;
     395             :         }
     396             : 
     397             :         // set final line style property
     398        3048 :         rPropMap.setProperty( SHAPEPROP_LineStyle, eLineStyle );
     399             : 
     400             :         // line joint type
     401        3048 :         if( moLineJoint.has() )
     402        1071 :             rPropMap.setProperty( SHAPEPROP_LineJoint, lclGetLineJoint( moLineJoint.get() ) );
     403             : 
     404             :         // line width in 1/100mm
     405        3048 :         rPropMap.setProperty( SHAPEPROP_LineWidth, nLineWidth );
     406             : 
     407             :         // line color and transparence
     408        3048 :         Color aLineColor = maLineFill.getBestSolidColor();
     409        3048 :         if( aLineColor.isUsed() )
     410             :         {
     411        1710 :             rPropMap.setProperty( SHAPEPROP_LineColor, aLineColor.getColor( rGraphicHelper, nPhClr ) );
     412        1710 :             if( aLineColor.hasTransparency() )
     413          34 :                 rPropMap.setProperty( SHAPEPROP_LineTransparency, aLineColor.getTransparency() );
     414             :         }
     415             : 
     416             :         // line markers
     417        3048 :         lclPushMarkerProperties( rPropMap, maStartArrow, nLineWidth, false );
     418        3048 :         lclPushMarkerProperties( rPropMap, maEndArrow,   nLineWidth, true );
     419             :     }
     420        3115 : }
     421             : 
     422         659 : drawing::LineStyle LineProperties::getLineStyle() const
     423             : {
     424             :     // rules to calculate the line style inferred from the code in LineProperties::pushToPropMap
     425         659 :     return (maLineFill.moFillType.get() == XML_noFill) ?
     426             :             drawing::LineStyle_NONE :
     427         730 :             (moPresetDash.differsFrom( XML_solid ) || (!moPresetDash && !maCustomDash.empty())) ?
     428             :                     drawing::LineStyle_DASH :
     429        1024 :                     drawing::LineStyle_SOLID;
     430             : }
     431             : 
     432         659 : drawing::LineJoint LineProperties::getLineJoint() const
     433             : {
     434         659 :     if( moLineJoint.has() )
     435          92 :         return lclGetLineJoint( moLineJoint.get() );
     436             : 
     437         567 :     return drawing::LineJoint_NONE;
     438             : }
     439             : 
     440        3707 : sal_Int32 LineProperties::getLineWidth() const
     441             : {
     442        3707 :     return convertEmuToHmm( moLineWidth.get( 0 ) );
     443             : }
     444             : 
     445             : 
     446             : 
     447             : } // namespace drawingml
     448         177 : } // namespace oox
     449             : 
     450             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10