LCOV - code coverage report
Current view: top level - xmloff/source/style - PageHeaderFooterContext.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 18 19 94.7 %
Date: 2014-04-11 Functions: 5 5 100.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 "PageHeaderFooterContext.hxx"
      21             : #include <xmloff/xmlnmspe.hxx>
      22             : #include <xmloff/xmltoken.hxx>
      23             : #include "PagePropertySetContext.hxx"
      24             : 
      25             : using namespace com::sun::star;
      26             : using ::xmloff::token::IsXMLToken;
      27             : using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
      28             : 
      29         756 : PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
      30             :                                       sal_uInt16 nPrfx,
      31             :                                       const OUString& rLName,
      32             :                                       const ::com::sun::star::uno::Reference<
      33             :                                       ::com::sun::star::xml::sax::XAttributeList>&,
      34             :                                       ::std::vector< XMLPropertyState > & rTempProperties,
      35             :                                       const UniReference < SvXMLImportPropertyMapper > &rTempMap,
      36             :                                       sal_Int32 nStart, sal_Int32 nEnd,
      37             :                                       const sal_Bool bTempHeader ) :
      38             :     SvXMLImportContext( rImport, nPrfx, rLName ),
      39             :     rProperties(rTempProperties),
      40             :     nStartIndex(nStart),
      41             :     nEndIndex(nEnd),
      42         756 :     rMap(rTempMap)
      43             : {
      44         756 :     bHeader = bTempHeader;
      45         756 : }
      46             : 
      47        1512 : PageHeaderFooterContext::~PageHeaderFooterContext()
      48             : {
      49        1512 : }
      50             : 
      51         477 : SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( sal_uInt16 nPrefix,
      52             :                                             const OUString& rLName,
      53             :                                             const ::com::sun::star::uno::Reference<
      54             :                                           ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
      55             : {
      56         477 :     SvXMLImportContext *pContext = 0;
      57             : 
      58         477 :     if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
      59             :     {
      60         477 :         PageContextType aType = Header;
      61         477 :         if (!bHeader)
      62         238 :             aType = Footer;
      63         477 :         pContext = new PagePropertySetContext( GetImport(), nPrefix,
      64             :                                                 rLName, xAttrList,
      65             :                                                 XML_TYPE_PROP_HEADER_FOOTER,
      66             :                                                 rProperties,
      67         477 :                                                 rMap,  nStartIndex, nEndIndex, aType);
      68             :     }
      69             : 
      70         477 :     if( !pContext )
      71           0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
      72             : 
      73         477 :     return pContext;
      74             : }
      75             : 
      76         756 : void PageHeaderFooterContext::EndElement()
      77             : {
      78         756 : }
      79             : 
      80             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10