1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "ximpcustomshape.hxx"
21 #include <o3tl/any.hxx>
22 #include <rtl/math.hxx>
23 #include <rtl/ustrbuf.hxx>
24 #include <rtl/ustring.hxx>
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/awt/Rectangle.hpp>
27 #include <com/sun/star/xml/sax/XAttributeList.hpp>
28 #include <xmloff/xmltoken.hxx>
29 #include <EnhancedCustomShapeToken.hxx>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/namespacemap.hxx>
32 #include <xmloff/xmluconv.hxx>
33 #include <xmloff/xmlement.hxx>
34 #include <xexptran.hxx>
35 #include <com/sun/star/drawing/Direction3D.hpp>
36 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
37 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
38 #include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
39 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
40 #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
41 #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
42 #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
43 #include <com/sun/star/drawing/EnhancedCustomShapeMetalType.hpp>
44 #include <com/sun/star/drawing/ProjectionMode.hpp>
45 #include <com/sun/star/drawing/Position3D.hpp>
46 #include <sax/tools/converter.hxx>
47 #include <comphelper/sequence.hxx>
48 #include <o3tl/string_view.hxx>
50 #include <string_view>
51 #include <unordered_map>
53 using namespace ::com::sun::star
;
54 using namespace ::xmloff::token
;
55 using namespace ::xmloff::EnhancedCustomShapeToken
;
58 XMLEnhancedCustomShapeContext::XMLEnhancedCustomShapeContext( SvXMLImport
& rImport
,
59 css::uno::Reference
< css::drawing::XShape
>& rxShape
,
60 std::vector
< css::beans::PropertyValue
>& rCustomShapeGeometry
) :
61 SvXMLImportContext( rImport
),
62 mrUnitConverter( rImport
.GetMM100UnitConverter() ),
64 mrCustomShapeGeometry( rCustomShapeGeometry
)
68 const SvXMLEnumMapEntry
<sal_uInt16
> aXML_GluePointEnumMap
[] =
74 { XML_TOKEN_INVALID
, 0 }
76 static void GetBool( std::vector
< css::beans::PropertyValue
>& rDest
,
77 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
80 if (::sax::Converter::convertBool( bAttrBool
, rValue
))
82 beans::PropertyValue aProp
;
83 aProp
.Name
= EASGet( eDestProp
);
84 aProp
.Value
<<= bAttrBool
;
85 rDest
.push_back( aProp
);
89 static void GetInt32( std::vector
< css::beans::PropertyValue
>& rDest
,
90 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
92 sal_Int32 nAttrNumber
;
93 if (::sax::Converter::convertNumber( nAttrNumber
, rValue
))
95 beans::PropertyValue aProp
;
96 aProp
.Name
= EASGet( eDestProp
);
97 aProp
.Value
<<= nAttrNumber
;
98 rDest
.push_back( aProp
);
102 static void GetDouble( std::vector
< css::beans::PropertyValue
>& rDest
,
103 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
106 if (::sax::Converter::convertDouble( fAttrDouble
, rValue
))
108 beans::PropertyValue aProp
;
109 aProp
.Name
= EASGet( eDestProp
);
110 aProp
.Value
<<= fAttrDouble
;
111 rDest
.push_back( aProp
);
115 static void GetString( std::vector
< css::beans::PropertyValue
>& rDest
,
116 const OUString
& rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
118 beans::PropertyValue aProp
;
119 aProp
.Name
= EASGet( eDestProp
);
120 aProp
.Value
<<= rValue
;
121 rDest
.push_back( aProp
);
124 template<typename EnumT
>
125 static void GetEnum( std::vector
< css::beans::PropertyValue
>& rDest
,
126 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
,
127 const SvXMLEnumMapEntry
<EnumT
>& rMap
)
130 if( SvXMLUnitConverter::convertEnum( eKind
, rValue
, &rMap
) )
132 beans::PropertyValue aProp
;
133 aProp
.Name
= EASGet( eDestProp
);
134 aProp
.Value
<<= static_cast<sal_Int16
>(eKind
);
135 rDest
.push_back( aProp
);
139 static void GetDoublePercentage( std::vector
< css::beans::PropertyValue
>& rDest
,
140 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
142 sal_Int16
const eSrcUnit
= ::sax::Converter::GetUnitFromString(
143 rValue
, util::MeasureUnit::MM_100TH
);
144 if (util::MeasureUnit::PERCENT
!= eSrcUnit
)
147 rtl_math_ConversionStatus eStatus
;
148 double fAttrDouble
= rtl_math_stringToDouble(rValue
.data(),
149 rValue
.data() + rValue
.size(),
150 '.', ',', &eStatus
, nullptr);
151 if ( eStatus
== rtl_math_ConversionStatus_Ok
)
153 beans::PropertyValue aProp
;
154 aProp
.Name
= EASGet( eDestProp
);
155 aProp
.Value
<<= fAttrDouble
;
156 rDest
.push_back( aProp
);
160 static void GetB3DVector( std::vector
< css::beans::PropertyValue
>& rDest
,
161 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
163 ::basegfx::B3DVector aB3DVector
;
164 if ( SvXMLUnitConverter::convertB3DVector( aB3DVector
, rValue
) )
166 drawing::Direction3D
aDirection3D( aB3DVector
.getX(), aB3DVector
.getY(), aB3DVector
.getZ() );
167 beans::PropertyValue aProp
;
168 aProp
.Name
= EASGet( eDestProp
);
169 aProp
.Value
<<= aDirection3D
;
170 rDest
.push_back( aProp
);
174 static bool GetEquationName( std::u16string_view rEquation
, const sal_Int32 nStart
, OUString
& rEquationName
)
176 sal_Int32 nIndex
= nStart
;
177 while( nIndex
< static_cast<sal_Int32
>(rEquation
.size()) )
179 sal_Unicode nChar
= rEquation
[ nIndex
];
181 ( ( nChar
>= 'a' ) && ( nChar
<= 'z' ) )
182 || ( ( nChar
>= 'A' ) && ( nChar
<= 'Z' ) )
183 || ( ( nChar
>= '0' ) && ( nChar
<= '9' ) )
191 bool bValid
= ( nIndex
- nStart
) != 0;
193 rEquationName
= rEquation
.substr( nStart
, nIndex
- nStart
);
197 static bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter
& rParameter
, sal_Int32
& nIndex
, std::u16string_view rParaString
)
199 if ( nIndex
>= static_cast<sal_Int32
>(rParaString
.size()) )
203 bool bNumberRequired
= true;
204 bool bMustBePositiveWholeNumbered
= false;
206 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::NORMAL
;
207 if ( rParaString
[ nIndex
] == '$' )
209 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT
;
210 bMustBePositiveWholeNumbered
= true;
213 else if ( rParaString
[ nIndex
] == '?' )
216 bNumberRequired
= false;
217 OUString aEquationName
;
218 bValid
= GetEquationName( rParaString
, nIndex
, aEquationName
);
221 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::EQUATION
;
222 rParameter
.Value
<<= aEquationName
;
223 nIndex
+= aEquationName
.getLength();
226 else if ( rParaString
[ nIndex
] > '9' )
228 bNumberRequired
= false;
229 if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"left", nIndex
) )
231 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::LEFT
;
234 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"top", nIndex
) )
236 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::TOP
;
239 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"right", nIndex
) )
241 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::RIGHT
;
244 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"bottom", nIndex
) )
246 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::BOTTOM
;
249 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"xstretch", nIndex
) )
251 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::XSTRETCH
;
254 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"ystretch", nIndex
) )
256 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::YSTRETCH
;
259 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"hasstroke", nIndex
) )
261 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::HASSTROKE
;
264 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"hasfill", nIndex
) )
266 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::HASFILL
;
269 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"width", nIndex
) )
271 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::WIDTH
;
274 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"height", nIndex
) )
276 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::HEIGHT
;
279 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"logwidth", nIndex
) )
281 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::LOGWIDTH
;
284 else if ( o3tl::matchIgnoreAsciiCase( rParaString
, u
"logheight", nIndex
) )
286 rParameter
.Type
= css::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT
;
294 if ( bNumberRequired
)
296 sal_Int32 nStartIndex
= nIndex
;
297 sal_Int32 nEIndex
= 0; // index of "E" in double
299 bool bE
= false; // set if a double is including a "E" statement
300 bool bENum
= false; // there is at least one number after "E"
301 bool bDot
= false; // set if there is a dot included
302 bool bEnd
= false; // set for each value that can not be part of a double/integer
304 while( ( nIndex
< static_cast<sal_Int32
>(rParaString
.size()) ) && bValid
)
306 switch( rParaString
[ nIndex
] )
310 if ( bMustBePositiveWholeNumbered
)
323 if ( bMustBePositiveWholeNumbered
)
327 if ( nStartIndex
== nIndex
)
331 if ( nEIndex
+ 1 == nIndex
)
345 if ( bMustBePositiveWholeNumbered
)
382 if ( nIndex
== nStartIndex
)
386 std::u16string_view
aNumber( rParaString
.substr( nStartIndex
, nIndex
- nStartIndex
) );
390 if (::sax::Converter::convertDouble(fAttrDouble
, aNumber
))
391 rParameter
.Value
<<= fAttrDouble
;
398 if (::sax::Converter::convertNumber(nValue
, aNumber
))
399 rParameter
.Value
<<= nValue
;
408 // skipping white spaces and commas (#i121507#)
409 const sal_Unicode
aSpace(' ');
410 const sal_Unicode
aCommata(',');
412 while(nIndex
< static_cast<sal_Int32
>(rParaString
.size()))
414 const sal_Unicode
aCandidate(rParaString
[nIndex
]);
416 if(aSpace
== aCandidate
|| aCommata
== aCandidate
)
429 static void GetPosition3D( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:extrusion-viewpoint
430 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
,
431 const SvXMLUnitConverter
& rUnitConverter
)
433 drawing::Position3D aPosition3D
;
434 if ( rUnitConverter
.convertPosition3D( aPosition3D
, rValue
) )
436 beans::PropertyValue aProp
;
437 aProp
.Name
= EASGet( eDestProp
);
438 aProp
.Value
<<= aPosition3D
;
439 rDest
.push_back( aProp
);
443 static void GetDoubleSequence( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:glue-point-leaving-directions
444 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
446 std::vector
< double > vDirection
;
447 sal_Int32 nIndex
= 0;
451 std::string_view
aToken( o3tl::getToken(rValue
, 0, ',', nIndex
) );
452 if (!::sax::Converter::convertDouble( fAttrDouble
, aToken
))
455 vDirection
.push_back( fAttrDouble
);
457 while ( nIndex
>= 0 );
459 if ( !vDirection
.empty() )
461 beans::PropertyValue aProp
;
462 aProp
.Name
= EASGet( eDestProp
);
463 aProp
.Value
<<= comphelper::containerToSequence(vDirection
);
464 rDest
.push_back( aProp
);
468 static void GetSizeSequence( std::vector
< css::beans::PropertyValue
>& rDest
,
469 std::string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
471 std::vector
< sal_Int32
> vNum
;
472 sal_Int32 nIndex
= 0;
476 std::string_view
aToken( o3tl::getToken(rValue
, 0, ' ', nIndex
) );
477 if (!::sax::Converter::convertNumber( n
, aToken
))
482 while ( nIndex
>= 0 );
487 uno::Sequence
< awt::Size
> aSizeSeq((vNum
.size() + 1) / 2);
488 std::vector
< sal_Int32
>::const_iterator aIter
= vNum
.begin();
489 std::vector
< sal_Int32
>::const_iterator aEnd
= vNum
.end();
490 awt::Size
* pValues
= aSizeSeq
.getArray();
492 while ( aIter
!= aEnd
) {
493 pValues
->Width
= *aIter
++;
495 pValues
->Height
= *aIter
++;
499 beans::PropertyValue aProp
;
500 aProp
.Name
= EASGet( eDestProp
);
501 aProp
.Value
<<= aSizeSeq
;
502 rDest
.push_back( aProp
);
505 static void GetEnhancedParameter( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:handle-position
506 std::u16string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
508 sal_Int32 nIndex
= 0;
509 css::drawing::EnhancedCustomShapeParameter aParameter
;
510 if ( GetNextParameter( aParameter
, nIndex
, rValue
) )
512 beans::PropertyValue aProp
;
513 aProp
.Name
= EASGet( eDestProp
);
514 aProp
.Value
<<= aParameter
;
515 rDest
.push_back( aProp
);
519 static void GetEnhancedParameterPair( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:handle-position
520 std::u16string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
522 sal_Int32 nIndex
= 0;
523 css::drawing::EnhancedCustomShapeParameterPair aParameterPair
;
524 if ( GetNextParameter( aParameterPair
.First
, nIndex
, rValue
)
525 && GetNextParameter( aParameterPair
.Second
, nIndex
, rValue
) )
527 beans::PropertyValue aProp
;
528 aProp
.Name
= EASGet( eDestProp
);
529 aProp
.Value
<<= aParameterPair
;
530 rDest
.push_back( aProp
);
534 static sal_Int32
GetEnhancedParameterPairSequence( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:glue-points
535 std::u16string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
537 std::vector
< css::drawing::EnhancedCustomShapeParameterPair
> vParameter
;
538 css::drawing::EnhancedCustomShapeParameterPair aParameter
;
540 sal_Int32 nIndex
= 0;
541 while ( GetNextParameter( aParameter
.First
, nIndex
, rValue
)
542 && GetNextParameter( aParameter
.Second
, nIndex
, rValue
) )
544 vParameter
.push_back( aParameter
);
546 if ( !vParameter
.empty() )
548 beans::PropertyValue aProp
;
549 aProp
.Name
= EASGet( eDestProp
);
550 aProp
.Value
<<= comphelper::containerToSequence(vParameter
);
551 rDest
.push_back( aProp
);
553 return vParameter
.size();
556 static void GetEnhancedRectangleSequence( std::vector
< css::beans::PropertyValue
>& rDest
, // e.g. draw:text-areas
557 std::u16string_view rValue
, const EnhancedCustomShapeTokenEnum eDestProp
)
559 std::vector
< css::drawing::EnhancedCustomShapeTextFrame
> vTextFrame
;
560 css::drawing::EnhancedCustomShapeTextFrame aParameter
;
562 sal_Int32 nIndex
= 0;
564 while ( GetNextParameter( aParameter
.TopLeft
.First
, nIndex
, rValue
)
565 && GetNextParameter( aParameter
.TopLeft
.Second
, nIndex
, rValue
)
566 && GetNextParameter( aParameter
.BottomRight
.First
, nIndex
, rValue
)
567 && GetNextParameter( aParameter
.BottomRight
.Second
, nIndex
, rValue
) )
569 vTextFrame
.push_back( aParameter
);
571 if ( !vTextFrame
.empty() )
573 beans::PropertyValue aProp
;
574 aProp
.Name
= EASGet( eDestProp
);
575 aProp
.Value
<<= comphelper::containerToSequence(vTextFrame
);
576 rDest
.push_back( aProp
);
581 GetEnhancedPath(std::vector
<css::beans::PropertyValue
>& rDest
, // e.g. draw:enhanced-path
582 std::u16string_view rValue
, std::u16string_view rType
)
584 std::vector
< css::drawing::EnhancedCustomShapeParameterPair
> vCoordinates
;
585 std::vector
< css::drawing::EnhancedCustomShapeSegment
> vSegments
;
587 sal_Int32 nIndex
= 0;
588 sal_Int32 nParameterCount
= 0;
590 sal_Int32 nParametersNeeded
= 1;
591 sal_Int16 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO
;
595 while( bValid
&& ( nIndex
< static_cast<sal_Int32
>(rValue
.size()) ) )
597 switch( rValue
[ nIndex
] )
601 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO
;
602 nParametersNeeded
= 1;
608 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::LINETO
;
609 nParametersNeeded
= 1;
615 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::CURVETO
;
616 nParametersNeeded
= 3;
622 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH
;
623 nParametersNeeded
= 0;
629 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH
;
630 nParametersNeeded
= 0;
636 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::NOFILL
;
637 nParametersNeeded
= 0;
643 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::NOSTROKE
;
644 nParametersNeeded
= 0;
650 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO
;
651 nParametersNeeded
= 3;
657 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE
;
658 nParametersNeeded
= 3;
664 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ARCTO
;
665 nParametersNeeded
= 4;
671 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ARC
;
672 nParametersNeeded
= 4;
678 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ARCANGLETO
;
679 nParametersNeeded
= 2;
685 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::DARKEN
;
686 nParametersNeeded
= 0;
692 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::DARKENLESS
;
693 nParametersNeeded
= 0;
699 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::LIGHTEN
;
700 nParametersNeeded
= 0;
706 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::LIGHTENLESS
;
707 nParametersNeeded
= 0;
713 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO
;
714 nParametersNeeded
= 4;
720 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC
;
721 nParametersNeeded
= 4;
727 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX
;
728 nParametersNeeded
= 1;
734 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY
;
735 nParametersNeeded
= 1;
741 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO
;
742 nParametersNeeded
= 2;
767 css::drawing::EnhancedCustomShapeParameterPair aPair
;
768 if ( GetNextParameter( aPair
.First
, nIndex
, rValue
) &&
769 GetNextParameter( aPair
.Second
, nIndex
, rValue
) )
771 vCoordinates
.push_back( aPair
);
782 if ( !nParameterCount
&& !nParametersNeeded
)
784 css::drawing::EnhancedCustomShapeSegment aSegment
;
785 aSegment
.Command
= nLatestSegmentCommand
;
787 vSegments
.push_back( aSegment
);
788 nParametersNeeded
= 0x7fffffff;
790 else if ( nParameterCount
>= nParametersNeeded
)
792 // Special rule for moveto in ODF 1.2 section 19.145
793 // "If a moveto is followed by multiple pairs of coordinates, they are treated as lineto."
794 if ( nLatestSegmentCommand
== css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO
)
796 css::drawing::EnhancedCustomShapeSegment aSegment
;
797 aSegment
.Command
= css::drawing::EnhancedCustomShapeSegmentCommand::MOVETO
;
799 vSegments
.push_back( aSegment
);
801 nLatestSegmentCommand
= css::drawing::EnhancedCustomShapeSegmentCommand::LINETO
;
802 nParametersNeeded
= 1;
806 // General rule in ODF 1.2. section 19.145
807 // "If a command is repeated multiple times, all repeated command characters
808 // except the first one may be omitted." Thus check if the last command is identical,
809 // if so, we just need to increment the count
810 if ( !vSegments
.empty() && ( vSegments
[ vSegments
.size() - 1 ].Command
== nLatestSegmentCommand
) )
811 vSegments
[ vSegments
.size() -1 ].Count
++;
814 css::drawing::EnhancedCustomShapeSegment aSegment
;
815 aSegment
.Command
= nLatestSegmentCommand
;
817 vSegments
.push_back( aSegment
);
824 // Corrections for wrong paths in curvedArrow shapes written by older LO versions
825 if (!vSegments
.empty()
826 && (rType
== u
"mso-spt102" || rType
== u
"mso-spt103" || rType
== u
"mso-spt104"
827 || rType
== u
"mso-spt105")
828 && vSegments
[0].Count
== 2)
830 vSegments
[0].Count
= 1;
831 css::drawing::EnhancedCustomShapeSegment aSegment
;
834 = vSegments
[0].Command
== css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC
835 ? css::drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO
836 : css::drawing::EnhancedCustomShapeSegmentCommand::ARCTO
;
837 vSegments
.insert(vSegments
.begin() + 1, aSegment
);
840 // adding the Coordinates property
841 beans::PropertyValue aProp
;
842 aProp
.Name
= EASGet( EAS_Coordinates
);
843 aProp
.Value
<<= comphelper::containerToSequence(vCoordinates
);
844 rDest
.push_back( aProp
);
846 // adding the Segments property
847 aProp
.Name
= EASGet( EAS_Segments
);
848 aProp
.Value
<<= comphelper::containerToSequence(vSegments
);
849 rDest
.push_back( aProp
);
852 static void GetAdjustmentValues( std::vector
< css::beans::PropertyValue
>& rDest
, // draw:adjustments
853 std::u16string_view rValue
)
855 std::vector
< css::drawing::EnhancedCustomShapeAdjustmentValue
> vAdjustmentValue
;
856 css::drawing::EnhancedCustomShapeParameter aParameter
;
857 sal_Int32 nIndex
= 0;
858 while ( GetNextParameter( aParameter
, nIndex
, rValue
) )
860 css::drawing::EnhancedCustomShapeAdjustmentValue aAdj
;
861 if ( aParameter
.Type
== css::drawing::EnhancedCustomShapeParameterType::NORMAL
)
863 aAdj
.Value
= aParameter
.Value
;
864 aAdj
.State
= beans::PropertyState_DIRECT_VALUE
;
867 aAdj
.State
= beans::PropertyState_DEFAULT_VALUE
; // this should not be, but better than setting nothing
869 vAdjustmentValue
.push_back( aAdj
);
872 sal_Int32 nAdjustmentValues
= vAdjustmentValue
.size();
873 if ( nAdjustmentValues
)
875 beans::PropertyValue aProp
;
876 aProp
.Name
= EASGet( EAS_AdjustmentValues
);
877 aProp
.Value
<<= comphelper::containerToSequence(vAdjustmentValue
);
878 rDest
.push_back( aProp
);
882 void XMLEnhancedCustomShapeContext::startFastElement(
883 sal_Int32
/*nElement*/,
884 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
886 sal_Int32 nAttrNumber
;
887 std::optional
<std::string_view
> oSpecularityValue
; // for postpone extrusion-specularity
888 std::optional
<OUString
> oPathValue
; // for postpone GetEnhancedPath;
889 OUString
sType("non-primitive"); // default in ODF
890 for( auto& aIter
: sax_fastparser::castToFastAttributeList(xAttrList
) )
892 switch( EASGet( aIter
.getToken() ) )
896 sType
= aIter
.toString();
897 GetString( mrCustomShapeGeometry
, sType
, EAS_Type
);
900 case EAS_mirror_horizontal
:
901 GetBool( mrCustomShapeGeometry
, aIter
.toView(), EAS_MirroredX
);
903 case EAS_mirror_vertical
:
904 GetBool( mrCustomShapeGeometry
, aIter
.toView(), EAS_MirroredY
);
908 SdXMLImExViewBox
aViewBox( aIter
.toString(), GetImport().GetMM100UnitConverter() );
909 awt::Rectangle
aRect( aViewBox
.GetX(), aViewBox
.GetY(), aViewBox
.GetWidth(), aViewBox
.GetHeight() );
910 beans::PropertyValue aProp
;
911 aProp
.Name
= EASGet( EAS_ViewBox
);
912 aProp
.Value
<<= aRect
;
913 mrCustomShapeGeometry
.push_back( aProp
);
916 case EAS_sub_view_size
:
917 GetSizeSequence( maPath
, aIter
.toView(), EAS_SubViewSize
);
919 case EAS_text_rotate_angle
:
920 GetDouble( mrCustomShapeGeometry
, aIter
.toView(), EAS_TextRotateAngle
);
922 case EAS_extrusion_allowed
:
923 GetBool( maPath
, aIter
.toView(), EAS_ExtrusionAllowed
);
925 case EAS_text_path_allowed
:
926 GetBool( maPath
, aIter
.toView(), EAS_TextPathAllowed
);
928 case EAS_concentric_gradient_fill_allowed
:
929 GetBool( maPath
, aIter
.toView(), EAS_ConcentricGradientFillAllowed
);
932 GetBool( maExtrusion
, aIter
.toView(), EAS_Extrusion
);
934 case EAS_extrusion_brightness
:
935 GetDoublePercentage( maExtrusion
, aIter
.toView(), EAS_Brightness
);
937 case EAS_extrusion_depth
:
939 OUString rValue
= aIter
.toString();
940 sal_Int32 nIndex
= 0;
941 css::drawing::EnhancedCustomShapeParameterPair aParameterPair
;
942 css::drawing::EnhancedCustomShapeParameter
& rDepth
= aParameterPair
.First
;
943 if ( GetNextParameter( rDepth
, nIndex
, rValue
) )
945 css::drawing::EnhancedCustomShapeParameter
& rFraction
= aParameterPair
.Second
;
946 // try to catch the unit for the depth
947 sal_Int16
const eSrcUnit(
948 ::sax::Converter::GetUnitFromString(
949 rValue
, util::MeasureUnit::MM_100TH
));
951 OUStringBuffer aUnitStr
;
952 double fFactor
= ::sax::Converter::GetConversionFactor(
953 aUnitStr
, util::MeasureUnit::MM_100TH
, eSrcUnit
);
954 if ( ( fFactor
!= 1.0 ) && ( fFactor
!= 0.0 ) )
957 if ( rDepth
.Value
>>= fDepth
)
960 rDepth
.Value
<<= fDepth
;
963 if ( rValue
.matchIgnoreAsciiCase( aUnitStr
, nIndex
) )
964 nIndex
+= aUnitStr
.getLength();
966 // skipping white spaces
967 while( ( nIndex
< rValue
.getLength() ) && rValue
[ nIndex
] == ' ' )
970 if ( GetNextParameter( rFraction
, nIndex
, rValue
) )
972 beans::PropertyValue aProp
;
973 aProp
.Name
= EASGet( EAS_Depth
);
974 aProp
.Value
<<= aParameterPair
;
975 maExtrusion
.push_back( aProp
);
980 case EAS_extrusion_diffusion
:
981 GetDoublePercentage( maExtrusion
, aIter
.toView(), EAS_Diffusion
);
983 case EAS_extrusion_number_of_line_segments
:
984 GetInt32( maExtrusion
, aIter
.toView(), EAS_NumberOfLineSegments
);
986 case EAS_extrusion_light_face
:
987 GetBool( maExtrusion
, aIter
.toView(), EAS_LightFace
);
989 case EAS_extrusion_first_light_harsh
:
990 GetBool( maExtrusion
, aIter
.toView(), EAS_FirstLightHarsh
);
992 case EAS_extrusion_second_light_harsh
:
993 GetBool( maExtrusion
, aIter
.toView(), EAS_SecondLightHarsh
);
995 case EAS_extrusion_first_light_level
:
996 GetDoublePercentage( maExtrusion
, aIter
.toView(), EAS_FirstLightLevel
);
998 case EAS_extrusion_second_light_level
:
999 GetDoublePercentage( maExtrusion
, aIter
.toView(), EAS_SecondLightLevel
);
1001 case EAS_extrusion_first_light_direction
:
1002 GetB3DVector( maExtrusion
, aIter
.toView(), EAS_FirstLightDirection
);
1004 case EAS_extrusion_second_light_direction
:
1005 GetB3DVector( maExtrusion
, aIter
.toView(), EAS_SecondLightDirection
);
1007 case EAS_extrusion_metal
:
1008 GetBool( maExtrusion
, aIter
.toView(), EAS_Metal
);
1010 case EAS_extrusion_metal_type
:
1012 OUString rValue
= aIter
.toString();
1013 sal_Int16
eMetalType(drawing::EnhancedCustomShapeMetalType::MetalODF
);
1014 if (rValue
== "loext:MetalMSCompatible")
1015 eMetalType
= drawing::EnhancedCustomShapeMetalType::MetalMSCompatible
;
1016 beans::PropertyValue aProp
;
1017 aProp
.Name
= EASGet(EAS_MetalType
);
1018 aProp
.Value
<<= eMetalType
;
1019 maExtrusion
.push_back(aProp
);
1022 case EAS_shade_mode
:
1024 drawing::ShadeMode
eShadeMode( drawing::ShadeMode_FLAT
);
1025 if( IsXMLToken( aIter
, XML_PHONG
) )
1026 eShadeMode
= drawing::ShadeMode_PHONG
;
1027 else if ( IsXMLToken( aIter
, XML_GOURAUD
) )
1028 eShadeMode
= drawing::ShadeMode_SMOOTH
;
1029 else if ( IsXMLToken( aIter
, XML_DRAFT
) )
1030 eShadeMode
= drawing::ShadeMode_DRAFT
;
1032 beans::PropertyValue aProp
;
1033 aProp
.Name
= EASGet( EAS_ShadeMode
);
1034 aProp
.Value
<<= eShadeMode
;
1035 maExtrusion
.push_back( aProp
);
1038 case EAS_extrusion_rotation_angle
:
1039 GetEnhancedParameterPair( maExtrusion
, aIter
.toString(), EAS_RotateAngle
);
1041 case EAS_extrusion_rotation_center
:
1042 GetB3DVector( maExtrusion
, aIter
.toView(), EAS_RotationCenter
);
1044 case EAS_extrusion_shininess
:
1045 GetDoublePercentage( maExtrusion
, aIter
.toView(), EAS_Shininess
);
1047 case EAS_extrusion_skew
:
1048 GetEnhancedParameterPair( maExtrusion
, aIter
.toString(), EAS_Skew
);
1050 case EAS_extrusion_specularity
:
1051 if (!oSpecularityValue
)
1052 oSpecularityValue
= aIter
.toView();
1054 case EAS_extrusion_specularity_loext
:
1055 oSpecularityValue
= aIter
.toView();
1057 case EAS_projection
:
1059 drawing::ProjectionMode
eProjectionMode( drawing::ProjectionMode_PERSPECTIVE
);
1060 if( IsXMLToken( aIter
, XML_PARALLEL
) )
1061 eProjectionMode
= drawing::ProjectionMode_PARALLEL
;
1063 beans::PropertyValue aProp
;
1064 aProp
.Name
= EASGet( EAS_ProjectionMode
);
1065 aProp
.Value
<<= eProjectionMode
;
1066 maExtrusion
.push_back( aProp
);
1069 case EAS_extrusion_viewpoint
:
1070 GetPosition3D( maExtrusion
, aIter
.toView(), EAS_ViewPoint
, mrUnitConverter
);
1072 case EAS_extrusion_origin
:
1073 GetEnhancedParameterPair( maExtrusion
, aIter
.toString(), EAS_Origin
);
1075 case EAS_extrusion_color
:
1076 GetBool( maExtrusion
, aIter
.toView(), EAS_Color
);
1078 case EAS_enhanced_path
:
1079 oPathValue
= aIter
.toString();
1081 case EAS_path_stretchpoint_x
:
1083 if (::sax::Converter::convertNumber(nAttrNumber
, aIter
.toView()))
1085 beans::PropertyValue aProp
;
1086 aProp
.Name
= EASGet( EAS_StretchX
);
1087 aProp
.Value
<<= nAttrNumber
;
1088 maPath
.push_back( aProp
);
1092 case EAS_path_stretchpoint_y
:
1094 if (::sax::Converter::convertNumber(nAttrNumber
, aIter
.toView()))
1096 beans::PropertyValue aProp
;
1097 aProp
.Name
= EASGet( EAS_StretchY
);
1098 aProp
.Value
<<= nAttrNumber
;
1099 maPath
.push_back( aProp
);
1103 case EAS_text_areas
:
1104 GetEnhancedRectangleSequence( maPath
, aIter
.toString(), EAS_TextFrames
);
1106 case EAS_glue_points
:
1108 sal_Int32 i
, nPairs
= GetEnhancedParameterPairSequence( maPath
, aIter
.toString(), EAS_GluePoints
);
1109 GetImport().GetShapeImport()->moveGluePointMapping( mrxShape
, nPairs
);
1110 for ( i
= 0; i
< nPairs
; i
++ )
1111 GetImport().GetShapeImport()->addGluePointMapping( mrxShape
, i
+ 4, i
+ 4 );
1114 case EAS_glue_point_type
:
1115 GetEnum( maPath
, aIter
.toView(), EAS_GluePointType
, *aXML_GluePointEnumMap
);
1117 case EAS_glue_point_leaving_directions
:
1118 GetDoubleSequence( maPath
, aIter
.toView(), EAS_GluePointLeavingDirections
);
1120 case EAS_text_path
:
1121 GetBool( maTextPath
, aIter
.toView(), EAS_TextPath
);
1123 case EAS_text_path_mode
:
1125 css::drawing::EnhancedCustomShapeTextPathMode
eTextPathMode( css::drawing::EnhancedCustomShapeTextPathMode_NORMAL
);
1126 if( IsXMLToken( aIter
, XML_PATH
) )
1127 eTextPathMode
= css::drawing::EnhancedCustomShapeTextPathMode_PATH
;
1128 else if ( IsXMLToken( aIter
, XML_SHAPE
) )
1129 eTextPathMode
= css::drawing::EnhancedCustomShapeTextPathMode_SHAPE
;
1131 beans::PropertyValue aProp
;
1132 aProp
.Name
= EASGet( EAS_TextPathMode
);
1133 aProp
.Value
<<= eTextPathMode
;
1134 maTextPath
.push_back( aProp
);
1137 case EAS_text_path_scale
:
1139 bool bScaleX
= IsXMLToken( aIter
, XML_SHAPE
);
1140 beans::PropertyValue aProp
;
1141 aProp
.Name
= EASGet( EAS_ScaleX
);
1142 aProp
.Value
<<= bScaleX
;
1143 maTextPath
.push_back( aProp
);
1146 case EAS_text_path_same_letter_heights
:
1147 GetBool( maTextPath
, aIter
.toView(), EAS_SameLetterHeights
);
1149 case EAS_modifiers
:
1150 GetAdjustmentValues( mrCustomShapeGeometry
, aIter
.toString() );
1156 if (oSpecularityValue
)
1157 GetDoublePercentage( maExtrusion
, *oSpecularityValue
, EAS_Specularity
);
1159 GetEnhancedPath(maPath
, *oPathValue
, sType
);
1162 static void SdXMLCustomShapePropertyMerge( std::vector
< css::beans::PropertyValue
>& rPropVec
,
1163 const std::vector
< beans::PropertyValues
>& rElement
,
1164 const OUString
& rElementName
)
1166 if ( !rElement
.empty() )
1168 beans::PropertyValue aProp
;
1169 aProp
.Name
= rElementName
;
1170 aProp
.Value
<<= comphelper::containerToSequence(rElement
);
1171 rPropVec
.push_back( aProp
);
1175 static void SdXMLCustomShapePropertyMerge( std::vector
< css::beans::PropertyValue
>& rPropVec
,
1176 const std::vector
< OUString
>& rElement
,
1177 const OUString
& rElementName
)
1179 if ( !rElement
.empty() )
1181 beans::PropertyValue aProp
;
1182 aProp
.Name
= rElementName
;
1183 aProp
.Value
<<= comphelper::containerToSequence(rElement
);
1184 rPropVec
.push_back( aProp
);
1188 static void SdXMLCustomShapePropertyMerge( std::vector
< css::beans::PropertyValue
>& rPropVec
,
1189 const std::vector
< css::beans::PropertyValue
>& rElement
,
1190 const OUString
& rElementName
)
1192 if ( !rElement
.empty() )
1194 beans::PropertyValue aProp
;
1195 aProp
.Name
= rElementName
;
1196 aProp
.Value
<<= comphelper::containerToSequence(rElement
);
1197 rPropVec
.push_back( aProp
);
1201 typedef std::unordered_map
< OUString
, sal_Int32
> EquationHashMap
;
1203 /* if rPara.Type is from type EnhancedCustomShapeParameterType::EQUATION, the name of the equation
1204 will be converted from OUString to index */
1205 static void CheckAndResolveEquationParameter( css::drawing::EnhancedCustomShapeParameter
& rPara
, EquationHashMap
* pH
)
1207 if ( rPara
.Type
== css::drawing::EnhancedCustomShapeParameterType::EQUATION
)
1209 OUString aEquationName
;
1210 if ( rPara
.Value
>>= aEquationName
)
1212 sal_Int32 nIndex
= 0;
1213 EquationHashMap::iterator
aHashIter( pH
->find( aEquationName
) );
1214 if ( aHashIter
!= pH
->end() )
1215 nIndex
= (*aHashIter
).second
;
1216 rPara
.Value
<<= nIndex
;
1221 void XMLEnhancedCustomShapeContext::endFastElement(sal_Int32
)
1223 // resolve properties that are indexing an Equation
1224 if ( !maEquations
.empty() )
1226 // creating hash map containing the name and index of each equation
1228 std::vector
< OUString
>::iterator aEquationNameIter
= maEquationNames
.begin();
1229 std::vector
< OUString
>::iterator aEquationNameEnd
= maEquationNames
.end();
1230 while( aEquationNameIter
!= aEquationNameEnd
)
1232 aH
[ *aEquationNameIter
] = static_cast<sal_Int32
>( aEquationNameIter
- maEquationNames
.begin() );
1233 ++aEquationNameIter
;
1237 for( auto& rEquation
: maEquations
)
1239 sal_Int32 nIndexOf
= 0;
1242 nIndexOf
= rEquation
.indexOf( '?', nIndexOf
);
1243 if ( nIndexOf
!= -1 )
1245 OUString aEquationName
;
1246 if ( GetEquationName( rEquation
, nIndexOf
+ 1, aEquationName
) )
1248 // copying first characters inclusive '?'
1249 sal_Int32 nIndex
= 0;
1250 EquationHashMap::iterator
aHashIter( aH
.find( aEquationName
) );
1251 if ( aHashIter
!= aH
.end() )
1252 nIndex
= (*aHashIter
).second
;
1253 OUString aNew
= rEquation
.subView( 0, nIndexOf
+ 1 ) +
1254 OUString::number( nIndex
) +
1255 rEquation
.subView( nIndexOf
+ aEquationName
.getLength() + 1 );
1261 while( nIndexOf
!= -1 );
1265 for ( const beans::PropertyValue
& rPathItem
: maPath
)
1267 switch( EASGet( rPathItem
.Name
) )
1269 case EAS_Coordinates
:
1270 case EAS_GluePoints
:
1272 uno::Sequence
< css::drawing::EnhancedCustomShapeParameterPair
> const & rSeq
=
1273 *o3tl::doAccess
<uno::Sequence
< css::drawing::EnhancedCustomShapeParameterPair
> >(
1275 for ( const auto& rElem
: rSeq
)
1277 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.First
), &aH
);
1278 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.Second
), &aH
);
1282 case EAS_TextFrames
:
1284 uno::Sequence
< css::drawing::EnhancedCustomShapeTextFrame
> const & rSeq
=
1285 *o3tl::doAccess
<uno::Sequence
< css::drawing::EnhancedCustomShapeTextFrame
> >(
1287 for ( const auto& rElem
: rSeq
)
1289 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.TopLeft
.First
), &aH
);
1290 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.TopLeft
.Second
), &aH
);
1291 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.BottomRight
.First
), &aH
);
1292 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(rElem
.BottomRight
.Second
), &aH
);
1300 for ( css::beans::PropertyValues
const & aHandle
: maHandles
)
1302 for ( beans::PropertyValue
const & propValue
: aHandle
)
1304 switch( EASGet( propValue
.Name
) )
1306 case EAS_RangeYMinimum
:
1307 case EAS_RangeYMaximum
:
1308 case EAS_RangeXMinimum
:
1309 case EAS_RangeXMaximum
:
1310 case EAS_RadiusRangeMinimum
:
1311 case EAS_RadiusRangeMaximum
:
1313 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>(*o3tl::doAccess
<css::drawing::EnhancedCustomShapeParameter
>(
1314 propValue
.Value
)), &aH
);
1321 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>((*o3tl::doAccess
<css::drawing::EnhancedCustomShapeParameterPair
>(
1322 propValue
.Value
)).First
), &aH
);
1323 CheckAndResolveEquationParameter( const_cast<css::drawing::EnhancedCustomShapeParameter
&>((*o3tl::doAccess
<css::drawing::EnhancedCustomShapeParameterPair
>(
1324 propValue
.Value
)).Second
), &aH
);
1334 SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry
, maExtrusion
, EASGet( EAS_Extrusion
) );
1335 SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry
, maPath
, EASGet( EAS_Path
) );
1336 SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry
, maTextPath
, EASGet( EAS_TextPath
) );
1337 SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry
, maEquations
, EASGet( EAS_Equations
) );
1338 if ( !maHandles
.empty() )
1339 SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry
, maHandles
, EASGet( EAS_Handles
) );
1342 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLEnhancedCustomShapeContext::createFastChildContext(
1344 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
)
1346 EnhancedCustomShapeTokenEnum aTokenEnum
= EASGet( nElement
);
1347 if ( aTokenEnum
== EAS_equation
)
1350 OUString aFormulaName
;
1351 for( auto& aIter
: sax_fastparser::castToFastAttributeList(xAttrList
) )
1353 OUString sValue
= aIter
.toString();
1354 switch( EASGet( aIter
.getToken() ) )
1360 aFormulaName
= sValue
;
1366 if ( !aFormulaName
.isEmpty() || !aFormula
.isEmpty() )
1368 maEquations
.push_back( aFormula
);
1369 maEquationNames
.push_back( aFormulaName
);
1372 else if ( aTokenEnum
== EAS_handle
)
1374 std::vector
< css::beans::PropertyValue
> aHandle
;
1375 for( auto& aIter
: sax_fastparser::castToFastAttributeList(xAttrList
) )
1377 switch( EASGet( aIter
.getToken() ) )
1379 case EAS_handle_mirror_vertical
:
1380 GetBool( aHandle
, aIter
.toView(), EAS_MirroredY
);
1382 case EAS_handle_mirror_horizontal
:
1383 GetBool( aHandle
, aIter
.toView(), EAS_MirroredX
);
1385 case EAS_handle_switched
:
1386 GetBool( aHandle
, aIter
.toView(), EAS_Switched
);
1388 case EAS_handle_position
:
1389 GetEnhancedParameterPair( aHandle
, aIter
.toString(), EAS_Position
);
1391 case EAS_handle_range_x_minimum
:
1392 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RangeXMinimum
);
1394 case EAS_handle_range_x_maximum
:
1395 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RangeXMaximum
);
1397 case EAS_handle_range_y_minimum
:
1398 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RangeYMinimum
);
1400 case EAS_handle_range_y_maximum
:
1401 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RangeYMaximum
);
1403 case EAS_handle_polar
:
1404 GetEnhancedParameterPair( aHandle
, aIter
.toString(), EAS_Polar
);
1406 case EAS_handle_radius_range_minimum
:
1407 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RadiusRangeMinimum
);
1409 case EAS_handle_radius_range_maximum
:
1410 GetEnhancedParameter( aHandle
, aIter
.toString(), EAS_RadiusRangeMaximum
);
1416 maHandles
.push_back( comphelper::containerToSequence(aHandle
) );
1421 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */