update dev300-m58
[ooovba.git] / sw / source / filter / xml / xmlitem.cxx
blobea07b66cf9ec4e22725d46e347b831c95595841d
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: xmlitem.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_sw.hxx"
33 #include <tools/debug.hxx>
34 #include <xmloff/xmlimp.hxx>
35 #include "xmlimpit.hxx"
36 #include "xmlitem.hxx"
38 using ::rtl::OUString;
39 using namespace ::com::sun::star;
41 SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, USHORT nPrfx,
42 const OUString& rLName,
43 const uno::Reference< xml::sax::XAttributeList >& xAttrList,
44 SfxItemSet& rISet,
45 const SvXMLImportItemMapper& rIMap,
46 const SvXMLUnitConverter& rUnitConverter ):
47 SvXMLImportContext( rImp, nPrfx, rLName ),
48 rItemSet( rISet ),
49 rIMapper( rIMap ),
50 rUnitConv( rUnitConverter )
53 rIMapper.importXML( rItemSet, xAttrList, rUnitConv,
54 GetImport().GetNamespaceMap() );
57 SvXMLItemSetContext::~SvXMLItemSetContext()
61 SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( USHORT nPrefix,
62 const OUString& rLocalName,
63 const uno::Reference< xml::sax::XAttributeList >& xAttrList )
65 SvXMLItemMapEntriesRef xMapEntries = rIMapper.getMapEntries();
66 SvXMLItemMapEntry* pEntry = xMapEntries->getByName( nPrefix, rLocalName );
68 if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) )
70 return CreateChildContext( nPrefix, rLocalName, xAttrList,
71 rItemSet, *pEntry, rUnitConv );
73 else
75 return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
79 /** This method is called from this instance implementation of
80 CreateChildContext if the element matches an entry in the
81 SvXMLImportItemMapper with the mid flag MID_SW_FLAG_ELEMENT
83 SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( USHORT nPrefix,
84 const rtl::OUString& rLocalName,
85 const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/,
86 SfxItemSet& /*rItemSet*/,
87 const SvXMLItemMapEntry& /*rEntry*/,
88 const SvXMLUnitConverter& /*rUnitConv*/ )
90 return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );