19#include <ooo/vba/office/MsoArrowheadStyle.hpp>
20#include <ooo/vba/office/MsoLineDashStyle.hpp>
21#include <com/sun/star/drawing/LineStyle.hpp>
22#include <com/sun/star/drawing/LineDash.hpp>
39 sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
40 if ( sLineName ==
u"Small Arrow" || sLineName ==
u"Arrow" || sLineName ==
u"msArrowEnd" || sLineName ==
u"Double Arrow")
43 nLineType = office::MsoArrowheadStyle::msoArrowheadTriangle;
45 else if ( sLineName ==
u"Square 45" || sLineName ==
u"Square" || sLineName ==
u"msArrowDiamondEnd")
48 nLineType = office::MsoArrowheadStyle::msoArrowheadDiamond;
50 else if (sLineName ==
u"Circle" || sLineName ==
u"msArrowOvalEnd" || sLineName ==
u"Dimension Lines" )
53 nLineType = office::MsoArrowheadStyle::msoArrowheadOval;
55 else if ( sLineName ==
u"Arrow concave" || sLineName ==
u"msArrowStealthEnd" )
58 nLineType = office::MsoArrowheadStyle::msoArrowheadStealth;
60 else if ( sLineName ==
u"Rounded short Arrow" || sLineName ==
u"Rounded large Arrow" || sLineName ==
u"Symmetric Arrow"
61 || sLineName ==
u"msArrowOpenEnd" || sLineName ==
u"Line Arrow" )
64 nLineType = office::MsoArrowheadStyle::msoArrowheadOpen;
69 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
77 switch( nArrowheadStyle )
79 case office::MsoArrowheadStyle::msoArrowheadNone:
81 case office::MsoArrowheadStyle::msoArrowheadStealth:
82 return "Arrow concave";
83 case office::MsoArrowheadStyle::msoArrowheadOpen:
85 case office::MsoArrowheadStyle::msoArrowheadOval:
87 case office::MsoArrowheadStyle::msoArrowheadDiamond:
89 case office::MsoArrowheadStyle::msoArrowheadTriangle:
92 throw uno::RuntimeException(
"Invalid Arrow Style!" );
100 sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone;
102 m_xPropertySet->getPropertyValue(
"LineStartName" ) >>= sLineName;
103 if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf(
"msArray" ) ) != -1 )
105 sal_Int32
nIndex = sLineName.indexOf(
' ' );
129 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
137 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
145 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
153 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
174 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
181 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
188 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
195 throw uno::RuntimeException(
"Property 'EndArrowheadWidth' is not supported." );
203 double dLineWidth = Millimeter::getInPoints(
nLineWidth );
211 throw uno::RuntimeException(
"Parameter: Must be positive." );
226 drawing::LineStyle aLineStyle;
228 if( aLineStyle == drawing::LineStyle_NONE )
238 drawing::LineStyle aLineStyle;
242 aLineStyle = drawing::LineStyle_NONE;
247 if( aLineStyle == drawing::LineStyle_NONE )
257 sal_Int16 nTransparency = 0;
258 m_xPropertySet->getPropertyValue(
"LineTransparence" ) >>= nTransparency;
259 double fTransparency =
static_cast<double>( nTransparency );
260 return fTransparency / 100;
266 sal_Int16 nTransparency =
static_cast<sal_Int16
>( _transparency * 100 );
292 drawing::LineStyle eLineStyle;
295 if( eLineStyle == drawing::LineStyle_SOLID )
299 drawing::LineDash aLineDash;
301 if( aLineDash.Dots == 0 )
306 if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) )
311 else if( aLineDash.Dots == 1 )
318 if( aLineDash.Dashes == 0 )
324 if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) )
330 else if( aLineDash.Dots == 2 )
344 if( _dashstyle == office::MsoLineDashStyle::msoLineSolid )
351 drawing::LineDash aLineDash;
356 case office::MsoLineDashStyle::msoLineDashDot:
358 aLineDash.DotLen =
nPixel;
359 aLineDash.Dashes = 1;
360 aLineDash.DashLen = 5 *
nPixel;
361 aLineDash.Distance = 4 *
nPixel;
363 case office::MsoLineDashStyle::msoLineLongDashDot:
365 aLineDash.DotLen =
nPixel;
366 aLineDash.Dashes = 1;
367 aLineDash.DashLen = 10 *
nPixel;
368 aLineDash.Distance = 4 *
nPixel;
370 case office::MsoLineDashStyle::msoLineDash:
372 aLineDash.DotLen = 0;
373 aLineDash.Dashes = 1;
374 aLineDash.DashLen = 6 *
nPixel;
375 aLineDash.Distance = 4 *
nPixel;
377 case office::MsoLineDashStyle::msoLineDashDotDot:
379 aLineDash.DotLen =
nPixel;
380 aLineDash.Dashes = 1;
381 aLineDash.DashLen = 10 *
nPixel;
382 aLineDash.Distance = 3 *
nPixel;
384 case office::MsoLineDashStyle::msoLineLongDash:
386 aLineDash.DotLen = 0;
387 aLineDash.Dashes = 1;
388 aLineDash.DashLen = 10 *
nPixel;
389 aLineDash.Distance = 4 *
nPixel;
391 case office::MsoLineDashStyle::msoLineSquareDot:
393 aLineDash.DotLen =
nPixel;
394 aLineDash.Dashes = 0;
395 aLineDash.DashLen = 0;
396 aLineDash.Distance =
nPixel;
398 case office::MsoLineDashStyle::msoLineRoundDot:
400 aLineDash.DotLen =
nPixel;
401 aLineDash.Dashes = 0;
402 aLineDash.DashLen = 0;
403 aLineDash.Distance =
nPixel;
406 throw uno::RuntimeException(
"this MsoLineDashStyle is not supported." );
413uno::Reference< msforms::XColorFormat > SAL_CALL
419uno::Reference< msforms::XColorFormat > SAL_CALL
428 return "ScVbaLineFormat";
431uno::Sequence< OUString >
436 "ooo.vba.msform.LineFormat"
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent() override
double getInHundredthsOfOneMillimeter() const
void setInPoints(double points)
Sequence< OUString > aServiceNames