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

Generated by: LCOV version 1.10