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>
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>
51#include <unordered_map>
59 css::uno::Reference< css::drawing::XShape >& rxShape,
60 std::vector< css::beans::PropertyValue >& rCustomShapeGeometry ) :
62 mrUnitConverter( rImport.GetMM100UnitConverter() ),
64 mrCustomShapeGeometry( rCustomShapeGeometry )
76static void GetBool( std::vector< css::beans::PropertyValue >& rDest,
82 beans::PropertyValue aProp;
83 aProp.Name =
EASGet( eDestProp );
84 aProp.Value <<= bAttrBool;
85 rDest.push_back( aProp );
89static void GetInt32( std::vector< css::beans::PropertyValue >& rDest,
92 sal_Int32 nAttrNumber;
95 beans::PropertyValue aProp;
96 aProp.Name =
EASGet( eDestProp );
97 aProp.Value <<= nAttrNumber;
98 rDest.push_back( aProp );
102static void GetDouble( std::vector< css::beans::PropertyValue >& rDest,
108 beans::PropertyValue aProp;
109 aProp.Name =
EASGet( eDestProp );
110 aProp.Value <<= fAttrDouble;
111 rDest.push_back( aProp );
115static void GetString( std::vector< css::beans::PropertyValue >& rDest,
118 beans::PropertyValue aProp;
119 aProp.Name =
EASGet( eDestProp );
120 aProp.Value <<= rValue;
121 rDest.push_back( aProp );
124template<
typename EnumT>
125static void GetEnum( std::vector< css::beans::PropertyValue >& rDest,
132 beans::PropertyValue aProp;
133 aProp.Name =
EASGet( eDestProp );
134 aProp.Value <<=
static_cast<sal_Int16
>(eKind);
135 rDest.push_back( aProp );
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 );
160static void GetB3DVector( std::vector< css::beans::PropertyValue >& rDest,
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 );
174static 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()) )
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 );
197static 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;
221 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::EQUATION;
222 rParameter.Value <<= aEquationName;
223 nIndex += aEquationName.getLength();
226 else if ( rParaString[
nIndex ] >
'9' )
228 bNumberRequired =
false;
231 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::LEFT;
236 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::TOP;
241 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::RIGHT;
246 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::BOTTOM;
251 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::XSTRETCH;
256 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::YSTRETCH;
261 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::HASSTROKE;
266 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::HASFILL;
271 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::WIDTH;
276 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::HEIGHT;
281 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::LOGWIDTH;
286 rParameter.Type = css::drawing::EnhancedCustomShapeParameterType::LOGHEIGHT;
294 if ( bNumberRequired )
296 sal_Int32 nStartIndex =
nIndex;
297 sal_Int32 nEIndex = 0;
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 ) );
391 rParameter.Value <<= fAttrDouble;
399 rParameter.Value <<=
nValue;
412 while(
nIndex <
static_cast<sal_Int32
>(rParaString.size()))
416 if(aSpace == aCandidate || aCommata == aCandidate)
433 drawing::Position3D aPosition3D;
436 beans::PropertyValue aProp;
437 aProp.Name =
EASGet( eDestProp );
438 aProp.Value <<= aPosition3D;
439 rDest.push_back( aProp );
446 std::vector< double > vDirection;
455 vDirection.push_back( fAttrDouble );
459 if ( !vDirection.empty() )
461 beans::PropertyValue aProp;
462 aProp.Name =
EASGet( eDestProp );
464 rDest.push_back( aProp );
471 std::vector< sal_Int32 > vNum;
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 ) {
499 beans::PropertyValue aProp;
500 aProp.Name =
EASGet( eDestProp );
501 aProp.Value <<= aSizeSeq;
502 rDest.push_back( aProp );
509 css::drawing::EnhancedCustomShapeParameter aParameter;
512 beans::PropertyValue aProp;
513 aProp.Name =
EASGet( eDestProp );
514 aProp.Value <<= aParameter;
515 rDest.push_back( aProp );
523 css::drawing::EnhancedCustomShapeParameterPair aParameterPair;
527 beans::PropertyValue aProp;
528 aProp.Name =
EASGet( eDestProp );
529 aProp.Value <<= aParameterPair;
530 rDest.push_back( aProp );
537 std::vector< css::drawing::EnhancedCustomShapeParameterPair > vParameter;
538 css::drawing::EnhancedCustomShapeParameterPair aParameter;
544 vParameter.push_back( aParameter );
546 if ( !vParameter.empty() )
548 beans::PropertyValue aProp;
549 aProp.Name =
EASGet( eDestProp );
551 rDest.push_back( aProp );
553 return vParameter.size();
559 std::vector< css::drawing::EnhancedCustomShapeTextFrame > vTextFrame;
560 css::drawing::EnhancedCustomShapeTextFrame aParameter;
569 vTextFrame.push_back( aParameter );
571 if ( !vTextFrame.empty() )
573 beans::PropertyValue aProp;
574 aProp.Name =
EASGet( eDestProp );
576 rDest.push_back( aProp );
582 std::u16string_view rValue, std::u16string_view rType)
584 std::vector< css::drawing::EnhancedCustomShapeParameterPair > vCoordinates;
585 std::vector< css::drawing::EnhancedCustomShapeSegment > vSegments;
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;
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 )
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;
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 );
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);
841 beans::PropertyValue aProp;
844 rDest.push_back( aProp );
849 rDest.push_back( aProp );
853 std::u16string_view rValue )
855 std::vector< css::drawing::EnhancedCustomShapeAdjustmentValue > vAdjustmentValue;
856 css::drawing::EnhancedCustomShapeParameter aParameter;
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;
869 vAdjustmentValue.push_back( aAdj );
872 sal_Int32 nAdjustmentValues = vAdjustmentValue.size();
873 if ( nAdjustmentValues )
875 beans::PropertyValue aProp;
878 rDest.push_back( aProp );
884 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
886 sal_Int32 nAttrNumber;
887 std::optional<std::string_view> oSpecularityValue;
888 std::optional<OUString> oPathValue;
889 OUString
sType(
"non-primitive");
892 switch(
EASGet( aIter.getToken() ) )
896 sType = aIter.toString();
910 beans::PropertyValue aProp;
912 aProp.Value <<= aRect;
939 OUString rValue = aIter.toString();
941 css::drawing::EnhancedCustomShapeParameterPair aParameterPair;
942 css::drawing::EnhancedCustomShapeParameter& rDepth = aParameterPair.First;
945 css::drawing::EnhancedCustomShapeParameter& rFraction = aParameterPair.Second;
947 sal_Int16
const eSrcUnit(
949 rValue, util::MeasureUnit::MM_100TH));
951 OUStringBuffer aUnitStr;
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();
967 while( (
nIndex < rValue.getLength() ) && rValue[
nIndex ] ==
' ' )
972 beans::PropertyValue aProp;
974 aProp.Value <<= aParameterPair;
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;
1018 aProp.Value <<= eMetalType;
1024 drawing::ShadeMode eShadeMode( drawing::ShadeMode_FLAT );
1026 eShadeMode = drawing::ShadeMode_PHONG;
1028 eShadeMode = drawing::ShadeMode_SMOOTH;
1030 eShadeMode = drawing::ShadeMode_DRAFT;
1032 beans::PropertyValue aProp;
1034 aProp.Value <<= eShadeMode;
1051 if (!oSpecularityValue)
1052 oSpecularityValue = aIter.toView();
1055 oSpecularityValue = aIter.toView();
1059 drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PERSPECTIVE );
1061 eProjectionMode = drawing::ProjectionMode_PARALLEL;
1063 beans::PropertyValue aProp;
1065 aProp.Value <<= eProjectionMode;
1079 oPathValue = aIter.toString();
1085 beans::PropertyValue aProp;
1087 aProp.Value <<= nAttrNumber;
1088 maPath.push_back( aProp );
1096 beans::PropertyValue aProp;
1098 aProp.Value <<= nAttrNumber;
1099 maPath.push_back( aProp );
1110 for (
i = 0;
i < nPairs;
i++ )
1125 css::drawing::EnhancedCustomShapeTextPathMode eTextPathMode( css::drawing::EnhancedCustomShapeTextPathMode_NORMAL );
1127 eTextPathMode = css::drawing::EnhancedCustomShapeTextPathMode_PATH;
1129 eTextPathMode = css::drawing::EnhancedCustomShapeTextPathMode_SHAPE;
1131 beans::PropertyValue aProp;
1133 aProp.Value <<= eTextPathMode;
1140 beans::PropertyValue aProp;
1142 aProp.Value <<= bScaleX;
1156 if (oSpecularityValue)
1163 const std::vector< beans::PropertyValues >& rElement,
1164 const OUString& rElementName )
1166 if ( !rElement.empty() )
1168 beans::PropertyValue aProp;
1169 aProp.Name = rElementName;
1171 rPropVec.push_back( aProp );
1176 const std::vector< OUString >& rElement,
1177 const OUString& rElementName )
1179 if ( !rElement.empty() )
1181 beans::PropertyValue aProp;
1182 aProp.Name = rElementName;
1184 rPropVec.push_back( aProp );
1189 const std::vector< css::beans::PropertyValue >& rElement,
1190 const OUString& rElementName )
1192 if ( !rElement.empty() )
1194 beans::PropertyValue aProp;
1195 aProp.Name = rElementName;
1197 rPropVec.push_back( aProp );
1207 if ( rPara.Type == css::drawing::EnhancedCustomShapeParameterType::EQUATION )
1209 OUString aEquationName;
1210 if ( rPara.Value >>= aEquationName )
1213 EquationHashMap::iterator aHashIter( pH->find( aEquationName ) );
1214 if ( aHashIter != pH->end() )
1215 nIndex = (*aHashIter).second;
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;
1239 sal_Int32 nIndexOf = 0;
1242 nIndexOf = rEquation.indexOf(
'?', nIndexOf );
1243 if ( nIndexOf != -1 )
1245 OUString aEquationName;
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 ) )
1272 uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair >
const & rSeq =
1273 *o3tl::doAccess<uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair > >(
1275 for (
const auto& rElem : rSeq )
1284 uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame >
const & rSeq =
1285 *o3tl::doAccess<uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > >(
1287 for (
const auto& rElem : rSeq )
1300 for ( css::beans::PropertyValues
const & aHandle :
maHandles )
1302 for ( beans::PropertyValue
const & propValue : aHandle )
1304 switch(
EASGet( propValue.Name ) )
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 );
1344 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
1350 OUString aFormulaName;
1353 OUString sValue = aIter.toString();
1354 switch(
EASGet( aIter.getToken() ) )
1360 aFormulaName = sValue;
1366 if ( !aFormulaName.isEmpty() || !aFormula.isEmpty() )
1374 std::vector< css::beans::PropertyValue > aHandle;
1377 switch(
EASGet( aIter.getToken() ) )
const PropertyValue * pValues
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
bool convertPosition3D(css::drawing::Position3D &rPosition, std::string_view rValue) const
convert string to Position3D
static bool convertB3DVector(::basegfx::B3DVector &rVector, std::string_view rValue)
convert string to basegfx::B3DVector
std::vector< css::beans::PropertyValue > & mrCustomShapeGeometry
std::vector< OUString > maEquationNames
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SvXMLUnitConverter & mrUnitConverter
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
std::vector< css::beans::PropertyValue > maTextPath
css::uno::Reference< css::drawing::XShape > & mrxShape
XMLEnhancedCustomShapeContext(SvXMLImport &rImport, css::uno::Reference< css::drawing::XShape > &, std::vector< css::beans::PropertyValue > &rCustomShapeGeometry)
std::vector< OUString > maEquations
std::vector< css::beans::PropertyValue > maPath
std::vector< css::beans::PropertyValues > maHandles
std::vector< css::beans::PropertyValue > maExtrusion
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static double GetConversionFactor(OUStringBuffer &rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static sal_Int16 GetUnitFromString(std::u16string_view rString, sal_Int16 nDefaultUnit)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
static bool convertBool(bool &rBool, std::u16string_view rString)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
bool matchIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2, sal_Int32 fromIndex=0)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
EnhancedCustomShapeTokenEnum EASGet(std::u16string_view rShapeType)
EnhancedCustomShapeTokenEnum
@ EAS_extrusion_shininess
@ EAS_handle_range_x_minimum
@ EAS_handle_range_y_maximum
@ EAS_extrusion_diffusion
@ EAS_concentric_gradient_fill_allowed
@ EAS_extrusion_first_light_harsh
@ EAS_NumberOfLineSegments
@ EAS_extrusion_rotation_angle
@ EAS_handle_mirror_horizontal
@ EAS_extrusion_number_of_line_segments
@ EAS_extrusion_light_face
@ EAS_extrusion_second_light_harsh
@ EAS_handle_radius_range_minimum
@ EAS_extrusion_second_light_direction
@ EAS_extrusion_metal_type
@ EAS_extrusion_specularity_loext
@ EAS_handle_radius_range_maximum
@ EAS_handle_range_x_maximum
@ EAS_handle_mirror_vertical
@ EAS_path_stretchpoint_y
@ EAS_SecondLightDirection
@ EAS_extrusion_viewpoint
@ EAS_FirstLightDirection
@ EAS_text_path_same_letter_heights
@ EAS_path_stretchpoint_x
@ EAS_extrusion_specularity
@ EAS_GluePointLeavingDirections
@ EAS_ConcentricGradientFillAllowed
@ EAS_extrusion_first_light_level
@ EAS_extrusion_brightness
@ EAS_extrusion_first_light_direction
@ EAS_glue_point_leaving_directions
@ EAS_extrusion_rotation_center
@ EAS_extrusion_second_light_level
@ EAS_handle_range_y_minimum
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const SvXMLEnumMapEntry< sal_uInt16 > aXML_GluePointEnumMap[]
static void GetEnum(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp, const SvXMLEnumMapEntry< EnumT > &rMap)
static sal_Int32 GetEnhancedParameterPairSequence(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static bool GetEquationName(std::u16string_view rEquation, const sal_Int32 nStart, OUString &rEquationName)
static void GetEnhancedParameterPair(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetBool(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void CheckAndResolveEquationParameter(css::drawing::EnhancedCustomShapeParameter &rPara, EquationHashMap *pH)
static void GetString(std::vector< css::beans::PropertyValue > &rDest, const OUString &rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetEnhancedPath(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue, std::u16string_view rType)
static void GetDouble(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetB3DVector(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static bool GetNextParameter(css::drawing::EnhancedCustomShapeParameter &rParameter, sal_Int32 &nIndex, std::u16string_view rParaString)
static void GetEnhancedParameter(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetInt32(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetAdjustmentValues(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue)
static void GetSizeSequence(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetDoublePercentage(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
static void GetDoubleSequence(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)
std::unordered_map< OUString, sal_Int32 > EquationHashMap
static void GetPosition3D(std::vector< css::beans::PropertyValue > &rDest, std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp, const SvXMLUnitConverter &rUnitConverter)
static void SdXMLCustomShapePropertyMerge(std::vector< css::beans::PropertyValue > &rPropVec, const std::vector< beans::PropertyValues > &rElement, const OUString &rElementName)
static void GetEnhancedRectangleSequence(std::vector< css::beans::PropertyValue > &rDest, std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp)