include/xmloff/shapeimport.hxx | 2 - xmloff/source/chart/SchXMLPlotAreaContext.cxx | 3 -- xmloff/source/draw/ximp3dscene.cxx | 33 +++++++++++++------------- 3 files changed, 19 insertions(+), 19 deletions(-)
New commits: commit 97e2bd837841368e5c64d7c2fed0d423b0ad4606 Author: Noel <noelgran...@gmail.com> AuthorDate: Tue Dec 15 15:05:35 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 16 08:42:53 2020 +0100 use views to parse Change-Id: I4cdf09f4ce8dc399fa5ae4620191a2ad2e7f78da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107759 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 4dc7634b651c..f40ae8eaa803 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -102,7 +102,7 @@ public: SvXMLImportContext * create3DLightContext( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList); /** this should be called for each scene attribute */ - void processSceneAttribute( sal_Int32 nAttributeToken, const OUString& rValue ); + void processSceneAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & aIter ); /** this sets the scene attributes at this propertyset */ void setSceneAttributes( const css::uno::Reference< css::beans::XPropertySet >& xPropSet ); diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 2d870e9b2f8e..b336b8b56aa1 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -214,7 +214,6 @@ void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) { - OUString aValue = aIter.toString(); switch( aIter.getToken() ) { case XML_ELEMENT(SVG, XML_X): @@ -256,7 +255,7 @@ void SchXMLPlotAreaContext::startFastElement (sal_Int32 /*nElement*/, case XML_ELEMENT(DR3D, XML_SHADE_MODE): case XML_ELEMENT(DR3D, XML_AMBIENT_COLOR): case XML_ELEMENT(DR3D, XML_LIGHTING_MODE): - maSceneImportHelper.processSceneAttribute( aIter.getToken(), aValue ); + maSceneImportHelper.processSceneAttribute( aIter ); break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index 29a13ba961b3..a925759ed4de 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -127,7 +127,7 @@ void SdXML3DSceneShapeContext::startFastElement( // read attributes for the 3DScene for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) ) - processSceneAttribute( aIter.getToken(), aIter.toString() ); + processSceneAttribute( aIter ); // #91047# call parent function is missing here, added it if(mxShape.is()) @@ -216,8 +216,9 @@ SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( const c } /** this should be called for each scene attribute */ -void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeToken, const OUString& rValue ) +void SdXML3DSceneAttributesHelper::processSceneAttribute( const sax_fastparser::FastAttributeList::FastAttributeIter & aIter ) { + auto nAttributeToken = aIter.getToken(); if( !IsTokenInNamespace(nAttributeToken, XML_NAMESPACE_DR3D) ) return; @@ -225,7 +226,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo { case XML_TRANSFORM: { - SdXMLImExTransform3D aTransform(rValue, mrImport.GetMM100UnitConverter()); + SdXMLImExTransform3D aTransform(aIter.toString(), mrImport.GetMM100UnitConverter()); if(aTransform.NeedsAction()) mbSetTransform = aTransform.GetFullHomogenTransform(mxHomMat); return; @@ -233,7 +234,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VRP: { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, rValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maVRP) { @@ -245,7 +246,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VPN: { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, rValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maVPN) { @@ -257,7 +258,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_VUP: { ::basegfx::B3DVector aNewVec; - SvXMLUnitConverter::convertB3DVector(aNewVec, rValue); + SvXMLUnitConverter::convertB3DVector(aNewVec, aIter.toView()); if(aNewVec != maVUP) { @@ -268,7 +269,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo } case XML_PROJECTION: { - if( IsXMLToken( rValue, XML_PARALLEL ) ) + if( IsXMLToken( aIter, XML_PARALLEL ) ) mxPrjMode = drawing::ProjectionMode_PARALLEL; else mxPrjMode = drawing::ProjectionMode_PERSPECTIVE; @@ -277,27 +278,27 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo case XML_DISTANCE: { mrImport.GetMM100UnitConverter().convertMeasureToCore(mnDistance, - rValue); + aIter.toView()); return; } case XML_FOCAL_LENGTH: { mrImport.GetMM100UnitConverter().convertMeasureToCore(mnFocalLength, - rValue); + aIter.toView()); return; } case XML_SHADOW_SLANT: { - ::sax::Converter::convertNumber(mnShadowSlant, rValue); + ::sax::Converter::convertNumber(mnShadowSlant, aIter.toView()); return; } case XML_SHADE_MODE: { - if( IsXMLToken( rValue, XML_FLAT ) ) + if( IsXMLToken( aIter, XML_FLAT ) ) mxShadeMode = drawing::ShadeMode_FLAT; - else if( IsXMLToken( rValue, XML_PHONG ) ) + else if( IsXMLToken( aIter, XML_PHONG ) ) mxShadeMode = drawing::ShadeMode_PHONG; - else if( IsXMLToken( rValue, XML_GOURAUD ) ) + else if( IsXMLToken( aIter, XML_GOURAUD ) ) mxShadeMode = drawing::ShadeMode_SMOOTH; else mxShadeMode = drawing::ShadeMode_DRAFT; @@ -305,16 +306,16 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_Int32 nAttributeTo } case XML_AMBIENT_COLOR: { - ::sax::Converter::convertColor(maAmbientColor, rValue); + ::sax::Converter::convertColor(maAmbientColor, aIter.toView()); return; } case XML_LIGHTING_MODE: { - (void)::sax::Converter::convertBool(mbLightingMode, rValue); + (void)::sax::Converter::convertBool(mbLightingMode, aIter.toView()); return; } default: - XMLOFF_WARN_UNKNOWN_ATTR("xmloff", nAttributeToken, rValue); + XMLOFF_WARN_UNKNOWN("xmloff", aIter); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits