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 : : // ============================================================================
30 : :
31 : : #ifndef SC_XLTRACER_HXX
32 : : #define SC_XLTRACER_HXX
33 : :
34 : : #include "global.hxx" // ScAddress
35 : : #include "xltools.hxx"
36 : :
37 : : // As Trace features become implemented, we can safely delete the enum entry as
38 : : // we use the member mnID to keep track of the actual trace tag ID value.
39 : : enum XclTracerId
40 : : {
41 : : eUnKnown , /// unused but allows us to set the correct index
42 : : eRowLimitExceeded ,
43 : : eTabLimitExceeded ,
44 : : ePassword ,
45 : : ePrintRange ,
46 : : eShortDate ,
47 : : eBorderLineStyle ,
48 : : eFillPattern ,
49 : : eInvisibleGrid ,
50 : : eFormattedNote ,
51 : : eFormulaExtName ,
52 : : eFormulaMissingArg ,
53 : : ePivotDataSource ,
54 : : ePivotChartExists ,
55 : : eChartUnKnownType ,
56 : : eChartTrendLines ,
57 : : eChartErrorBars ,
58 : : eChartOnlySheet ,
59 : : eChartRange ,
60 : : eChartDSName,
61 : : eChartDataTable,
62 : : eChartLegendPosition,
63 : : eChartTextFormatting,
64 : : eChartEmbeddedObj,
65 : : eChartAxisAuto,
66 : : eChartAxisManual,
67 : : eChartInvalidXY,
68 : : eUnsupportedObject ,
69 : : eObjectNotPrintable ,
70 : : eDVType,
71 : : eTraceLength /// this *should* always be the final entry
72 : : };
73 : :
74 : : struct XclTracerDetails
75 : : {
76 : : XclTracerId meProblemId; /// Excel Import Trace index.
77 : : sal_uInt32 mnID; /// actual ID Index trace tag Value
78 : : const sal_Char* mpContext; /// Context for problem e.g. Limits
79 : : const sal_Char* mpDetail; /// Context Detail e.g. SheetX
80 : : const sal_Char* mpProblem; /// Description of problem
81 : : };
82 : :
83 : :
84 : : // ============================================================================
85 : :
86 : : /** This class wraps an MSFilterTracer to create trace logs for import/export filters. */
87 : : class XclTracer
88 : : {
89 : : public:
90 : : explicit XclTracer( const String& rDocUrl );
91 : : virtual ~XclTracer();
92 : :
93 : : /** Returns true, if tracing is enabled. */
94 : 6 : inline bool IsEnabled() const { return mbEnabled; }
95 : :
96 : : /** Ensure that particular traces are logged once per document. */
97 : : void ProcessTraceOnce(XclTracerId eProblem);
98 : :
99 : : void TraceInvalidAddress(const ScAddress& rPos, const ScAddress& rMaxPos);
100 : : void TraceInvalidRow( sal_uInt32 nRow, sal_uInt32 nMaxrow );
101 : : void TraceInvalidTab( SCTAB nTab, SCTAB nMaxTab);
102 : : void TracePrintRange();
103 : : void TraceDates(sal_uInt16 nNumFmt);
104 : : void TraceBorderLineStyle(bool bBorderLineStyle);
105 : : void TraceFillPattern(bool bFillPattern);
106 : : void TraceFormulaMissingArg();
107 : : void TracePivotDataSource(bool bExternal);
108 : : void TracePivotChartExists();
109 : : void TraceChartUnKnownType();
110 : : void TraceChartOnlySheet();
111 : : void TraceChartDataTable();
112 : : void TraceChartLegendPosition();
113 : : void TraceUnsupportedObjects();
114 : : void TraceObjectNotPrintable();
115 : : void TraceDVType(bool bType);
116 : :
117 : : private:
118 : : bool mbEnabled;
119 : : typedef ::std::vector< bool > BoolVec;
120 : : /** array of flags corresponding to each entry in the XclTracerDetails table. */
121 : : BoolVec maFirstTimes;
122 : : };
123 : :
124 : :
125 : : // ============================================================================
126 : :
127 : : #endif
128 : :
129 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|