diff options
author | Noel <noelgrandin@gmail.com> | 2020-12-15 09:38:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-15 10:50:28 +0100 |
commit | a79e6a7cf1ce3be46e4339a54b013ddaa534dd39 (patch) | |
tree | 3de6cf2d804dfe0e929f999103fa1c2c01b9ec53 /xmloff/source/draw | |
parent | 15e4427e8fb56a143caa28b8a3120f3761fc77a5 (diff) |
use views to parse rather than allocating OUString
Change-Id: If0a848c64ce8077d1681661873629c83307cf8b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107736
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/QRCodeContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/XMLNumberStyles.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 127 | ||||
-rw-r--r-- | xmloff/source/draw/animimp.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/draw/eventimp.cxx | 30 | ||||
-rw-r--r-- | xmloff/source/draw/ximp3dobject.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/draw/ximp3dscene.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/draw/ximpcustomshape.cxx | 130 | ||||
-rw-r--r-- | xmloff/source/draw/ximppage.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshow.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 27 |
12 files changed, 194 insertions, 216 deletions
diff --git a/xmloff/source/draw/QRCodeContext.cxx b/xmloff/source/draw/QRCodeContext.cxx index 978737b341319..f217fcf17ffaa 100644 --- a/xmloff/source/draw/QRCodeContext.cxx +++ b/xmloff/source/draw/QRCodeContext.cxx @@ -65,7 +65,7 @@ QRCodeContext::QRCodeContext(SvXMLImport& rImport, sal_Int32 /*nElement*/, case XML_ELEMENT(LO_EXT, XML_QRCODE_BORDER): { sal_Int32 nAttrVal; - if (sax::Converter::convertNumber(nAttrVal, aIter.toString(), 0)) + if (sax::Converter::convertNumber(nAttrVal, aIter.toView(), 0)) aQRCode.Border = nAttrVal; break; } diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index db2f93e8b6077..3d4407d8a5dff 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -531,18 +531,16 @@ SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); - switch (aIter.getToken()) { case XML_ELEMENT(NUMBER, XML_DECIMAL_PLACES): - mbDecimal02 = IsXMLToken( sValue, XML_2 ); + mbDecimal02 = IsXMLToken( aIter, XML_2 ); break; case XML_ELEMENT(NUMBER, XML_STYLE): - mbLong = IsXMLToken( sValue, XML_LONG ); + mbLong = IsXMLToken( aIter, XML_LONG ); break; case XML_ELEMENT(NUMBER, XML_TEXTUAL): - mbTextual = IsXMLToken( sValue, XML_TRUE ); + mbTextual = IsXMLToken( aIter, XML_TRUE ); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); @@ -591,9 +589,8 @@ SdXMLNumberFormatImportContext::SdXMLNumberFormatImportContext( SdXMLImport& rIm for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); if( aIter.getToken() == XML_ELEMENT(NUMBER, XML_AUTOMATIC_ORDER) ) - mbAutomatic = IsXMLToken( sValue, XML_TRUE ); + mbAutomatic = IsXMLToken( aIter, XML_TRUE ); else XMLOFF_WARN_UNKNOWN("xmloff", aIter); } diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 6c8672fa38b45..2813160d76917 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -122,10 +122,10 @@ AnimationsImportHelperImpl::AnimationsImportHelperImpl( SvXMLImport& rImport ) { } -static bool isDouble( const OUString& rValue ) +static bool isDouble( std::string_view rValue ) { - sal_Int32 nLength = rValue.getLength(); - const sal_Unicode * pStr = rValue.getStr(); + sal_Int32 nLength = rValue.size(); + const char * pStr = rValue.data(); while( nLength ) { if( (*pStr >= '0' && *pStr <= '9') || *pStr == '-' || *pStr == '.' || *pStr == '+' || *pStr == 'e' || *pStr == 'E' ) @@ -557,7 +557,6 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: sal_Int16 nEnum; for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString rValue = aIter.toString(); auto nToken = aIter.getToken(); switch( nToken ) { @@ -565,28 +564,28 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_BEGIN): case XML_ELEMENT(SMIL_SO52, XML_BEGIN): { - mxNode->setBegin( mpHelper->convertTiming( rValue ) ); + mxNode->setBegin( mpHelper->convertTiming( aIter.toString() ) ); } break; case XML_ELEMENT(SMIL, XML_DUR): case XML_ELEMENT(SMIL_COMPAT, XML_DUR): case XML_ELEMENT(SMIL_SO52, XML_DUR): { - mxNode->setDuration( mpHelper->convertTiming( rValue ) ); + mxNode->setDuration( mpHelper->convertTiming( aIter.toString() ) ); } break; case XML_ELEMENT(SMIL, XML_END): case XML_ELEMENT(SMIL_COMPAT, XML_END): case XML_ELEMENT(SMIL_SO52, XML_END): { - mxNode->setEnd( mpHelper->convertTiming( rValue ) ); + mxNode->setEnd( mpHelper->convertTiming( aIter.toString() ) ); } break; case XML_ELEMENT(SMIL, XML_FILL): case XML_ELEMENT(SMIL_COMPAT, XML_FILL): case XML_ELEMENT(SMIL_SO52, XML_FILL): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Fill ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_Fill ) ) mxNode->setFill( nEnum ); } break; @@ -594,7 +593,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_FILLDEFAULT): case XML_ELEMENT(SMIL_SO52, XML_FILLDEFAULT): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_FillDefault ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_FillDefault ) ) mxNode->setFillDefault( nEnum ); } break; @@ -602,7 +601,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_RESTART): case XML_ELEMENT(SMIL_SO52, XML_RESTART): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Restart ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_Restart ) ) mxNode->setRestart( nEnum ); } break; @@ -610,7 +609,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_RESTARTDEFAULT): case XML_ELEMENT(SMIL_SO52, XML_RESTARTDEFAULT): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_RestartDefault ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_RestartDefault ) ) mxNode->setRestartDefault( nEnum ); } break; @@ -618,16 +617,16 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_ACCELERATE): case XML_ELEMENT(SMIL_SO52, XML_ACCELERATE): { - if( isDouble( rValue ) ) - mxNode->setAcceleration( rValue.toDouble() ); + if( isDouble( aIter.toView() ) ) + mxNode->setAcceleration( aIter.toDouble() ); } break; case XML_ELEMENT(SMIL, XML_DECELERATE): case XML_ELEMENT(SMIL_COMPAT, XML_DECELERATE): case XML_ELEMENT(SMIL_SO52, XML_DECELERATE): { - if( isDouble( rValue ) ) - mxNode->setDecelerate( rValue.toDouble() ); + if( isDouble( aIter.toView() ) ) + mxNode->setDecelerate( aIter.toDouble() ); } break; case XML_ELEMENT(SMIL, XML_AUTOREVERSE): @@ -635,7 +634,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_AUTOREVERSE): { bool bTemp; - if (::sax::Converter::convertBool( bTemp, rValue )) + if (::sax::Converter::convertBool( bTemp, aIter.toView() )) mxNode->setAutoReverse( bTemp ); } break; @@ -643,21 +642,21 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_REPEATCOUNT): case XML_ELEMENT(SMIL_SO52, XML_REPEATCOUNT): { - mxNode->setRepeatCount( mpHelper->convertTiming( rValue ) ); + mxNode->setRepeatCount( mpHelper->convertTiming( aIter.toString() ) ); } break; case XML_ELEMENT(SMIL, XML_REPEATDUR): case XML_ELEMENT(SMIL_COMPAT, XML_REPEATDUR): case XML_ELEMENT(SMIL_SO52, XML_REPEATDUR): { - mxNode->setRepeatDuration( mpHelper->convertTiming( rValue ) ); + mxNode->setRepeatDuration( mpHelper->convertTiming( aIter.toString() ) ); } break; case XML_ELEMENT(SMIL, XML_ENDSYNC): case XML_ELEMENT(SMIL_COMPAT, XML_ENDSYNC): case XML_ELEMENT(SMIL_SO52, XML_ENDSYNC): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Endsync ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_Endsync ) ) mxNode->setEndSync( makeAny( nEnum ) ); } break; @@ -666,7 +665,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_OOO, XML_NODE_TYPE): case XML_ELEMENT(PRESENTATION_OASIS, XML_NODE_TYPE): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_EffectNodeType ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_EffectNodeType ) ) aUserData.emplace_back( GetXMLToken( XML_NODE_TYPE ), makeAny( nEnum ) ); } break; @@ -675,7 +674,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_OOO, XML_PRESET_ID): case XML_ELEMENT(PRESENTATION_OASIS, XML_PRESET_ID): { - aUserData.emplace_back( GetXMLToken( XML_PRESET_ID ), makeAny( rValue ) ); + aUserData.emplace_back( GetXMLToken( XML_PRESET_ID ), makeAny( aIter.toString() ) ); } break; case XML_ELEMENT(PRESENTATION, XML_PRESET_SUB_TYPE): @@ -683,7 +682,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_OOO, XML_PRESET_SUB_TYPE): case XML_ELEMENT(PRESENTATION_OASIS, XML_PRESET_SUB_TYPE): { - aUserData.emplace_back( GetXMLToken( XML_PRESET_SUB_TYPE ), makeAny( rValue ) ); + aUserData.emplace_back( GetXMLToken( XML_PRESET_SUB_TYPE ), makeAny( aIter.toString() ) ); } break; case XML_ELEMENT(PRESENTATION, XML_PRESET_CLASS): @@ -691,7 +690,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_OOO, XML_PRESET_CLASS): case XML_ELEMENT(PRESENTATION_OASIS, XML_PRESET_CLASS): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_EffectPresetClass ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_EffectPresetClass ) ) aUserData.emplace_back( GetXMLToken( XML_PRESET_CLASS ), makeAny( nEnum ) ); } break; @@ -700,7 +699,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_OOO, XML_AFTER_EFFECT): { bool bTemp; - if (::sax::Converter::convertBool( bTemp, rValue )) + if (::sax::Converter::convertBool( bTemp, aIter.toView() )) aUserData.emplace_back( GetXMLToken( XML_AFTER_EFFECT ), makeAny( bTemp ) ); } break; @@ -709,7 +708,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( nNodeType == AnimationNodeType::AUDIO ) { Reference< XAudio > xAudio( mxNode, UNO_QUERY_THROW ); - xAudio->setSource( makeAny(lcl_GetMediaReference(GetImport(), rValue)) ); + xAudio->setSource( makeAny(lcl_GetMediaReference(GetImport(), aIter.toString())) ); break; } [[fallthrough]]; @@ -718,7 +717,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_TARGETELEMENT): case XML_ELEMENT(SMIL_SO52, XML_TARGETELEMENT): { - Any aTarget( mpHelper->convertTarget( rValue ) ); + Any aTarget( mpHelper->convertTarget( aIter.toString() ) ); if( xAnimate.is() ) { @@ -740,10 +739,10 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( nNodeType == AnimationNodeType::AUDIO ) { - if( isDouble( rValue ) ) + if( isDouble( aIter.toView() ) ) { Reference< XAudio > xAudio( mxNode, UNO_QUERY_THROW ); - xAudio->setVolume( rValue.toDouble() ); + xAudio->setVolume( aIter.toDouble() ); } } } @@ -753,7 +752,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_SO52, XML_MASTER_ELEMENT): case XML_ELEMENT(PRESENTATION_OOO, XML_MASTER_ELEMENT): { - Reference< XAnimationNode > xMaster( GetImport().getInterfaceToIdentifierMapper().getReference( rValue ), UNO_QUERY ); + Reference< XAnimationNode > xMaster( GetImport().getInterfaceToIdentifierMapper().getReference( aIter.toString() ), UNO_QUERY ); aUserData.emplace_back( GetXMLToken( XML_MASTER_ELEMENT ), makeAny( xMaster ) ); } break; @@ -761,7 +760,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(ANIMATION, XML_SUB_ITEM): case XML_ELEMENT(ANIMATION_OOO, XML_SUB_ITEM): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_SubItem ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_SubItem ) ) { if( xAnimate.is() ) { @@ -781,12 +780,12 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xAnimate.is() ) { - OUString aName( rValue ); + OUString aName( aIter.toString() ); const struct ImplAttributeNameConversion* p = getAnimationAttributeNamesConversionList(); while( p->mpAPIName ) { - if( IsXMLToken( aName, p->meXMLToken ) ) + if( IsXMLToken( aIter, p->meXMLToken ) ) { aName = OUString::createFromAscii( p->mpAPIName ); meAttributeName = p->meXMLToken; @@ -805,7 +804,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_VALUES): case XML_ELEMENT(SMIL_SO52, XML_VALUES): { - aValues = rValue; + aValues = aIter.toString(); } break; @@ -813,7 +812,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_FROM): case XML_ELEMENT(SMIL_SO52, XML_FROM): { - aFrom = rValue; + aFrom = aIter.toString(); } break; @@ -821,7 +820,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_BY): case XML_ELEMENT(SMIL_SO52, XML_BY): { - aBy = rValue; + aBy = aIter.toString(); } break; @@ -829,7 +828,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_COMPAT, XML_TO): case XML_ELEMENT(SMIL_SO52, XML_TO): { - aTo = rValue; + aTo = aIter.toString(); } break; @@ -838,7 +837,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_KEYTIMES): { if( xAnimate.is() ) - xAnimate->setKeyTimes( AnimationsImportHelperImpl::convertKeyTimes( rValue ) ); + xAnimate->setKeyTimes( AnimationsImportHelperImpl::convertKeyTimes( aIter.toString() ) ); } break; @@ -846,19 +845,19 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(ANIMATION_OOO, XML_FORMULA): { if( xAnimate.is() ) - xAnimate->setFormula( rValue ); + xAnimate->setFormula( aIter.toString() ); } break; case XML_ELEMENT(ANIMATION, XML_ID): case XML_ELEMENT(ANIMATION_OOO, XML_ID): { - if (!bHaveXmlId) { sXmlId = rValue; } + if (!bHaveXmlId) { sXmlId = aIter.toString(); } } break; case XML_ELEMENT(XML, XML_ID): { - sXmlId = rValue; + sXmlId = aIter.toString(); bHaveXmlId = true; } break; @@ -869,7 +868,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xAnimate.is() ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_CalcMode ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_CalcMode ) ) xAnimate->setCalcMode( nEnum ); } } @@ -880,7 +879,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_ACCUMULATE): { if( xAnimate.is() ) - xAnimate->setAccumulate( IsXMLToken( rValue, XML_SUM ) ); + xAnimate->setAccumulate( IsXMLToken( aIter, XML_SUM ) ); } break; @@ -893,7 +892,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xAnimate.is() ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_AdditiveMode ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_AdditiveMode ) ) xAnimate->setAdditive( nEnum ); } } @@ -904,7 +903,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_KEYSPLINES): { if( xAnimate.is() ) - xAnimate->setTimeFilter( AnimationsImportHelperImpl::convertTimeFilter( rValue ) ); + xAnimate->setTimeFilter( AnimationsImportHelperImpl::convertTimeFilter( aIter.toString() ) ); } break; @@ -913,7 +912,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimateMotion > xAnimateMotion( mxNode, UNO_QUERY ); if( xAnimateMotion.is() ) - xAnimateMotion->setPath( AnimationsImportHelperImpl::convertPath( rValue ) ); + xAnimateMotion->setPath( AnimationsImportHelperImpl::convertPath( aIter.toString() ) ); } break; @@ -923,7 +922,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimatePhysics > xAnimatePhysics( mxNode, UNO_QUERY ); if( xAnimatePhysics.is() ) - xAnimatePhysics->setStartVelocityX( makeAny(rValue.toDouble()) ); + xAnimatePhysics->setStartVelocityX( makeAny(aIter.toDouble()) ); } break; @@ -933,7 +932,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimatePhysics > xAnimatePhysics( mxNode, UNO_QUERY ); if( xAnimatePhysics.is() ) - xAnimatePhysics->setStartVelocityY( makeAny(rValue.toDouble()) ); + xAnimatePhysics->setStartVelocityY( makeAny(aIter.toDouble()) ); } break; @@ -943,7 +942,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimatePhysics > xAnimatePhysics( mxNode, UNO_QUERY ); if( xAnimatePhysics.is() ) - xAnimatePhysics->setDensity( makeAny(rValue.toDouble()) ); + xAnimatePhysics->setDensity( makeAny(aIter.toDouble()) ); } break; @@ -953,7 +952,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimatePhysics > xAnimatePhysics( mxNode, UNO_QUERY ); if( xAnimatePhysics.is() ) - xAnimatePhysics->setBounciness( makeAny(rValue.toDouble()) ); + xAnimatePhysics->setBounciness( makeAny(aIter.toDouble()) ); } break; @@ -962,7 +961,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimateColor > xAnimateColor( mxNode, UNO_QUERY ); if( xAnimateColor.is() ) - xAnimateColor->setColorInterpolation( IsXMLToken( rValue, XML_HSL ) ? AnimationColorSpace::HSL : AnimationColorSpace::RGB ); + xAnimateColor->setColorInterpolation( IsXMLToken( aIter, XML_HSL ) ? AnimationColorSpace::HSL : AnimationColorSpace::RGB ); } break; @@ -971,7 +970,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { Reference< XAnimateColor > xAnimateColor( mxNode, UNO_QUERY ); if( xAnimateColor.is() ) - xAnimateColor->setDirection( IsXMLToken( rValue, XML_CLOCKWISE ) ); + xAnimateColor->setDirection( IsXMLToken( aIter, XML_CLOCKWISE ) ); } break; @@ -981,7 +980,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: Reference< XAnimateTransform > xTransform( mxNode, UNO_QUERY ); if( xTransform.is() ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_TransformType ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_TransformType ) ) { xTransform->setTransformType( nEnum ); switch( nEnum ) @@ -1005,7 +1004,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xTransitionFilter.is() ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_TransitionType ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_TransitionType ) ) xTransitionFilter->setTransition( nEnum ); } } @@ -1017,7 +1016,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xTransitionFilter.is() ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_TransitionSubType ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_TransitionSubType ) ) xTransitionFilter->setSubtype( nEnum ); } } @@ -1028,7 +1027,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_MODE): { if( xTransitionFilter.is() ) - xTransitionFilter->setMode( IsXMLToken( rValue, XML_IN ) ); + xTransitionFilter->setMode( IsXMLToken( aIter, XML_IN ) ); } break; @@ -1037,7 +1036,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(SMIL_SO52, XML_DIRECTION): { if( xTransitionFilter.is() ) - xTransitionFilter->setDirection( IsXMLToken( rValue, XML_FORWARD ) ); + xTransitionFilter->setDirection( IsXMLToken( aIter, XML_FORWARD ) ); } break; @@ -1048,7 +1047,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( xTransitionFilter.is() ) { sal_Int32 nColor(0); - ::sax::Converter::convertColor(nColor, rValue); + ::sax::Converter::convertColor(nColor, aIter.toView()); xTransitionFilter->setFadeColor(nColor); } } @@ -1057,7 +1056,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(ANIMATION, XML_ITERATE_TYPE): case XML_ELEMENT(ANIMATION_OOO, XML_ITERATE_TYPE): { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_IterateType ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_IterateType ) ) { if( xIter.is() ) xIter->setIterateType( nEnum ); @@ -1070,6 +1069,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xIter.is() ) { + OUString rValue = aIter.toString(); double fInterval = 0.0; if( rValue.match("P") ) { @@ -1083,7 +1083,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: } else { - fInterval = rValue.toDouble(); + fInterval = aIter.toDouble(); } xIter->setIterateInterval( fInterval ); @@ -1095,7 +1095,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case XML_ELEMENT(PRESENTATION_SO52, XML_GROUP_ID): case XML_ELEMENT(PRESENTATION_OOO, XML_GROUP_ID): { - aUserData.emplace_back( "group-id", makeAny( rValue.toInt32() ) ); + aUserData.emplace_back( "group-id", makeAny( aIter.toInt32() ) ); } break; @@ -1104,7 +1104,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xCommand.is() && nNodeType == AnimationNodeType::COMMAND ) { - if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Command ) ) + if( SvXMLUnitConverter::convertEnum( nEnum, aIter.toString(), aAnimations_EnumMap_Command ) ) { xCommand->setCommand( nEnum ); } @@ -1120,11 +1120,10 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: || IsTokenInNamespace(nToken, XML_NAMESPACE_PRESENTATION_OASIS) || IsTokenInNamespace(nToken, XML_NAMESPACE_PRESENTATION_OOO)) { - aUserData.emplace_back( SvXMLImport::getNameFromToken(aIter.getToken()), makeAny( rValue ) ); + aUserData.emplace_back( SvXMLImport::getNameFromToken(aIter.getToken()), makeAny( aIter.toString() ) ); } else - SAL_WARN("xmloff", "unknown token '" + SvXMLImport::getNameFromToken(aIter.getToken()) - << "' 0x" << std::hex << aIter.getToken()); + XMLOFF_WARN_UNKNOWN("xmloff", aIter); } } } diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 89cf45a375404..ca6d6cb284509 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -395,14 +395,13 @@ XMLAnimationsSoundContext::XMLAnimationsSoundContext( SvXMLImport& rImport, sal_ for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(XLINK, XML_HREF): - pParent->maSoundURL = rImport.GetAbsoluteReference(sValue); + pParent->maSoundURL = rImport.GetAbsoluteReference(aIter.toString()); break; case XML_ELEMENT(PRESENTATION, XML_PLAY_FULL): - pParent->mbPlayFull = IsXMLToken( sValue, XML_TRUE ); + pParent->mbPlayFull = IsXMLToken( aIter, XML_TRUE ); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); @@ -450,34 +449,33 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(DRAW, XML_SHAPE_ID): - maShapeId = sValue; + maShapeId = aIter.toString(); break; case XML_ELEMENT(DRAW, XML_COLOR): - ::sax::Converter::convertColor(maDimColor, sValue); + ::sax::Converter::convertColor(maDimColor, aIter.toString()); break; case XML_ELEMENT(PRESENTATION, XML_EFFECT): - SvXMLUnitConverter::convertEnum( meEffect, sValue, aXML_AnimationEffect_EnumMap ); + SvXMLUnitConverter::convertEnum( meEffect, aIter.toString(), aXML_AnimationEffect_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_DIRECTION): - SvXMLUnitConverter::convertEnum( meDirection, sValue, aXML_AnimationDirection_EnumMap ); + SvXMLUnitConverter::convertEnum( meDirection, aIter.toString(), aXML_AnimationDirection_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_START_SCALE): { sal_Int32 nScale; - if (::sax::Converter::convertPercent( nScale, sValue )) + if (::sax::Converter::convertPercent( nScale, aIter.toView() )) mnStartScale = static_cast<sal_Int16>(nScale); break; } case XML_ELEMENT(PRESENTATION, XML_SPEED): - SvXMLUnitConverter::convertEnum( meSpeed, sValue, aXML_AnimationSpeed_EnumMap ); + SvXMLUnitConverter::convertEnum( meSpeed, aIter.toString(), aXML_AnimationSpeed_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_PATH_ID): - maPathShapeId = sValue; + maPathShapeId = aIter.toString(); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index c71c71043cc29..2f90ed9e5e6cc 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -106,14 +106,13 @@ XMLEventSoundContext::XMLEventSoundContext( SvXMLImport& rImp, const Reference< { for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString sValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(XLINK, XML_HREF): - pParent->maData.msSoundURL = rImp.GetAbsoluteReference(sValue); + pParent->maData.msSoundURL = rImp.GetAbsoluteReference(aIter.toString()); break; case XML_ELEMENT(PRESENTATION, XML_PLAY_FULL): - pParent->maData.mbPlayFull = IsXMLToken( sValue, XML_TRUE ); + pParent->maData.mbPlayFull = IsXMLToken( aIter, XML_TRUE ); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); @@ -145,36 +144,35 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, OUString sEventName; for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString sValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(PRESENTATION, XML_ACTION): - SvXMLUnitConverter::convertEnum( maData.meClickAction, sValue, aXML_EventActions_EnumMap ); + SvXMLUnitConverter::convertEnum( maData.meClickAction, aIter.toString(), aXML_EventActions_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_EFFECT): - SvXMLUnitConverter::convertEnum( maData.meEffect, sValue, aXML_AnimationEffect_EnumMap ); + SvXMLUnitConverter::convertEnum( maData.meEffect, aIter.toString(), aXML_AnimationEffect_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_DIRECTION): - SvXMLUnitConverter::convertEnum( maData.meDirection, sValue, aXML_AnimationDirection_EnumMap ); + SvXMLUnitConverter::convertEnum( maData.meDirection, aIter.toString(), aXML_AnimationDirection_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_START_SCALE): { sal_Int32 nScale; - if (::sax::Converter::convertPercent( nScale, sValue )) + if (::sax::Converter::convertPercent( nScale, aIter.toView() )) maData.mnStartScale = static_cast<sal_Int16>(nScale); } break; case XML_ELEMENT(PRESENTATION, XML_SPEED): - SvXMLUnitConverter::convertEnum( maData.meSpeed, sValue, aXML_AnimationSpeed_EnumMap ); + SvXMLUnitConverter::convertEnum( maData.meSpeed, aIter.toString(), aXML_AnimationSpeed_EnumMap ); break; case XML_ELEMENT(PRESENTATION, XML_VERB): - ::sax::Converter::convertNumber( maData.mnVerb, sValue ); + ::sax::Converter::convertNumber( maData.mnVerb, aIter.toView() ); break; case XML_ELEMENT(SCRIPT, XML_EVENT_NAME): { - sEventName = sValue; + sEventName = aIter.toString(); sal_uInt16 nScriptPrefix = - GetImport().GetNamespaceMap().GetKeyByAttrValueQName(sValue, &sEventName); + GetImport().GetNamespaceMap().GetKeyByAttrValueQName(sEventName, &sEventName); maData.mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == "click"; } break; @@ -182,7 +180,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, { // language is not evaluated! OUString aScriptLanguage; - maData.msLanguage = sValue; + maData.msLanguage = aIter.toString(); sal_uInt16 nScriptPrefix = rImp.GetNamespaceMap(). GetKeyByAttrValueQName(maData.msLanguage, &aScriptLanguage); if( XML_NAMESPACE_OOO == nScriptPrefix ) @@ -190,18 +188,18 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, } break; case XML_ELEMENT(SCRIPT, XML_MACRO_NAME): - maData.msMacroName = sValue; + maData.msMacroName = aIter.toString(); break; case XML_ELEMENT(XLINK, XML_HREF): { if ( maData.mbScript ) { - maData.msMacroName = sValue; + maData.msMacroName = aIter.toString(); } else { const OUString &rTmp = - rImp.GetAbsoluteReference(sValue); + rImp.GetAbsoluteReference(aIter.toString()); INetURLObject::translateToInternal( rTmp, maData.msBookmark, INetURLObject::DecodeMechanism::Unambiguous ); } diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx index abe34189c90db..c17defc2426b5 100644 --- a/xmloff/source/draw/ximp3dobject.cxx +++ b/xmloff/source/draw/ximp3dobject.cxx @@ -97,14 +97,12 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( { for(auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - OUString sValue = aIter.toString(); - switch(aIter.getToken()) { case XML_ELEMENT(DR3D, XML_MIN_EDGE): { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, sValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maMinEdge) maMinEdge = aNewVec; @@ -113,7 +111,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( case XML_ELEMENT(DR3D, XML_MAX_EDGE): { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, sValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maMaxEdge) maMaxEdge = aNewVec; @@ -176,14 +174,12 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( { for(auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { - OUString sValue = aIter.toString(); - switch(aIter.getToken()) { case XML_ELEMENT(DR3D, XML_CENTER): { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, sValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maCenter) maCenter = aNewVec; @@ -192,7 +188,7 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( case XML_ELEMENT(DR3D, XML_SIZE): { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, sValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maSphereSize) maSphereSize = aNewVec; diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index 9477481343e87..29a13ba961b3c 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -49,36 +49,35 @@ SdXML3DLightContext::SdXML3DLightContext( // read attributes for the 3DScene for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString sValue = aIter.toString(); switch(aIter.getToken()) { case XML_ELEMENT(DR3D, XML_DIFFUSE_COLOR): { - ::sax::Converter::convertColor(maDiffuseColor, sValue); + ::sax::Converter::convertColor(maDiffuseColor, aIter.toString()); break; } case XML_ELEMENT(DR3D, XML_DIRECTION): { ::basegfx::B3DVector aVal; - SvXMLUnitConverter::convertB3DVector(aVal, sValue); + SvXMLUnitConverter::convertB3DVector(aVal, aIter.toString()); if (!std::isnan(aVal.getX()) && !std::isnan(aVal.getY()) && !std::isnan(aVal.getZ())) { maDirection = aVal; } else { - SAL_WARN("xmloff", "NaNs found in light direction: " << sValue); + SAL_WARN("xmloff", "NaNs found in light direction: " << aIter.toString()); } break; } case XML_ELEMENT(DR3D, XML_ENABLED): { - (void)::sax::Converter::convertBool(mbEnabled, sValue); + (void)::sax::Converter::convertBool(mbEnabled, aIter.toView()); break; } case XML_ELEMENT(DR3D, XML_SPECULAR): { - (void)::sax::Converter::convertBool(mbSpecular, sValue); + (void)::sax::Converter::convertBool(mbSpecular, aIter.toView()); break; } default: diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 8e23b0ee844f0..f53c513d7e269 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -72,7 +72,7 @@ const SvXMLEnumMapEntry<sal_uInt16> aXML_GluePointEnumMap[] = { XML_TOKEN_INVALID, 0 } }; static void GetBool( std::vector< css::beans::PropertyValue >& rDest, - std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { bool bAttrBool; if (::sax::Converter::convertBool( bAttrBool, rValue )) @@ -85,7 +85,7 @@ static void GetBool( std::vector< css::beans::PropertyValue >& rDest, } static void GetInt32( std::vector< css::beans::PropertyValue >& rDest, - std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int32 nAttrNumber; if (::sax::Converter::convertNumber( nAttrNumber, rValue )) @@ -98,7 +98,7 @@ static void GetInt32( std::vector< css::beans::PropertyValue >& rDest, } static void GetDouble( std::vector< css::beans::PropertyValue >& rDest, - std::u16string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { double fAttrDouble; if (::sax::Converter::convertDouble( fAttrDouble, rValue )) @@ -135,7 +135,7 @@ static void GetEnum( std::vector< css::beans::PropertyValue >& rDest, } static void GetDoublePercentage( std::vector< css::beans::PropertyValue >& rDest, - const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { sal_Int16 const eSrcUnit = ::sax::Converter::GetUnitFromString( rValue, util::MeasureUnit::MM_100TH); @@ -155,7 +155,7 @@ static void GetDoublePercentage( std::vector< css::beans::PropertyValue >& rDest } static void GetB3DVector( std::vector< css::beans::PropertyValue >& rDest, - const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { ::basegfx::B3DVector aB3DVector; if ( SvXMLUnitConverter::convertB3DVector( aB3DVector, rValue ) ) @@ -424,7 +424,7 @@ static bool GetNextParameter( css::drawing::EnhancedCustomShapeParameter& rParam } static void GetPosition3D( std::vector< css::beans::PropertyValue >& rDest, // e.g. draw:extrusion-viewpoint - const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, + std::string_view rValue, const EnhancedCustomShapeTokenEnum eDestProp, SvXMLUnitConverter& rUnitConverter ) { drawing::Position3D aPosition3D; @@ -866,22 +866,20 @@ void XMLEnhancedCustomShapeContext::startFastElement( sal_Int32 nAttrNumber; for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString rValue = aIter.toString(); - switch( EASGet( aIter.getToken() ) ) { case EAS_type : - GetString( mrCustomShapeGeometry, rValue, EAS_Type ); + GetString( mrCustomShapeGeometry, aIter.toString(), EAS_Type ); break; case EAS_mirror_horizontal : - GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredX ); + GetBool( mrCustomShapeGeometry, aIter.toView(), EAS_MirroredX ); break; case EAS_mirror_vertical : - GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredY ); + GetBool( mrCustomShapeGeometry, aIter.toView(), EAS_MirroredY ); break; case EAS_viewBox : { - SdXMLImExViewBox aViewBox( rValue, GetImport().GetMM100UnitConverter() ); + SdXMLImExViewBox aViewBox( aIter.toString(), GetImport().GetMM100UnitConverter() ); awt::Rectangle aRect( aViewBox.GetX(), aViewBox.GetY(), aViewBox.GetWidth(), aViewBox.GetHeight() ); beans::PropertyValue aProp; aProp.Name = EASGet( EAS_ViewBox ); @@ -890,28 +888,29 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_sub_view_size: - GetSizeSequence( maPath, rValue, EAS_SubViewSize ); + GetSizeSequence( maPath, aIter.toString(), EAS_SubViewSize ); break; case EAS_text_rotate_angle : - GetDouble( mrCustomShapeGeometry, rValue, EAS_TextRotateAngle ); + GetDouble( mrCustomShapeGeometry, aIter.toView(), EAS_TextRotateAngle ); break; case EAS_extrusion_allowed : - GetBool( maPath, rValue, EAS_ExtrusionAllowed ); + GetBool( maPath, aIter.toView(), EAS_ExtrusionAllowed ); break; case EAS_text_path_allowed : - GetBool( maPath, rValue, EAS_TextPathAllowed ); + GetBool( maPath, aIter.toView(), EAS_TextPathAllowed ); break; case EAS_concentric_gradient_fill_allowed : - GetBool( maPath, rValue, EAS_ConcentricGradientFillAllowed ); + GetBool( maPath, aIter.toView(), EAS_ConcentricGradientFillAllowed ); break; case EAS_extrusion : - GetBool( maExtrusion, rValue, EAS_Extrusion ); + GetBool( maExtrusion, aIter.toView(), EAS_Extrusion ); break; case EAS_extrusion_brightness : - GetDoublePercentage( maExtrusion, rValue, EAS_Brightness ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_Brightness ); break; case EAS_extrusion_depth : { + OUString rValue = aIter.toString(); sal_Int32 nIndex = 0; css::drawing::EnhancedCustomShapeParameterPair aParameterPair; css::drawing::EnhancedCustomShapeParameter& rDepth = aParameterPair.First; @@ -953,43 +952,43 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_extrusion_diffusion : - GetDoublePercentage( maExtrusion, rValue, EAS_Diffusion ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_Diffusion ); break; case EAS_extrusion_number_of_line_segments : - GetInt32( maExtrusion, rValue, EAS_NumberOfLineSegments ); + GetInt32( maExtrusion, aIter.toView(), EAS_NumberOfLineSegments ); break; case EAS_extrusion_light_face : - GetBool( maExtrusion, rValue, EAS_LightFace ); + GetBool( maExtrusion, aIter.toView(), EAS_LightFace ); break; case EAS_extrusion_first_light_harsh : - GetBool( maExtrusion, rValue, EAS_FirstLightHarsh ); + GetBool( maExtrusion, aIter.toView(), EAS_FirstLightHarsh ); break; case EAS_extrusion_second_light_harsh : - GetBool( maExtrusion, rValue, EAS_SecondLightHarsh ); + GetBool( maExtrusion, aIter.toView(), EAS_SecondLightHarsh ); break; case EAS_extrusion_first_light_level : - GetDoublePercentage( maExtrusion, rValue, EAS_FirstLightLevel ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_FirstLightLevel ); break; case EAS_extrusion_second_light_level : - GetDoublePercentage( maExtrusion, rValue, EAS_SecondLightLevel ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_SecondLightLevel ); break; case EAS_extrusion_first_light_direction : - GetB3DVector( maExtrusion, rValue, EAS_FirstLightDirection ); + GetB3DVector( maExtrusion, aIter.toView(), EAS_FirstLightDirection ); break; case EAS_extrusion_second_light_direction : - GetB3DVector( maExtrusion, rValue, EAS_SecondLightDirection ); + GetB3DVector( maExtrusion, aIter.toView(), EAS_SecondLightDirection ); break; case EAS_extrusion_metal : - GetBool( maExtrusion, rValue, EAS_Metal ); + GetBool( maExtrusion, aIter.toView(), EAS_Metal ); break; case EAS_shade_mode : { drawing::ShadeMode eShadeMode( drawing::ShadeMode_FLAT ); - if( IsXMLToken( rValue, XML_PHONG ) ) + if( IsXMLToken( aIter, XML_PHONG ) ) eShadeMode = drawing::ShadeMode_PHONG; - else if ( IsXMLToken( rValue, XML_GOURAUD ) ) + else if ( IsXMLToken( aIter, XML_GOURAUD ) ) eShadeMode = drawing::ShadeMode_SMOOTH; - else if ( IsXMLToken( rValue, XML_DRAFT ) ) + else if ( IsXMLToken( aIter, XML_DRAFT ) ) eShadeMode = drawing::ShadeMode_DRAFT; beans::PropertyValue aProp; @@ -999,24 +998,24 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_extrusion_rotation_angle : - GetEnhancedParameterPair( maExtrusion, rValue, EAS_RotateAngle ); + GetEnhancedParameterPair( maExtrusion, aIter.toString(), EAS_RotateAngle ); break; case EAS_extrusion_rotation_center : - GetB3DVector( maExtrusion, rValue, EAS_RotationCenter ); + GetB3DVector( maExtrusion, aIter.toView(), EAS_RotationCenter ); break; case EAS_extrusion_shininess : - GetDoublePercentage( maExtrusion, rValue, EAS_Shininess ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_Shininess ); break; case EAS_extrusion_skew : - GetEnhancedParameterPair( maExtrusion, rValue, EAS_Skew ); + GetEnhancedParameterPair( maExtrusion, aIter.toString(), EAS_Skew ); break; case EAS_extrusion_specularity : - GetDoublePercentage( maExtrusion, rValue, EAS_Specularity ); + GetDoublePercentage( maExtrusion, aIter.toView(), EAS_Specularity ); break; case EAS_projection : { drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PERSPECTIVE ); - if( IsXMLToken( rValue, XML_PARALLEL ) ) + if( IsXMLToken( aIter, XML_PARALLEL ) ) eProjectionMode = drawing::ProjectionMode_PARALLEL; beans::PropertyValue aProp; @@ -1026,20 +1025,20 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_extrusion_viewpoint : - GetPosition3D( maExtrusion, rValue, EAS_ViewPoint, mrUnitConverter ); + GetPosition3D( maExtrusion, aIter.toView(), EAS_ViewPoint, mrUnitConverter ); break; case EAS_extrusion_origin : - GetEnhancedParameterPair( maExtrusion, rValue, EAS_Origin ); + GetEnhancedParameterPair( maExtrusion, aIter.toString(), EAS_Origin ); break; case EAS_extrusion_color : - GetBool( maExtrusion, rValue, EAS_Color ); + GetBool( maExtrusion, aIter.toView(), EAS_Color ); break; case EAS_enhanced_path : - GetEnhancedPath( maPath, rValue ); + GetEnhancedPath( maPath, aIter.toString() ); break; case EAS_path_stretchpoint_x : { - if (::sax::Converter::convertNumber(nAttrNumber, rValue)) + if (::sax::Converter::convertNumber(nAttrNumber, aIter.toView())) { beans::PropertyValue aProp; aProp.Name = EASGet( EAS_StretchX ); @@ -1050,7 +1049,7 @@ void XMLEnhancedCustomShapeContext::startFastElement( break; case EAS_path_stretchpoint_y : { - if (::sax::Converter::convertNumber(nAttrNumber, rValue)) + if (::sax::Converter::convertNumber(nAttrNumber, aIter.toView())) { beans::PropertyValue aProp; aProp.Name = EASGet( EAS_StretchY ); @@ -1060,31 +1059,31 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_text_areas : - GetEnhancedRectangleSequence( maPath, rValue, EAS_TextFrames ); + GetEnhancedRectangleSequence( maPath, aIter.toString(), EAS_TextFrames ); break; case EAS_glue_points : { - sal_Int32 i, nPairs = GetEnhancedParameterPairSequence( maPath, rValue, EAS_GluePoints ); + sal_Int32 i, nPairs = GetEnhancedParameterPairSequence( maPath, aIter.toString(), EAS_GluePoints ); GetImport().GetShapeImport()->moveGluePointMapping( mrxShape, nPairs ); for ( i = 0; i < nPairs; i++ ) GetImport().GetShapeImport()->addGluePointMapping( mrxShape, i + 4, i + 4 ); } break; case EAS_glue_point_type : - GetEnum( maPath, rValue, EAS_GluePointType, *aXML_GluePointEnumMap ); + GetEnum( maPath, aIter.toString(), EAS_GluePointType, *aXML_GluePointEnumMap ); break; case EAS_glue_point_leaving_directions : - GetDoubleSequence( maPath, rValue, EAS_GluePointLeavingDirections ); + GetDoubleSequence( maPath, aIter.toString(), EAS_GluePointLeavingDirections ); break; case EAS_text_path : - GetBool( maTextPath, rValue, EAS_TextPath ); + GetBool( maTextPath, aIter.toView(), EAS_TextPath ); break; case EAS_text_path_mode : { css::drawing::EnhancedCustomShapeTextPathMode eTextPathMode( css::drawing::EnhancedCustomShapeTextPathMode_NORMAL ); - if( IsXMLToken( rValue, XML_PATH ) ) + if( IsXMLToken( aIter, XML_PATH ) ) eTextPathMode = css::drawing::EnhancedCustomShapeTextPathMode_PATH; - else if ( IsXMLToken( rValue, XML_SHAPE ) ) + else if ( IsXMLToken( aIter, XML_SHAPE ) ) eTextPathMode = css::drawing::EnhancedCustomShapeTextPathMode_SHAPE; beans::PropertyValue aProp; @@ -1095,7 +1094,7 @@ void XMLEnhancedCustomShapeContext::startFastElement( break; case EAS_text_path_scale : { - bool bScaleX = IsXMLToken( rValue, XML_SHAPE ); + bool bScaleX = IsXMLToken( aIter, XML_SHAPE ); beans::PropertyValue aProp; aProp.Name = EASGet( EAS_ScaleX ); aProp.Value <<= bScaleX; @@ -1103,10 +1102,10 @@ void XMLEnhancedCustomShapeContext::startFastElement( } break; case EAS_text_path_same_letter_heights : - GetBool( maTextPath, rValue, EAS_SameLetterHeights ); + GetBool( maTextPath, aIter.toView(), EAS_SameLetterHeights ); break; case EAS_modifiers : - GetAdjustmentValues( mrCustomShapeGeometry, rValue ); + GetAdjustmentValues( mrCustomShapeGeometry, aIter.toString() ); break; default: break; @@ -1329,41 +1328,40 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLEnhancedCustomShape std::vector< css::beans::PropertyValue > aHandle; for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString sValue = aIter.toString(); switch( EASGet( aIter.getToken() ) ) { case EAS_handle_mirror_vertical : - GetBool( aHandle, sValue, EAS_MirroredY ); + GetBool( aHandle, aIter.toView(), EAS_MirroredY ); break; case EAS_handle_mirror_horizontal : - GetBool( aHandle, sValue, EAS_MirroredX ); + GetBool( aHandle, aIter.toView(), EAS_MirroredX ); break; case EAS_handle_switched : - GetBool( aHandle, sValue, EAS_Switched ); + GetBool( aHandle, aIter.toView(), EAS_Switched ); break; case EAS_handle_position : - GetEnhancedParameterPair( aHandle, sValue, EAS_Position ); + GetEnhancedParameterPair( aHandle, aIter.toString(), EAS_Position ); break; case EAS_handle_range_x_minimum : - GetEnhancedParameter( aHandle, sValue, EAS_RangeXMinimum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RangeXMinimum ); break; case EAS_handle_range_x_maximum : - GetEnhancedParameter( aHandle, sValue, EAS_RangeXMaximum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RangeXMaximum ); break; case EAS_handle_range_y_minimum : - GetEnhancedParameter( aHandle, sValue, EAS_RangeYMinimum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RangeYMinimum ); break; case EAS_handle_range_y_maximum : - GetEnhancedParameter( aHandle, sValue, EAS_RangeYMaximum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RangeYMaximum ); break; case EAS_handle_polar : - GetEnhancedParameterPair( aHandle, sValue, EAS_Polar ); + GetEnhancedParameterPair( aHandle, aIter.toString(), EAS_Polar ); break; case EAS_handle_radius_range_minimum : - GetEnhancedParameter( aHandle, sValue, EAS_RadiusRangeMinimum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RadiusRangeMinimum ); break; case EAS_handle_radius_range_maximum : - GetEnhancedParameter( aHandle, sValue, EAS_RadiusRangeMaximum ); + GetEnhancedParameter( aHandle, aIter.toString(), EAS_RadiusRangeMaximum ); break; default: break; diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index b9492b96a7768..2ddd5140545f4 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -92,8 +92,6 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); - switch( aIter.getToken() ) { case XML_ELEMENT(SVG, XML_X): @@ -101,7 +99,7 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere { sal_Int32 x; GetImport().GetMM100UnitConverter().convertMeasureToCore( - x, sValue); + x, aIter.toView()); aPosition.X = static_cast<double>(x) / 100.0; break; } @@ -110,7 +108,7 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere { sal_Int32 y; GetImport().GetMM100UnitConverter().convertMeasureToCore( - y, sValue); + y, aIter.toView()); aPosition.Y = static_cast<double>(y) / 100.0; break; } @@ -119,7 +117,7 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere { sal_Int32 w; GetImport().GetMM100UnitConverter().convertMeasureToCore( - w, sValue); + w, aIter.toView()); aSize.Width = static_cast<double>(w) / 100.0; break; } @@ -128,7 +126,7 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere { sal_Int32 h; GetImport().GetMM100UnitConverter().convertMeasureToCore( - h, sValue); + h, aIter.toView()); aSize.Height = static_cast<double>(h) / 100.0; } break; diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 5ae4680332ae0..cabf4aa460a10 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3420,7 +3420,7 @@ void SdXMLFrameShapeContext::endFastElement(sal_Int32 nElement) switch (aIter.getToken()) { case XML_ELEMENT(PRESENTATION, XML_PLACEHOLDER): - mbIsPlaceholder = IsXMLToken( aIter.toString(), XML_TRUE ); + mbIsPlaceholder = IsXMLToken( aIter, XML_TRUE ); break; case XML_ELEMENT(PRESENTATION, XML_CLASS): maPresentationClass = aIter.toString(); diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx index 0e227d9cfa640..4fba11fd380a0 100644 --- a/xmloff/source/draw/ximpshow.cxx +++ b/xmloff/source/draw/ximpshow.cxx @@ -77,26 +77,24 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFa // read attributes for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); - switch( aIter.getToken() ) { case XML_ELEMENT(PRESENTATION, XML_START_PAGE): { - mxPresProps->setPropertyValue("FirstPage", Any(sValue) ); + mxPresProps->setPropertyValue("FirstPage", Any(aIter.toString()) ); bAll = false; break; } case XML_ELEMENT(PRESENTATION, XML_SHOW): { - maCustomShowName = sValue; + maCustomShowName = aIter.toString(); bAll = false; break; } case XML_ELEMENT(PRESENTATION, XML_PAUSE): { Duration aDuration; - if (!::sax::Converter::convertDuration(aDuration, sValue)) + if (!::sax::Converter::convertDuration(aDuration, aIter.toString())) continue; const sal_Int32 nMS = (aDuration.Hours * 60 + @@ -106,60 +104,60 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, const Reference< XFa } case XML_ELEMENT(PRESENTATION, XML_ANIMATIONS): { - aAny <<= IsXMLToken( sValue, XML_ENABLED ); + aAny <<= IsXMLToken( aIter, XML_ENABLED ); mxPresProps->setPropertyValue("AllowAnimations", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_STAY_ON_TOP): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("IsAlwaysOnTop", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_FORCE_MANUAL): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("IsAutomatic", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_ENDLESS): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("IsEndless", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_FULL_SCREEN): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("IsFullScreen", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_MOUSE_VISIBLE): { - bIsMouseVisible = IsXMLToken( sValue, XML_TRUE ); + bIsMouseVisible = IsXMLToken( aIter, XML_TRUE ); break; } case XML_ELEMENT(PRESENTATION, XML_START_WITH_NAVIGATOR): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("StartWithNavigator", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_MOUSE_AS_PEN): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("UsePen", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_TRANSITION_ON_CLICK): { - aAny <<= IsXMLToken( sValue, XML_ENABLED ); + aAny <<= IsXMLToken( aIter, XML_ENABLED ); mxPresProps->setPropertyValue("IsTransitionOnClick", aAny ); break; } case XML_ELEMENT(PRESENTATION, XML_SHOW_LOGO): { - aAny <<= IsXMLToken( sValue, XML_TRUE ); + aAny <<= IsXMLToken( aIter, XML_TRUE ); mxPresProps->setPropertyValue("IsShowLogo", aAny ); break; } diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index ee2c51add4bbe..ac23bc3345a2c 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -294,54 +294,53 @@ SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext( for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); switch(aIter.getToken()) { case XML_ELEMENT(FO, XML_MARGIN_TOP): case XML_ELEMENT(FO_COMPAT, XML_MARGIN_TOP): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnBorderTop, sValue); + mnBorderTop, aIter.toView()); break; } case XML_ELEMENT(FO, XML_MARGIN_BOTTOM): case XML_ELEMENT(FO_COMPAT, XML_MARGIN_BOTTOM): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnBorderBottom, sValue); + mnBorderBottom, aIter.toView()); break; } case XML_ELEMENT(FO, XML_MARGIN_LEFT): case XML_ELEMENT(FO_COMPAT, XML_MARGIN_LEFT): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnBorderLeft, sValue); + mnBorderLeft, aIter.toView()); break; } case XML_ELEMENT(FO, XML_MARGIN_RIGHT): case XML_ELEMENT(FO_COMPAT, XML_MARGIN_RIGHT): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnBorderRight, sValue); + mnBorderRight, aIter.toView()); break; } case XML_ELEMENT(FO, XML_PAGE_WIDTH): case XML_ELEMENT(FO_COMPAT, XML_PAGE_WIDTH): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnWidth, sValue); + mnWidth, aIter.toView()); break; } case XML_ELEMENT(FO, XML_PAGE_HEIGHT): case XML_ELEMENT(FO_COMPAT, XML_PAGE_HEIGHT): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnHeight, sValue); + mnHeight, aIter.toView()); break; } case XML_ELEMENT(STYLE, XML_PRINT_ORIENTATION): { - if( IsXMLToken( sValue, XML_PORTRAIT ) ) + if( IsXMLToken( aIter, XML_PORTRAIT ) ) meOrientation = view::PaperOrientation_PORTRAIT; else meOrientation = view::PaperOrientation_LANDSCAPE; @@ -633,19 +632,18 @@ SdXMLPresentationPlaceholderContext::SdXMLPresentationPlaceholderContext( { for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); switch(aIter.getToken()) { case XML_ELEMENT(PRESENTATION, XML_OBJECT): { - msName = sValue; + msName = aIter.toString(); break; } case XML_ELEMENT(SVG, XML_X): case XML_ELEMENT(SVG_COMPAT, XML_X): { GetSdImport().GetMM100UnitConverter().convertMeasureToCore( - mnX, sValue); + mnX, aIter.toView()); break; } case XML_ELEMENT(SVG, XML_Y): @@ -1373,18 +1371,17 @@ SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext(SvXMLImport& rImport, { for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList )) { - OUString sValue = aIter.toString(); if( aIter.getToken() == XML_ELEMENT(PRESENTATION, XML_NAME) ) { - maStrName = sValue; + maStrName = aIter.toString(); } else if( aIter.getToken() == XML_ELEMENT(PRESENTATION, XML_SOURCE) ) { - mbFixed = IsXMLToken( sValue, XML_FIXED ); + mbFixed = IsXMLToken( aIter, XML_FIXED ); } else if( aIter.getToken() == XML_ELEMENT(STYLE, XML_DATA_STYLE_NAME) ) { - maStrDateTimeFormat = sValue; + maStrDateTimeFormat = aIter.toString(); } else { |