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

Generated by: LCOV version 1.10