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