merge the formfield patch from ooo-build
[ooovba.git] / xmloff / source / style / AttributeContainerHandler.cxx
blob864ddd28f097f25243de727b84f5e7f0b9859fd1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AttributeContainerHandler.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include <com/sun/star/container/XNameContainer.hpp>
34 #include <com/sun/star/xml/AttributeData.hpp>
35 #include <com/sun/star/uno/Any.hxx>
36 #include <rtl/ustrbuf.hxx>
37 #include <com/sun/star/text/GraphicCrop.hpp>
39 #include "AttributeContainerHandler.hxx"
41 using ::rtl::OUString;
42 using ::rtl::OUStringBuffer;
44 using namespace ::com::sun::star;
45 using namespace ::com::sun::star::uno;
46 using namespace ::com::sun::star::container;
48 ///////////////////////////////////////////////////////////////////////////////
50 // class XMLAttributeContainerHandler
53 XMLAttributeContainerHandler::~XMLAttributeContainerHandler()
55 // nothing to do
58 bool XMLAttributeContainerHandler::equals(
59 const Any& r1,
60 const Any& r2 ) const
62 Reference< XNameContainer > xContainer1;
63 Reference< XNameContainer > xContainer2;
65 if( ( r1 >>= xContainer1 ) && ( r2 >>= xContainer2 ) )
67 uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() );
68 uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() );
69 const sal_Int32 nCount = aAttribNames1.getLength();
71 if( aAttribNames2.getLength() == nCount )
73 const OUString* pAttribName = aAttribNames1.getConstArray();
75 xml::AttributeData aData1;
76 xml::AttributeData aData2;
78 for( sal_Int32 i=0; i < nCount; i++, pAttribName++ )
80 if( !xContainer2->hasByName( *pAttribName ) )
81 return sal_False;
83 xContainer1->getByName( *pAttribName ) >>= aData1;
84 xContainer2->getByName( *pAttribName ) >>= aData2;
86 if( ( aData1.Namespace != aData2.Namespace ) ||
87 ( aData1.Type != aData2.Type ) ||
88 ( aData1.Value != aData2.Value ) )
89 return sal_False;
92 return sal_True;
96 return sal_False;
99 sal_Bool XMLAttributeContainerHandler::importXML( const OUString& /*rStrImpValue*/, Any& /*rValue*/, const SvXMLUnitConverter& /*rUnitConverter*/ ) const
101 return sal_True;
104 sal_Bool XMLAttributeContainerHandler::exportXML( OUString& /*rStrExpValue*/, const Any& /*rValue*/, const SvXMLUnitConverter& /*rUnitConverter*/ ) const
106 return sal_True;