LCOV - code coverage report
Current view: top level - sw/source/filter/xml - xmlitem.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 6 14 42.9 %
Date: 2012-08-25 Functions: 2 5 40.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 22 9.1 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <xmloff/xmlimp.hxx>
      30                 :            : #include "xmlimpit.hxx"
      31                 :            : #include "xmlitem.hxx"
      32                 :            : 
      33                 :            : using ::rtl::OUString;
      34                 :            : using namespace ::com::sun::star;
      35                 :            : 
      36                 :         57 : SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
      37                 :            :                                           const OUString& rLName,
      38                 :            :                                           const uno::Reference< xml::sax::XAttributeList >& xAttrList,
      39                 :            :                                           SfxItemSet& rISet,
      40                 :            :                                           SvXMLImportItemMapper& rIMap,
      41                 :            :                                           const SvXMLUnitConverter& rUnitConverter ):
      42                 :            :     SvXMLImportContext( rImp, nPrfx, rLName ),
      43                 :            :     rItemSet( rISet ),
      44                 :            :     rIMapper( rIMap ),
      45                 :         57 :     rUnitConv( rUnitConverter )
      46                 :            : {
      47                 :            :     rIMap.importXML( rItemSet, xAttrList, rUnitConv,
      48         [ +  - ]:         57 :                            GetImport().GetNamespaceMap() );
      49                 :         57 : }
      50                 :            : 
      51                 :         57 : SvXMLItemSetContext::~SvXMLItemSetContext()
      52                 :            : {
      53         [ -  + ]:         57 : }
      54                 :            : 
      55                 :          0 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
      56                 :            :                                             const OUString& rLocalName,
      57                 :            :                                             const uno::Reference< xml::sax::XAttributeList >& xAttrList )
      58                 :            : {
      59         [ #  # ]:          0 :     SvXMLItemMapEntriesRef xMapEntries = rIMapper.getMapEntries();
      60         [ #  # ]:          0 :     SvXMLItemMapEntry* pEntry = xMapEntries->getByName( nPrefix, rLocalName );
      61                 :            : 
      62 [ #  # ][ #  # ]:          0 :     if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) )
      63                 :            :     {
      64                 :            :         return CreateChildContext( nPrefix, rLocalName, xAttrList,
      65         [ #  # ]:          0 :                                    rItemSet, *pEntry, rUnitConv );
      66                 :            :     }
      67 [ #  # ][ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
                 [ #  # ]
      68                 :            : }
      69                 :            : 
      70                 :            : /** This method is called from this instance implementation of
      71                 :            :     CreateChildContext if the element matches an entry in the
      72                 :            :     SvXMLImportItemMapper with the mid flag MID_SW_FLAG_ELEMENT
      73                 :            : */
      74                 :          0 : SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix,
      75                 :            :                                    const rtl::OUString& rLocalName,
      76                 :            :                                    const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/,
      77                 :            :                                     SfxItemSet&  /*rItemSet*/,
      78                 :            :                                    const SvXMLItemMapEntry& /*rEntry*/,
      79                 :            :                                    const SvXMLUnitConverter& /*rUnitConv*/ )
      80                 :            : {
      81         [ #  # ]:          0 :     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
      82                 :            : }
      83                 :            : 
      84                 :            : 
      85                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10