LCOV - code coverage report
Current view: top level - xmloff/source/style - PageHeaderFooterContext.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 18 19 94.7 %
Date: 2012-08-25 Functions: 5 5 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 10 20 50.0 %

           Branch data     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                 :        582 : 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         [ +  - ]:        582 :     rMap(rTempMap)
      45                 :            : {
      46                 :        582 :     bHeader = bTempHeader;
      47                 :        582 : }
      48                 :            : 
      49         [ +  - ]:        582 : PageHeaderFooterContext::~PageHeaderFooterContext()
      50                 :            : {
      51         [ -  + ]:       1164 : }
      52                 :            : 
      53                 :        400 : 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                 :        400 :     SvXMLImportContext *pContext = 0;
      59                 :            : 
      60 [ +  - ][ +  - ]:        400 :     if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
                 [ +  - ]
      61                 :            :     {
      62                 :        400 :         PageContextType aType = Header;
      63         [ +  + ]:        400 :         if (!bHeader)
      64                 :        201 :             aType = Footer;
      65                 :        400 :         pContext = new PagePropertySetContext( GetImport(), nPrefix,
      66                 :            :                                                 rLName, xAttrList,
      67                 :            :                                                 XML_TYPE_PROP_HEADER_FOOTER,
      68                 :            :                                                 rProperties,
      69         [ +  - ]:        400 :                                                 rMap,  nStartIndex, nEndIndex, aType);
      70                 :            :     }
      71                 :            : 
      72                 :            : 
      73         [ -  + ]:        400 :     if( !pContext )
      74         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
      75                 :            : 
      76                 :        400 :     return pContext;
      77                 :            : }
      78                 :            : 
      79                 :        582 : void PageHeaderFooterContext::EndElement()
      80                 :            : {
      81                 :        582 : }
      82                 :            : 
      83                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10