Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <xmloff/xmlimp.hxx>
21 : #include "xmlimpit.hxx"
22 : #include "xmlitem.hxx"
23 :
24 : using namespace ::com::sun::star;
25 :
26 891 : SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
27 : const OUString& rLName,
28 : const uno::Reference< xml::sax::XAttributeList >& xAttrList,
29 : SfxItemSet& rISet,
30 : SvXMLImportItemMapper& rIMap,
31 : const SvXMLUnitConverter& rUnitConverter ):
32 : SvXMLImportContext( rImp, nPrfx, rLName ),
33 : rItemSet( rISet ),
34 : rIMapper( rIMap ),
35 891 : rUnitConv( rUnitConverter )
36 : {
37 : rIMap.importXML( rItemSet, xAttrList, rUnitConv,
38 891 : GetImport().GetNamespaceMap() );
39 891 : }
40 :
41 891 : SvXMLItemSetContext::~SvXMLItemSetContext()
42 : {
43 891 : }
44 :
45 184 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
46 : const OUString& rLocalName,
47 : const uno::Reference< xml::sax::XAttributeList >& xAttrList )
48 : {
49 184 : SvXMLItemMapEntriesRef xMapEntries = rIMapper.getMapEntries();
50 184 : SvXMLItemMapEntry* pEntry = xMapEntries->getByName( nPrefix, rLocalName );
51 :
52 184 : if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) )
53 : {
54 : return CreateChildContext( nPrefix, rLocalName, xAttrList,
55 184 : rItemSet, *pEntry, rUnitConv );
56 : }
57 0 : return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
58 : }
59 :
60 : /** This method is called from this instance implementation of
61 : CreateChildContext if the element matches an entry in the
62 : SvXMLImportItemMapper with the mid flag MID_SW_FLAG_ELEMENT
63 : */
64 0 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
65 : const OUString& rLocalName,
66 : const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/,
67 : SfxItemSet& /*rItemSet*/,
68 : const SvXMLItemMapEntry& /*rEntry*/,
69 : const SvXMLUnitConverter& /*rUnitConv*/ )
70 : {
71 0 : return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
72 : }
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|