LCOV - code coverage report
Current view: top level - xmloff/source/style - xmlprcon.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 17 20 85.0 %
Date: 2014-04-11 Functions: 4 5 80.0 %
Legend: Lines: hit not hit

          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             : 
      22             : 
      23             : #include <xmloff/xmlprcon.hxx>
      24             : 
      25             : 
      26             : using namespace ::com::sun::star;
      27             : using namespace ::std;
      28             : 
      29       10105 : SvXMLPropertySetContext::SvXMLPropertySetContext(
      30             :     SvXMLImport& rImp, sal_uInt16 nPrfx,
      31             :     const OUString& rLName,
      32             :     const uno::Reference< xml::sax::XAttributeList >& xAttrList,
      33             :     sal_uInt32 nFam,
      34             :     vector< XMLPropertyState > &rProps,
      35             :     const UniReference < SvXMLImportPropertyMapper >  &rMap,
      36             :     sal_Int32 nSIdx, sal_Int32 nEIdx )
      37             : :   SvXMLImportContext( rImp, nPrfx, rLName )
      38             : ,   mnStartIdx( nSIdx )
      39             : ,   mnEndIdx( nEIdx )
      40             : ,   mnFamily( nFam )
      41             : ,   mrProperties( rProps )
      42       10105 : ,   mxMapper( rMap )
      43             : {
      44             :     mxMapper->importXML( mrProperties, xAttrList,
      45       10105 :                         GetImport().GetMM100UnitConverter(),
      46       10105 :                         GetImport().GetNamespaceMap(), mnFamily,
      47       20210 :                         mnStartIdx, mnEndIdx );
      48       10105 : }
      49             : 
      50       11519 : SvXMLPropertySetContext::~SvXMLPropertySetContext()
      51             : {
      52       11519 : }
      53             : 
      54         985 : SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext(
      55             :     sal_uInt16 nPrefix,
      56             :     const OUString& rLocalName,
      57             :     const uno::Reference< xml::sax::XAttributeList >& xAttrList )
      58             : {
      59             :     UniReference< XMLPropertySetMapper > aSetMapper(
      60         985 :             mxMapper->getPropertySetMapper() );
      61             :     sal_Int32 nEntryIndex = aSetMapper->GetEntryIndex( nPrefix, rLocalName,
      62         985 :                                                        mnFamily, mnStartIdx );
      63             : 
      64        1970 :     if( ( nEntryIndex != -1 ) && (-1 == mnEndIdx || nEntryIndex < mnEndIdx ) &&
      65         985 :         ( 0 != ( aSetMapper->GetEntryFlags( nEntryIndex )
      66         985 :                          & MID_FLAG_ELEMENT_ITEM_IMPORT ) ) )
      67             :     {
      68         985 :         XMLPropertyState aProp( nEntryIndex );
      69             :         return CreateChildContext( nPrefix, rLocalName, xAttrList,
      70         985 :                                    mrProperties, aProp );
      71             :     }
      72             :     else
      73             :     {
      74           0 :         return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
      75         985 :     }
      76             : }
      77             : 
      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
      81             : */
      82           0 : SvXMLImportContext *SvXMLPropertySetContext::CreateChildContext(
      83             :     sal_uInt16 nPrefix,
      84             :     const OUString& rLocalName,
      85             :     const uno::Reference< xml::sax::XAttributeList >&,
      86             :     ::std::vector< XMLPropertyState > &,
      87             :     const XMLPropertyState& )
      88             : {
      89           0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
      90             : }
      91             : 
      92             : 
      93             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10