1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <xmloff/xmlimp.hxx>
23 #include <xmloff/xmlprcon.hxx>
26 using namespace ::com::sun::star
;
27 using namespace ::std
;
29 SvXMLPropertySetContext::SvXMLPropertySetContext(
30 SvXMLImport
& rImp
, sal_uInt16 nPrfx
,
31 const OUString
& rLName
,
32 const uno::Reference
< xml::sax::XAttributeList
>& xAttrList
,
34 vector
< XMLPropertyState
> &rProps
,
35 const UniReference
< SvXMLImportPropertyMapper
> &rMap
,
36 sal_Int32 nSIdx
, sal_Int32 nEIdx
)
37 : SvXMLImportContext( rImp
, nPrfx
, rLName
)
41 , mrProperties( rProps
)
44 mxMapper
->importXML( mrProperties
, xAttrList
,
45 GetImport().GetMM100UnitConverter(),
46 GetImport().GetNamespaceMap(), mnFamily
,
47 mnStartIdx
, mnEndIdx
);
50 SvXMLPropertySetContext::~SvXMLPropertySetContext()
54 SvXMLImportContext
*SvXMLPropertySetContext::CreateChildContext(
56 const OUString
& rLocalName
,
57 const uno::Reference
< xml::sax::XAttributeList
>& xAttrList
)
59 UniReference
< XMLPropertySetMapper
> aSetMapper(
60 mxMapper
->getPropertySetMapper() );
61 sal_Int32 nEntryIndex
= aSetMapper
->GetEntryIndex( nPrefix
, rLocalName
,
62 mnFamily
, mnStartIdx
);
64 if( ( nEntryIndex
!= -1 ) && (-1 == mnEndIdx
|| nEntryIndex
< mnEndIdx
) &&
65 ( 0 != ( aSetMapper
->GetEntryFlags( nEntryIndex
)
66 & MID_FLAG_ELEMENT_ITEM_IMPORT
) ) )
68 XMLPropertyState
aProp( nEntryIndex
);
69 return CreateChildContext( nPrefix
, rLocalName
, xAttrList
,
70 mrProperties
, aProp
);
74 return new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
78 /** This method is called from this instance implementation of
79 CreateChildContext if the element matches an entry in the
80 SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT
82 SvXMLImportContext
*SvXMLPropertySetContext::CreateChildContext(
84 const OUString
& rLocalName
,
85 const uno::Reference
< xml::sax::XAttributeList
>&,
86 ::std::vector
< XMLPropertyState
> &,
87 const XMLPropertyState
& )
89 return new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */