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(std::u16string_view
/*rDocUrl*/)
30 , maFirstTimes(eTraceLength
, true)
34 XclTracer::~XclTracer() {}
36 void XclTracer::ProcessTraceOnce(XclTracerId eProblem
)
38 if (mbEnabled
&& maFirstTimes
[eProblem
])
40 maFirstTimes
[eProblem
] = false;
44 void XclTracer::TraceInvalidAddress(const ScAddress
& rPos
, const ScAddress
& rMaxPos
)
46 TraceInvalidRow(rPos
.Row(), rMaxPos
.Row());
47 TraceInvalidTab(rPos
.Tab(), rMaxPos
.Tab());
50 void XclTracer::TraceInvalidRow(sal_uInt32 nRow
, sal_uInt32 nMaxRow
)
53 ProcessTraceOnce(eRowLimitExceeded
);
56 void XclTracer::TraceInvalidTab(SCTAB nTab
, SCTAB nMaxTab
)
59 ProcessTraceOnce(eTabLimitExceeded
);
62 void XclTracer::TracePrintRange() { ProcessTraceOnce(ePrintRange
); }
64 void XclTracer::TraceDates(sal_uInt16 nNumFmt
)
66 // Short Date = 14 and Short Date+Time = 22
67 if (nNumFmt
== 14 || nNumFmt
== 22)
68 ProcessTraceOnce(eShortDate
);
71 void XclTracer::TraceBorderLineStyle(bool bBorderLineStyle
)
74 ProcessTraceOnce(eBorderLineStyle
);
77 void XclTracer::TraceFillPattern(bool bFillPattern
)
80 ProcessTraceOnce(eFillPattern
);
83 void XclTracer::TraceFormulaMissingArg()
85 // missing parameter in Formula record
86 ProcessTraceOnce(eFormulaMissingArg
);
89 void XclTracer::TracePivotDataSource(bool bExternal
)
92 ProcessTraceOnce(ePivotDataSource
);
95 void XclTracer::TracePivotChartExists()
97 // Pivot Charts not currently displayed.
98 ProcessTraceOnce(ePivotChartExists
);
101 void XclTracer::TraceChartUnKnownType() { ProcessTraceOnce(eChartUnKnownType
); }
103 void XclTracer::TraceChartOnlySheet() { ProcessTraceOnce(eChartOnlySheet
); }
105 void XclTracer::TraceChartDataTable()
107 // Data table is not supported.
108 ProcessTraceOnce(eChartDataTable
);
111 void XclTracer::TraceChartLegendPosition()
113 // If position is set to "not docked or inside the plot area" then
114 // we cannot guarantee the legend position.
115 ProcessTraceOnce(eChartLegendPosition
);
118 void XclTracer::TraceUnsupportedObjects()
120 // Called from Excel 5.0 - limited Graphical object support.
121 ProcessTraceOnce(eUnsupportedObject
);
124 void XclTracer::TraceObjectNotPrintable() { ProcessTraceOnce(eObjectNotPrintable
); }
126 void XclTracer::TraceDVType(bool bType
)
128 // Custom types work if 'Data->validity dialog' is not OKed.
130 ProcessTraceOnce(eDVType
);
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */