LCOV - code coverage report
Current view: top level - sc/source/filter/oox - tablefragment.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 26 3.8 %
Date: 2012-08-25 Functions: 2 6 33.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 26 7.7 %

           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                 :            : #include "tablefragment.hxx"
      30                 :            : 
      31                 :            : #include "autofilterbuffer.hxx"
      32                 :            : #include "autofiltercontext.hxx"
      33                 :            : #include "tablebuffer.hxx"
      34                 :            : 
      35                 :            : namespace oox {
      36                 :            : namespace xls {
      37                 :            : 
      38                 :            : // ============================================================================
      39                 :            : 
      40                 :            : using namespace ::oox::core;
      41                 :            : 
      42                 :            : using ::rtl::OUString;
      43                 :            : 
      44                 :            : // ============================================================================
      45                 :            : 
      46                 :          0 : TableFragment::TableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
      47                 :            :     WorksheetFragmentBase( rHelper, rFragmentPath ),
      48 [ #  # ][ #  # ]:          0 :     mrTable( getTables().createTable() )
      49                 :            : {
      50                 :          0 : }
      51                 :            : 
      52                 :          0 : ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
      53                 :            : {
      54      [ #  #  # ]:          0 :     switch( getCurrentElement() )
      55                 :            :     {
      56                 :            :         case XML_ROOT_CONTEXT:
      57         [ #  # ]:          0 :             if( nElement == XLS_TOKEN( table ) )
      58                 :            :             {
      59                 :          0 :                 mrTable.importTable( rAttribs, getSheetIndex() );
      60                 :          0 :                 return this;
      61                 :            :             }
      62                 :          0 :         break;
      63                 :            :         case XLS_TOKEN( table ):
      64         [ #  # ]:          0 :             if( nElement == XLS_TOKEN( autoFilter ) )
      65         [ #  # ]:          0 :                 return new AutoFilterContext( *this, mrTable.createAutoFilter() );
      66                 :          0 :         break;
      67                 :            :     }
      68                 :          0 :     return 0;
      69                 :            : }
      70                 :            : 
      71                 :          0 : ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
      72                 :            : {
      73      [ #  #  # ]:          0 :     switch( getCurrentElement() )
      74                 :            :     {
      75                 :            :         case XML_ROOT_CONTEXT:
      76         [ #  # ]:          0 :             if( nRecId == BIFF12_ID_TABLE )
      77                 :            :             {
      78                 :          0 :                 mrTable.importTable( rStrm, getSheetIndex() );
      79                 :          0 :                 return this;
      80                 :            :             }
      81                 :          0 :         break;
      82                 :            :         case BIFF12_ID_TABLE:
      83         [ #  # ]:          0 :             if( nRecId == BIFF12_ID_AUTOFILTER )
      84         [ #  # ]:          0 :                 return new AutoFilterContext( *this, mrTable.createAutoFilter() );
      85                 :          0 :         break;
      86                 :            :     }
      87                 :          0 :     return 0;
      88                 :            : }
      89                 :            : 
      90                 :          0 : const RecordInfo* TableFragment::getRecordInfos() const
      91                 :            : {
      92                 :            :     static const RecordInfo spRecInfos[] =
      93                 :            :     {
      94                 :            :         { BIFF12_ID_AUTOFILTER,         BIFF12_ID_AUTOFILTER + 1        },
      95                 :            :         { BIFF12_ID_CUSTOMFILTERS,      BIFF12_ID_CUSTOMFILTERS + 1     },
      96                 :            :         { BIFF12_ID_DISCRETEFILTERS,    BIFF12_ID_DISCRETEFILTERS + 1   },
      97                 :            :         { BIFF12_ID_FILTERCOLUMN,       BIFF12_ID_FILTERCOLUMN + 1      },
      98                 :            :         { BIFF12_ID_TABLE,              BIFF12_ID_TABLE + 1             },
      99                 :            :         { -1,                           -1                              }
     100                 :            :     };
     101                 :          0 :     return spRecInfos;
     102                 :            : }
     103                 :            : 
     104                 :            : // ============================================================================
     105                 :            : 
     106                 :            : } // namespace xls
     107 [ +  - ][ +  - ]:         24 : } // namespace oox
     108                 :            : 
     109                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10