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

Generated by: LCOV version 1.10