LCOV - code coverage report
Current view: top level - sc/source/filter/excel - xltracer.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 50 71 70.4 %
Date: 2015-06-13 12:38:46 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         156 : XclTracer::XclTracer( const OUString& rDocUrl )
      28             :     : mbEnabled(false)
      29         156 :     , maFirstTimes(eTraceLength,true)
      30             : {
      31         156 :     Sequence< PropertyValue > aConfigData( 1 );
      32         156 :     aConfigData[ 0 ].Name = "DocumentURL";
      33         156 :     aConfigData[ 0 ].Value <<= rDocUrl;
      34         156 : }
      35             : 
      36         312 : XclTracer::~XclTracer()
      37             : {
      38         312 : }
      39             : 
      40          45 : void XclTracer::ProcessTraceOnce(XclTracerId eProblem)
      41             : {
      42          45 :     if( mbEnabled && maFirstTimes[eProblem])
      43             :     {
      44           0 :         maFirstTimes[eProblem] = false;
      45             :     }
      46          45 : }
      47             : 
      48        5899 : void XclTracer::TraceInvalidAddress( const ScAddress& rPos, const ScAddress& rMaxPos )
      49             : {
      50        5899 :     TraceInvalidRow(rPos.Row(), rMaxPos.Row());
      51        5899 :     TraceInvalidTab(rPos.Tab(), rMaxPos.Tab());
      52        5899 : }
      53             : 
      54        5899 : void XclTracer::TraceInvalidRow( sal_uInt32 nRow, sal_uInt32 nMaxRow )
      55             : {
      56        5899 :     if(nRow > nMaxRow)
      57           0 :         ProcessTraceOnce(eRowLimitExceeded);
      58        5899 : }
      59             : 
      60        5899 : void XclTracer::TraceInvalidTab( SCTAB nTab, SCTAB nMaxTab )
      61             : {
      62        5899 :     if(nTab > nMaxTab)
      63           0 :         ProcessTraceOnce(eTabLimitExceeded);
      64        5899 : }
      65             : 
      66           5 : void XclTracer::TracePrintRange()
      67             : {
      68           5 :     ProcessTraceOnce( ePrintRange);
      69           5 : }
      70             : 
      71         671 : void XclTracer::TraceDates( sal_uInt16 nNumFmt)
      72             : {
      73             :     // Short Date = 14 and Short Date+Time = 22
      74         671 :     if(nNumFmt == 14 || nNumFmt == 22)
      75          12 :         ProcessTraceOnce(eShortDate);
      76         671 : }
      77             : 
      78        1279 : void XclTracer::TraceBorderLineStyle( bool bBorderLineStyle)
      79             : {
      80        1279 :     if(bBorderLineStyle)
      81          22 :         ProcessTraceOnce(eBorderLineStyle);
      82        1279 : }
      83             : 
      84        1376 : void XclTracer::TraceFillPattern( bool bFillPattern)
      85             : {
      86        1376 :     if(bFillPattern)
      87           0 :         ProcessTraceOnce(eFillPattern);
      88        1376 : }
      89             : 
      90           1 : void XclTracer::TraceFormulaMissingArg()
      91             : {
      92             :     // missing parameter in Formula record
      93           1 :     ProcessTraceOnce(eFormulaMissingArg);
      94           1 : }
      95             : 
      96           2 : void XclTracer::TracePivotDataSource( bool bExternal)
      97             : {
      98           2 :     if(bExternal)
      99           0 :         ProcessTraceOnce(ePivotDataSource);
     100           2 : }
     101             : 
     102           0 : void XclTracer::TracePivotChartExists()
     103             : {
     104             :     // Pivot Charts not currently displayed.
     105           0 :     ProcessTraceOnce(ePivotChartExists);
     106           0 : }
     107             : 
     108           1 : void XclTracer::TraceChartUnKnownType()
     109             : {
     110           1 :     ProcessTraceOnce(eChartUnKnownType);
     111           1 : }
     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           4 : void XclTracer::TraceObjectNotPrintable()
     138             : {
     139           4 :     ProcessTraceOnce(eObjectNotPrintable);
     140           4 : }
     141             : 
     142           3 : void XclTracer::TraceDVType(  bool bType)
     143             : {
     144             :     // Custom types work if 'Data->validity dialog' is not OKed.
     145           3 :     if(bType)
     146           0 :         ProcessTraceOnce(eDVType);
     147          33 : }
     148             : 
     149             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11