1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <xltracer.hxx>
21 #include <com/sun/star/beans/PropertyValue.hpp>
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <address.hxx>
25 using ::com::sun::star::uno::Sequence
;
26 using ::com::sun::star::beans::PropertyValue
;
28 XclTracer::XclTracer( const OUString
& rDocUrl
)
30 , maFirstTimes(eTraceLength
,true)
32 Sequence
< PropertyValue
> aConfigData( 1 );
33 aConfigData
[ 0 ].Name
= "DocumentURL";
34 aConfigData
[ 0 ].Value
<<= rDocUrl
;
37 XclTracer::~XclTracer()
41 void XclTracer::ProcessTraceOnce(XclTracerId eProblem
)
43 if( mbEnabled
&& maFirstTimes
[eProblem
])
45 maFirstTimes
[eProblem
] = false;
49 void XclTracer::TraceInvalidAddress( const ScAddress
& rPos
, const ScAddress
& rMaxPos
)
51 TraceInvalidRow(rPos
.Row(), rMaxPos
.Row());
52 TraceInvalidTab(rPos
.Tab(), rMaxPos
.Tab());
55 void XclTracer::TraceInvalidRow( sal_uInt32 nRow
, sal_uInt32 nMaxRow
)
58 ProcessTraceOnce(eRowLimitExceeded
);
61 void XclTracer::TraceInvalidTab( SCTAB nTab
, SCTAB nMaxTab
)
64 ProcessTraceOnce(eTabLimitExceeded
);
67 void XclTracer::TracePrintRange()
69 ProcessTraceOnce( ePrintRange
);
72 void XclTracer::TraceDates( sal_uInt16 nNumFmt
)
74 // Short Date = 14 and Short Date+Time = 22
75 if(nNumFmt
== 14 || nNumFmt
== 22)
76 ProcessTraceOnce(eShortDate
);
79 void XclTracer::TraceBorderLineStyle( bool bBorderLineStyle
)
82 ProcessTraceOnce(eBorderLineStyle
);
85 void XclTracer::TraceFillPattern( bool bFillPattern
)
88 ProcessTraceOnce(eFillPattern
);
91 void XclTracer::TraceFormulaMissingArg()
93 // missing parameter in Formula record
94 ProcessTraceOnce(eFormulaMissingArg
);
97 void XclTracer::TracePivotDataSource( bool bExternal
)
100 ProcessTraceOnce(ePivotDataSource
);
103 void XclTracer::TracePivotChartExists()
105 // Pivot Charts not currently displayed.
106 ProcessTraceOnce(ePivotChartExists
);
109 void XclTracer::TraceChartUnKnownType()
111 ProcessTraceOnce(eChartUnKnownType
);
114 void XclTracer::TraceChartOnlySheet()
116 ProcessTraceOnce(eChartOnlySheet
);
119 void XclTracer::TraceChartDataTable()
121 // Data table is not supported.
122 ProcessTraceOnce(eChartDataTable
);
125 void XclTracer::TraceChartLegendPosition()
127 // If position is set to "not docked or inside the plot area" then
128 // we cannot guarantee the legend position.
129 ProcessTraceOnce(eChartLegendPosition
);
132 void XclTracer::TraceUnsupportedObjects()
134 // Called from Excel 5.0 - limited Graphical object support.
135 ProcessTraceOnce(eUnsupportedObject
);
138 void XclTracer::TraceObjectNotPrintable()
140 ProcessTraceOnce(eObjectNotPrintable
);
143 void XclTracer::TraceDVType( bool bType
)
145 // Custom types work if 'Data->validity dialog' is not OKed.
147 ProcessTraceOnce(eDVType
);
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */