diff options
Diffstat (limited to 'xmloff/source/draw/ximp3dscene.cxx')
-rw-r--r-- | xmloff/source/draw/ximp3dscene.cxx | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index a31c0cec27..319e253257 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -46,16 +47,16 @@ using namespace ::xmloff::token; ////////////////////////////////////////////////////////////////////////////// // dr3d:3dlight context -SdXML3DLightContext::SdXML3DLightContext( - SvXMLImport& rImport, +SdXML3DLightContext::SdXML3DLightContext( + SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLName, + const rtl::OUString& rLName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList) : SvXMLImportContext( rImport, nPrfx, rLName), maDiffuseColor(0x00000000), maDirection(0.0, 0.0, 1.0), - mbEnabled(FALSE), - mbSpecular(FALSE) + mbEnabled(false), + mbSpecular(false) { // read attributes for the 3DScene sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -101,13 +102,13 @@ SdXML3DLightContext::~SdXML3DLightContext() TYPEINIT1( SdXML3DSceneShapeContext, SdXMLShapeContext ); -SdXML3DSceneShapeContext::SdXML3DSceneShapeContext( +SdXML3DSceneShapeContext::SdXML3DSceneShapeContext( SvXMLImport& rImport, - USHORT nPrfx, + USHORT nPrfx, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShapes) + sal_Bool bTemporaryShapes) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShapes ), SdXML3DSceneAttributesHelper( rImport ) { } @@ -124,7 +125,7 @@ void SdXML3DSceneShapeContext::StartElement(const uno::Reference< xml::sax::XAtt { // create new 3DScene shape and add it to rShapes, use it // as base for the new 3DScene import - AddShape( "com.sun.star.drawing.Shape3DSceneObject" ); + AddShape( "com.sun.star.drawing.Shape3DSceneObject" ); if( mxShape.is() ) { SetStyle(); @@ -187,7 +188,7 @@ SvXMLImportContext* SdXML3DSceneShapeContext::CreateChildContext( USHORT nPrefix SvXMLImportContext* pContext = 0L; // #i68101# - if( nPrefix == XML_NAMESPACE_SVG && + if( nPrefix == XML_NAMESPACE_SVG && (IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) { pContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape ); @@ -231,7 +232,7 @@ SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImport mnShadowSlant(0), mxShadeMode(drawing::ShadeMode_SMOOTH), maAmbientColor(0x00666666), - mbLightingMode(FALSE), + mbLightingMode(false), maVRP(0.0, 0.0, 1.0), maVPN(0.0, 0.0, 1.0), maVUP(0.0, 1.0, 0.0), @@ -244,8 +245,9 @@ SdXML3DSceneAttributesHelper::SdXML3DSceneAttributesHelper( SvXMLImport& rImport SdXML3DSceneAttributesHelper::~SdXML3DSceneAttributesHelper() { // release remembered light contexts, they are no longer needed - while(maList.Count()) - maList.Remove(maList.Count() - 1)->ReleaseRef(); + for ( size_t i = maList.size(); i > 0; ) + maList[ --i ]->ReleaseRef(); + maList.clear(); } /** creates a 3d ligth context and adds it to the internal list for later processing */ @@ -257,7 +259,7 @@ SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( sal_uIn if(pContext) { pContext->AddRef(); - maList.Insert((SdXML3DLightContext*)pContext, LIST_APPEND); + maList.push_back( (SdXML3DLightContext*)pContext ); } return pContext; @@ -291,7 +293,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co { ::basegfx::B3DVector aNewVec; mrImport.GetMM100UnitConverter().convertB3DVector(aNewVec, rValue); - + if(aNewVec != maVPN) { maVPN = aNewVec; @@ -303,7 +305,7 @@ void SdXML3DSceneAttributesHelper::processSceneAttribute( sal_uInt16 nPrefix, co { ::basegfx::B3DVector aNewVec; mrImport.GetMM100UnitConverter().convertB3DVector(aNewVec, rValue); - + if(aNewVec != maVUP) { maVUP = aNewVec; @@ -395,15 +397,15 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno aAny <<= mbLightingMode; xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DSceneTwoSidedLighting")), aAny); - if(maList.Count()) + if( !maList.empty() ) { uno::Any aAny2; uno::Any aAny3; // set lights - for(sal_uInt32 a(0L); a < maList.Count(); a++) + for( size_t a = 0; a < maList.size(); a++) { - SdXML3DLightContext* pCtx = (SdXML3DLightContext*)maList.GetObject(a); + SdXML3DLightContext* pCtx = (SdXML3DLightContext*)maList[ a ]; // set anys aAny <<= pCtx->GetDiffuseColor().GetColor(); @@ -495,3 +497,5 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno aAny <<= mxPrjMode; xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("D3DScenePerspective")), aAny); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |