LCOV - code coverage report
Current view: top level - sc/source/filter/excel - xltracer.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 29 71 40.8 %
Date: 2012-08-25 Functions: 10 21 47.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 18 46 39.1 %

           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 "xltracer.hxx"
      30                 :            : #include <com/sun/star/beans/PropertyValue.hpp>
      31                 :            : #include "address.hxx"
      32                 :            : 
      33                 :            : using ::rtl::OUString;
      34                 :            : using ::com::sun::star::uno::Sequence;
      35                 :            : using ::com::sun::star::beans::PropertyValue;
      36                 :            : 
      37                 :         89 : XclTracer::XclTracer( const String& rDocUrl )
      38                 :            :     : mbEnabled(false)
      39         [ +  - ]:         89 :     , maFirstTimes(eTraceLength,true)
      40                 :            : {
      41         [ +  - ]:         89 :     Sequence< PropertyValue > aConfigData( 1 );
      42 [ +  - ][ +  - ]:         89 :     aConfigData[ 0 ].Name = CREATE_OUSTRING( "DocumentURL" );
      43 [ +  - ][ +  - ]:         89 :     aConfigData[ 0 ].Value <<= OUString( rDocUrl );
         [ +  - ][ +  - ]
      44                 :         89 : }
      45                 :            : 
      46                 :         89 : XclTracer::~XclTracer()
      47                 :            : {
      48         [ -  + ]:        178 : }
      49                 :            : 
      50                 :          5 : void XclTracer::ProcessTraceOnce(XclTracerId eProblem)
      51                 :            : {
      52 [ -  + ][ #  # ]:          5 :     if( mbEnabled && maFirstTimes[eProblem])
         [ #  # ][ -  + ]
           [ -  +  #  # ]
      53                 :            :     {
      54                 :          0 :         maFirstTimes[eProblem] = false;
      55                 :            :     }
      56                 :          5 : }
      57                 :            : 
      58                 :          0 : void XclTracer::TraceInvalidAddress( const ScAddress& rPos, const ScAddress& rMaxPos )
      59                 :            : {
      60                 :          0 :     TraceInvalidRow(rPos.Row(), rMaxPos.Row());
      61                 :          0 :     TraceInvalidTab(rPos.Tab(), rMaxPos.Tab());
      62                 :          0 : }
      63                 :            : 
      64                 :          0 : void XclTracer::TraceInvalidRow( sal_uInt32 nRow, sal_uInt32 nMaxRow )
      65                 :            : {
      66         [ #  # ]:          0 :     if(nRow > nMaxRow)
      67                 :          0 :         ProcessTraceOnce(eRowLimitExceeded);
      68                 :          0 : }
      69                 :            : 
      70                 :          0 : void XclTracer::TraceInvalidTab( SCTAB nTab, SCTAB nMaxTab )
      71                 :            : {
      72         [ #  # ]:          0 :     if(nTab > nMaxTab)
      73                 :          0 :         ProcessTraceOnce(eTabLimitExceeded);
      74                 :          0 : }
      75                 :            : 
      76                 :          0 : void XclTracer::TracePrintRange()
      77                 :            : {
      78                 :          0 :     ProcessTraceOnce( ePrintRange);
      79                 :          0 : }
      80                 :            : 
      81                 :        239 : void XclTracer::TraceDates( sal_uInt16 nNumFmt)
      82                 :            : {
      83                 :            :     // Short Date = 14 and Short Date+Time = 22
      84 [ +  - ][ -  + ]:        239 :     if(nNumFmt == 14 || nNumFmt == 22)
      85                 :          0 :         ProcessTraceOnce(eShortDate);
      86                 :        239 : }
      87                 :            : 
      88                 :        464 : void XclTracer::TraceBorderLineStyle( bool bBorderLineStyle)
      89                 :            : {
      90         [ -  + ]:        464 :     if(bBorderLineStyle)
      91                 :          0 :         ProcessTraceOnce(eBorderLineStyle);
      92                 :        464 : }
      93                 :            : 
      94                 :        508 : void XclTracer::TraceFillPattern( bool bFillPattern)
      95                 :            : {
      96         [ -  + ]:        508 :     if(bFillPattern)
      97                 :          0 :         ProcessTraceOnce(eFillPattern);
      98                 :        508 : }
      99                 :            : 
     100                 :          0 : void XclTracer::TraceFormulaMissingArg()
     101                 :            : {
     102                 :            :     // missing parameter in Formula record
     103                 :          0 :     ProcessTraceOnce(eFormulaMissingArg);
     104                 :          0 : }
     105                 :            : 
     106                 :          5 : void XclTracer::TracePivotDataSource( bool bExternal)
     107                 :            : {
     108         [ -  + ]:          5 :     if(bExternal)
     109                 :          0 :         ProcessTraceOnce(ePivotDataSource);
     110                 :          5 : }
     111                 :            : 
     112                 :          0 : void XclTracer::TracePivotChartExists()
     113                 :            : {
     114                 :            :     // Pivot Charts not currently displayed.
     115                 :          0 :     ProcessTraceOnce(ePivotChartExists);
     116                 :          0 : }
     117                 :            : 
     118                 :          0 : void XclTracer::TraceChartUnKnownType()
     119                 :            : {
     120                 :          0 :     ProcessTraceOnce(eChartUnKnownType);
     121                 :          0 : }
     122                 :            : 
     123                 :          0 : void XclTracer::TraceChartOnlySheet()
     124                 :            : {
     125                 :          0 :     ProcessTraceOnce(eChartOnlySheet);
     126                 :          0 : }
     127                 :            : 
     128                 :          0 : void XclTracer::TraceChartDataTable()
     129                 :            : {
     130                 :            :     // Data table is not supported.
     131                 :          0 :     ProcessTraceOnce(eChartDataTable);
     132                 :          0 : }
     133                 :            : 
     134                 :          0 : void XclTracer::TraceChartLegendPosition()
     135                 :            : {
     136                 :            :     // If position is set to "not docked or inside the plot area" then
     137                 :            :     // we cannot guarantee the legend position.
     138                 :          0 :     ProcessTraceOnce(eChartLegendPosition);
     139                 :          0 : }
     140                 :            : 
     141                 :          0 : void XclTracer::TraceUnsupportedObjects()
     142                 :            : {
     143                 :            :     // Called from Excel 5.0 - limited Graphical object support.
     144                 :          0 :     ProcessTraceOnce(eUnsupportedObject);
     145                 :          0 : }
     146                 :            : 
     147                 :          5 : void XclTracer::TraceObjectNotPrintable()
     148                 :            : {
     149                 :          5 :     ProcessTraceOnce(eObjectNotPrintable);
     150                 :          5 : }
     151                 :            : 
     152                 :          5 : void XclTracer::TraceDVType(  bool bType)
     153                 :            : {
     154                 :            :     // Custom types work if 'Data->validity dialog' is not OKed.
     155         [ -  + ]:          5 :     if(bType)
     156                 :          0 :         ProcessTraceOnce(eDVType);
     157                 :          5 : }
     158                 :            : 
     159                 :            : // ============================================================================
     160                 :            : 
     161                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10