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 ::rtl::OUString;
25 : using namespace ::com::sun::star;
26 :
27 19 : SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
28 : const OUString& rLName,
29 : const uno::Reference< xml::sax::XAttributeList >& xAttrList,
30 : SfxItemSet& rISet,
31 : SvXMLImportItemMapper& rIMap,
32 : const SvXMLUnitConverter& rUnitConverter ):
33 : SvXMLImportContext( rImp, nPrfx, rLName ),
34 : rItemSet( rISet ),
35 : rIMapper( rIMap ),
36 19 : rUnitConv( rUnitConverter )
37 : {
38 : rIMap.importXML( rItemSet, xAttrList, rUnitConv,
39 19 : GetImport().GetNamespaceMap() );
40 19 : }
41 :
42 19 : SvXMLItemSetContext::~SvXMLItemSetContext()
43 : {
44 19 : }
45 :
46 0 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
47 : const OUString& rLocalName,
48 : const uno::Reference< xml::sax::XAttributeList >& xAttrList )
49 : {
50 0 : SvXMLItemMapEntriesRef xMapEntries = rIMapper.getMapEntries();
51 0 : SvXMLItemMapEntry* pEntry = xMapEntries->getByName( nPrefix, rLocalName );
52 :
53 0 : if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) )
54 : {
55 : return CreateChildContext( nPrefix, rLocalName, xAttrList,
56 0 : rItemSet, *pEntry, rUnitConv );
57 : }
58 0 : return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
59 : }
60 :
61 : /** This method is called from this instance implementation of
62 : CreateChildContext if the element matches an entry in the
63 : SvXMLImportItemMapper with the mid flag MID_SW_FLAG_ELEMENT
64 : */
65 0 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
66 : const rtl::OUString& rLocalName,
67 : const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/,
68 : SfxItemSet& /*rItemSet*/,
69 : const SvXMLItemMapEntry& /*rEntry*/,
70 : const SvXMLUnitConverter& /*rUnitConv*/ )
71 : {
72 0 : return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
73 : }
74 :
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|