diff options
Diffstat (limited to 'bf_xmloff/source/style/xmloff_xmlprcon.cxx')
-rw-r--r-- | bf_xmloff/source/style/xmloff_xmlprcon.cxx | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/bf_xmloff/source/style/xmloff_xmlprcon.cxx b/bf_xmloff/source/style/xmloff_xmlprcon.cxx new file mode 100644 index 000000000..d823ebf64 --- /dev/null +++ b/bf_xmloff/source/style/xmloff_xmlprcon.cxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "xmlimp.hxx" + + +#include "xmlprcon.hxx" +namespace binfilter { + +using namespace ::rtl; +using namespace ::com::sun::star; +using namespace ::std; + +SvXMLPropertySetContext::SvXMLPropertySetContext( + SvXMLImport& rImp, USHORT nPrfx, + const OUString& rLName, + const uno::Reference< xml::sax::XAttributeList >& xAttrList, + vector< XMLPropertyState > &rProps, + const UniReference < SvXMLImportPropertyMapper > &rMap, + sal_Int32 nSIdx, sal_Int32 nEIdx ) + : SvXMLImportContext( rImp, nPrfx, rLName ) + , nStartIdx( nSIdx ) + , nEndIdx( nEIdx ) + , rProperties( rProps ) + , xMapper( rMap ) +{ + xMapper->importXML( rProperties, xAttrList, + GetImport().GetMM100UnitConverter(), + GetImport().GetNamespaceMap(), nStartIdx, nEndIdx ); +} + +SvXMLPropertySetContext::~SvXMLPropertySetContext() +{ +} + +SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( + USHORT nInPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +{ + UniReference< XMLPropertySetMapper > aSetMapper( + xMapper->getPropertySetMapper() ); + sal_Int32 nEntryIndex = aSetMapper->GetEntryIndex( nInPrefix, rLocalName, + nStartIdx ); + + if( ( nEntryIndex != -1 ) && (-1 == nEndIdx || nEntryIndex < nEndIdx ) && + ( 0 != ( aSetMapper->GetEntryFlags( nEntryIndex ) + & MID_FLAG_ELEMENT_ITEM_IMPORT ) ) ) + { + XMLPropertyState aProp( nEntryIndex ); + return CreateChildContext( nInPrefix, rLocalName, xAttrList, + rProperties, aProp ); + } + else + { + return new SvXMLImportContext( GetImport(), nInPrefix, rLocalName ); + } +} + +/** This method is called from this instance implementation of + CreateChildContext if the element matches an entry in the + SvXMLImportItemMapper with the mid flag MID_FLAG_ELEMENT +*/ +SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext( + USHORT nInPrefix, + const ::rtl::OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/, + ::std::vector< XMLPropertyState > & /*rProperties*/, + const XMLPropertyState& /*rProp*/ ) +{ + return new SvXMLImportContext( GetImport(), nInPrefix, rLocalName ); +} + + +}//end of namespace binfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |