LibreOffice Module sw (master)  1
xmlitem.cxx
Go to the documentation of this file.
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 
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  rUnitConv( rUnitConverter )
36 {
37  rIMap.importXML( rItemSet, xAttrList, rUnitConv,
38  GetImport().GetNamespaceMap() );
39 }
40 
42 {
43 }
44 
46  const OUString& rLocalName,
47  const uno::Reference< xml::sax::XAttributeList >& xAttrList )
48 {
50  SvXMLItemMapEntry const * pEntry = xMapEntries->getByName( nPrefix, rLocalName );
51 
52  if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) )
53  {
54  return CreateChildContext( nPrefix, rLocalName, xAttrList,
55  rItemSet, *pEntry, rUnitConv );
56  }
57  return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
58 }
59 
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  return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
72 }
73 
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvXMLItemMapEntriesRef & getMapEntries() const
Definition: xmlimpit.hxx:81
SvXMLItemSetContext(SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, SfxItemSet &rItemSet, SvXMLImportItemMapper &rIMap, const SvXMLUnitConverter &rUnitConv)
Definition: xmlitem.cxx:26
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
SvXMLImport & GetImport()
void importXML(SfxItemSet &rSet, css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrList, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
fills the given itemset with the attributes in the given list
Definition: xmlimpit.cxx:82
SvXMLItemMapEntry const * getByName(sal_uInt16 nNameSpace, const OUString &rString) const
Definition: xmlitmpr.cxx:51
const SvXMLUnitConverter & rUnitConv
Definition: xmlitem.hxx:36
SvXMLImportContext(SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
virtual ~SvXMLItemSetContext() override
Definition: xmlitem.cxx:41
sal_uInt32 const nMemberId
Definition: xmlitmap.hxx:48
SfxItemSet & rItemSet
Definition: xmlitem.hxx:34
#define MID_SW_FLAG_ELEMENT_ITEM_IMPORT
Definition: xmlitmap.hxx:35
const SvXMLImportItemMapper & rIMapper
Definition: xmlitem.hxx:35