LCOV - code coverage report
Current view: top level - sdext/source/pdfimport/sax - saxattrlist.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 31 0.0 %
Date: 2012-08-25 Functions: 0 12 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 62 0.0 %

           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                 :            : 
      30                 :            : #include "saxattrlist.hxx"
      31                 :            : 
      32                 :            : namespace pdfi
      33                 :            : {
      34                 :            : 
      35 [ #  # ][ #  # ]:          0 : SaxAttrList::SaxAttrList( const boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >& rMap )
      36                 :            : {
      37         [ #  # ]:          0 :     m_aAttributes.reserve(rMap.size());
      38         [ #  # ]:          0 :     for( boost::unordered_map< rtl::OUString,
      39                 :            :                         rtl::OUString,
      40         [ #  # ]:          0 :                         rtl::OUStringHash >::const_iterator it = rMap.begin();
      41         [ #  # ]:          0 :          it != rMap.end(); ++it )
      42                 :            :     {
      43 [ #  # ][ #  # ]:          0 :         m_aIndexMap[ it->first ] = m_aAttributes.size();
      44 [ #  # ][ #  # ]:          0 :         m_aAttributes.push_back( AttrEntry( it->first, it->second ) );
                 [ #  # ]
      45                 :            :     }
      46                 :          0 : }
      47                 :            : 
      48                 :          0 : SaxAttrList::SaxAttrList( const SaxAttrList& rClone ) :
      49                 :            :     cppu::WeakImplHelper2<com::sun::star::xml::sax::XAttributeList, com::sun::star::util::XCloneable>(rClone),
      50                 :            :     m_aAttributes( rClone.m_aAttributes ),
      51 [ #  # ][ #  # ]:          0 :     m_aIndexMap( rClone.m_aIndexMap )
      52                 :            : {
      53                 :          0 : }
      54                 :            : 
      55         [ #  # ]:          0 : SaxAttrList::~SaxAttrList()
      56                 :            : {
      57         [ #  # ]:          0 : }
      58                 :            : 
      59                 :            : namespace {
      60                 :          0 :     static const rtl::OUString& getCDATAString()
      61                 :            :     {
      62 [ #  # ][ #  # ]:          0 :         static rtl::OUString aStr( RTL_CONSTASCII_USTRINGPARAM( "CDATA" ) );
         [ #  # ][ #  # ]
      63                 :          0 :         return aStr;
      64                 :            :     }
      65                 :            : }
      66                 :            : 
      67                 :          0 : sal_Int16 SAL_CALL SaxAttrList::getLength() throw()
      68                 :            : {
      69                 :          0 :     return sal_Int16(m_aAttributes.size());
      70                 :            : }
      71                 :          0 : rtl::OUString SAL_CALL SaxAttrList::getNameByIndex( sal_Int16 i_nIndex ) throw()
      72                 :            : {
      73         [ #  # ]:          0 :     return (i_nIndex < sal_Int16(m_aAttributes.size())) ? m_aAttributes[i_nIndex].m_aName : rtl::OUString();
      74                 :            : }
      75                 :            : 
      76                 :          0 : rtl::OUString SAL_CALL SaxAttrList::getTypeByIndex( sal_Int16 i_nIndex) throw()
      77                 :            : {
      78         [ #  # ]:          0 :     return (i_nIndex < sal_Int16(m_aAttributes.size())) ? getCDATAString() : rtl::OUString();
      79                 :            : }
      80                 :            : 
      81                 :          0 : rtl::OUString SAL_CALL SaxAttrList::getTypeByName( const ::rtl::OUString& i_rName ) throw()
      82                 :            : {
      83 [ #  # ][ #  # ]:          0 :     return (m_aIndexMap.find( i_rName ) != m_aIndexMap.end()) ? getCDATAString() : rtl::OUString();
                 [ #  # ]
      84                 :            : }
      85                 :            : 
      86                 :          0 : rtl::OUString SAL_CALL SaxAttrList::getValueByIndex( sal_Int16 i_nIndex ) throw()
      87                 :            : {
      88         [ #  # ]:          0 :     return (i_nIndex < sal_Int16(m_aAttributes.size())) ? m_aAttributes[i_nIndex].m_aValue : rtl::OUString();
      89                 :            : }
      90                 :            : 
      91                 :          0 : rtl::OUString SAL_CALL SaxAttrList::getValueByName(const ::rtl::OUString& i_rName) throw()
      92                 :            : {
      93         [ #  # ]:          0 :     boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it = m_aIndexMap.find( i_rName );
      94 [ #  # ][ #  # ]:          0 :     return (it != m_aIndexMap.end()) ? m_aAttributes[it->second].m_aValue : rtl::OUString();
                 [ #  # ]
      95                 :            : }
      96                 :            : 
      97                 :          0 : com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL SaxAttrList::createClone() throw()
      98                 :            : {
      99 [ #  # ][ #  # ]:          0 :     return new SaxAttrList( *this );
     100                 :            : }
     101                 :            : 
     102                 :            : }
     103                 :            : 
     104                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10