update ooo310-m15
[ooovba.git] / applied_patches / 0878-oox-calc-export-row-limit.diff
blob6da17fc6bf0163bddfd9ed1f1d82b7ba9f27135b
1 From ec416334c40c7e0f31b3b0541447c212a1727cf8 Mon Sep 17 00:00:00 2001
2 From: Jan Nieuwenhuizen <janneke@gnu.org>
3 Date: Fri, 5 Jun 2009 15:51:45 +0200
4 Subject: [PATCH] [OOXML]: use 32 bits for xlsx row export. Fixes 65536 row limit, n#504623.
6 Also, fix export of Formulas in the last row (off by one bug),
7 Note content and Hyperlinks below 65536.
9 A lot of files are touched to add explitic #includes of copied
10 headers (xladdress.hxx, xlconst.hxx etc).
12 Original filter/inc headers are touched, only to add an include
13 guard to ascertain we're not including original versions of
14 copied headers.
16 * Modified sc/source/filter/inc/xetable.hxx
17 * Modified sc/source/filter/inc/xladdress.hxx
18 * Modified sc/source/filter/inc/xlconst.hxx
19 * Modified sc/source/filter/inc/xlformula.hxx
20 * Added sc/source/filter/inc/xlsx/xetable.hxx
21 * Added sc/source/filter/inc/xlsx/xladdress.hxx
22 * Added sc/source/filter/inc/xlsx/xlconst.hxx
23 * Added sc/source/filter/inc/xlsx/xlformula.hxx
24 * Modified sc/source/filter/xlsx/XclExpChangeTrack.hxx
25 * Modified sc/source/filter/xlsx/excrecds.hxx
26 * Modified sc/source/filter/xlsx/makefile.mk
27 * Modified sc/source/filter/xlsx/xestream.hxx
28 * Modified sc/source/filter/xlsx/xlsx-colrowst.cxx
29 * Modified sc/source/filter/xlsx/xlsx-excdoc.cxx
30 * Modified sc/source/filter/xlsx/xlsx-excel.cxx
31 * Modified sc/source/filter/xlsx/xlsx-excform.cxx
32 * Modified sc/source/filter/xlsx/xlsx-excform8.cxx
33 * Modified sc/source/filter/xlsx/xlsx-excimp8.cxx
34 * Modified sc/source/filter/xlsx/xlsx-exctools.cxx
35 * Modified sc/source/filter/xlsx/xlsx-expop2.cxx
36 * Modified sc/source/filter/xlsx/xlsx-impop.cxx
37 * Modified sc/source/filter/xlsx/xlsx-namebuff.cxx
38 * Modified sc/source/filter/xlsx/xlsx-read.cxx
39 * Modified sc/source/filter/xlsx/xlsx-xcl97esc.cxx
40 * Modified sc/source/filter/xlsx/xlsx-xechart.cxx
41 * Modified sc/source/filter/xlsx/xlsx-xecontent.cxx
42 * Modified sc/source/filter/xlsx/xlsx-xeescher.cxx
43 * Modified sc/source/filter/xlsx/xlsx-xeformula.cxx
44 * Modified sc/source/filter/xlsx/xlsx-xehelper.cxx
45 * Modified sc/source/filter/xlsx/xlsx-xelink.cxx
46 * Modified sc/source/filter/xlsx/xlsx-xename.cxx
47 * Modified sc/source/filter/xlsx/xlsx-xepage.cxx
48 * Modified sc/source/filter/xlsx/xlsx-xepivot.cxx
49 * Modified sc/source/filter/xlsx/xlsx-xerecord.cxx
50 * Modified sc/source/filter/xlsx/xlsx-xeroot.cxx
51 * Modified sc/source/filter/xlsx/xlsx-xestream.cxx
52 * Modified sc/source/filter/xlsx/xlsx-xetable.cxx
53 * Modified sc/source/filter/xlsx/xlsx-xeview.cxx
54 * Modified sc/source/filter/xlsx/xlsx-xichart.cxx
55 * Modified sc/source/filter/xlsx/xlsx-xicontent.cxx
56 * Modified sc/source/filter/xlsx/xlsx-xiescher.cxx
57 * Modified sc/source/filter/xlsx/xlsx-xiformula.cxx
58 * Modified sc/source/filter/xlsx/xlsx-xihelper.cxx
59 * Modified sc/source/filter/xlsx/xlsx-xilink.cxx
60 * Modified sc/source/filter/xlsx/xlsx-xiname.cxx
61 * Modified sc/source/filter/xlsx/xlsx-xipage.cxx
62 * Modified sc/source/filter/xlsx/xlsx-xipivot.cxx
63 * Modified sc/source/filter/xlsx/xlsx-xiroot.cxx
64 * Modified sc/source/filter/xlsx/xlsx-xistream.cxx
65 * Modified sc/source/filter/xlsx/xlsx-xistring.cxx
66 * Modified sc/source/filter/xlsx/xlsx-xistyle.cxx
67 * Modified sc/source/filter/xlsx/xlsx-xiview.cxx
68 * Modified sc/source/filter/xlsx/xlsx-xladdress.cxx
69 * Modified sc/source/filter/xlsx/xlsx-xlchart.cxx
70 * Modified sc/source/filter/xlsx/xlsx-xlescher.cxx
71 * Modified sc/source/filter/xlsx/xlsx-xlformula.cxx
72 * Modified sc/source/filter/xlsx/xlsx-xlpage.cxx
73 * Modified sc/source/filter/xlsx/xlsx-xlpivot.cxx
74 * Modified sc/source/filter/xlsx/xlsx-xlroot.cxx
75 * Modified sc/source/filter/xlsx/xlsx-xlstyle.cxx
76 * Modified sc/source/filter/xlsx/xlsx-xlview.cxx
77 ---
78 sc/source/filter/inc/xetable.hxx | 4 +
79 sc/source/filter/inc/xladdress.hxx | 4 +
80 sc/source/filter/inc/xlconst.hxx | 4 +
81 sc/source/filter/inc/xlformula.hxx | 4 +
82 sc/source/filter/inc/xlsx/xetable.hxx | 1092 +++++++++++++++++++++++++++
83 sc/source/filter/inc/xlsx/xladdress.hxx | 200 +++++
84 sc/source/filter/inc/xlsx/xlconst.hxx | 236 ++++++
85 sc/source/filter/inc/xlsx/xlformula.hxx | 477 ++++++++++++
86 sc/source/filter/xlsx/XclExpChangeTrack.hxx | 6 +-
87 sc/source/filter/xlsx/excrecds.hxx | 3 +
88 sc/source/filter/xlsx/makefile.mk | 2 +
89 sc/source/filter/xlsx/xestream.hxx | 3 +
90 sc/source/filter/xlsx/xlsx-colrowst.cxx | 3 +-
91 sc/source/filter/xlsx/xlsx-excdoc.cxx | 4 +
92 sc/source/filter/xlsx/xlsx-excel.cxx | 3 +
93 sc/source/filter/xlsx/xlsx-excform.cxx | 3 +
94 sc/source/filter/xlsx/xlsx-excform8.cxx | 3 +
95 sc/source/filter/xlsx/xlsx-excimp8.cxx | 3 +
96 sc/source/filter/xlsx/xlsx-exctools.cxx | 2 +-
97 sc/source/filter/xlsx/xlsx-expop2.cxx | 3 +
98 sc/source/filter/xlsx/xlsx-impop.cxx | 3 +
99 sc/source/filter/xlsx/xlsx-namebuff.cxx | 3 +
100 sc/source/filter/xlsx/xlsx-read.cxx | 3 +
101 sc/source/filter/xlsx/xlsx-xcl97esc.cxx | 3 +
102 sc/source/filter/xlsx/xlsx-xechart.cxx | 3 +
103 sc/source/filter/xlsx/xlsx-xecontent.cxx | 5 +-
104 sc/source/filter/xlsx/xlsx-xeescher.cxx | 12 +-
105 sc/source/filter/xlsx/xlsx-xeformula.cxx | 28 +-
106 sc/source/filter/xlsx/xlsx-xehelper.cxx | 5 +-
107 sc/source/filter/xlsx/xlsx-xelink.cxx | 3 +
108 sc/source/filter/xlsx/xlsx-xename.cxx | 3 +
109 sc/source/filter/xlsx/xlsx-xepage.cxx | 5 +-
110 sc/source/filter/xlsx/xlsx-xepivot.cxx | 6 +-
111 sc/source/filter/xlsx/xlsx-xerecord.cxx | 3 +
112 sc/source/filter/xlsx/xlsx-xeroot.cxx | 3 +
113 sc/source/filter/xlsx/xlsx-xestream.cxx | 4 +-
114 sc/source/filter/xlsx/xlsx-xetable.cxx | 36 +-
115 sc/source/filter/xlsx/xlsx-xeview.cxx | 3 +
116 sc/source/filter/xlsx/xlsx-xichart.cxx | 3 +
117 sc/source/filter/xlsx/xlsx-xicontent.cxx | 3 +
118 sc/source/filter/xlsx/xlsx-xiescher.cxx | 3 +
119 sc/source/filter/xlsx/xlsx-xiformula.cxx | 2 +
120 sc/source/filter/xlsx/xlsx-xihelper.cxx | 5 +-
121 sc/source/filter/xlsx/xlsx-xilink.cxx | 3 +
122 sc/source/filter/xlsx/xlsx-xiname.cxx | 3 +
123 sc/source/filter/xlsx/xlsx-xipage.cxx | 3 +
124 sc/source/filter/xlsx/xlsx-xipivot.cxx | 3 +
125 sc/source/filter/xlsx/xlsx-xiroot.cxx | 3 +
126 sc/source/filter/xlsx/xlsx-xistream.cxx | 3 +
127 sc/source/filter/xlsx/xlsx-xistring.cxx | 3 +
128 sc/source/filter/xlsx/xlsx-xistyle.cxx | 3 +
129 sc/source/filter/xlsx/xlsx-xiview.cxx | 3 +
130 sc/source/filter/xlsx/xlsx-xladdress.cxx | 2 +-
131 sc/source/filter/xlsx/xlsx-xlchart.cxx | 3 +
132 sc/source/filter/xlsx/xlsx-xlescher.cxx | 2 +-
133 sc/source/filter/xlsx/xlsx-xlformula.cxx | 2 +-
134 sc/source/filter/xlsx/xlsx-xlpage.cxx | 1 +
135 sc/source/filter/xlsx/xlsx-xlpivot.cxx | 3 +
136 sc/source/filter/xlsx/xlsx-xlroot.cxx | 1 +
137 sc/source/filter/xlsx/xlsx-xlstyle.cxx | 1 +
138 sc/source/filter/xlsx/xlsx-xlview.cxx | 1 +
139 61 files changed, 2199 insertions(+), 50 deletions(-)
140 create mode 100644 sc/source/filter/inc/xlsx/xetable.hxx
141 create mode 100644 sc/source/filter/inc/xlsx/xladdress.hxx
142 create mode 100644 sc/source/filter/inc/xlsx/xlconst.hxx
143 create mode 100644 sc/source/filter/inc/xlsx/xlformula.hxx
145 diff --git sc/source/filter/inc/xetable.hxx sc/source/filter/inc/xetable.hxx
146 index 3da59d2..3f5b0ab 100644
147 --- sc/source/filter/inc/xetable.hxx
148 +++ sc/source/filter/inc/xetable.hxx
149 @@ -31,6 +31,10 @@
150 #ifndef SC_XETABLE_HXX
151 #define SC_XETABLE_HXX
153 +#ifdef XLSX_COPY
154 +#error XLSX_COPY
155 +#endif
157 #include "xltable.hxx"
159 #include <deque>
160 diff --git sc/source/filter/inc/xladdress.hxx sc/source/filter/inc/xladdress.hxx
161 index c4aff69..05f033a 100644
162 --- sc/source/filter/inc/xladdress.hxx
163 +++ sc/source/filter/inc/xladdress.hxx
164 @@ -31,6 +31,10 @@
165 #ifndef SC_XLADDRESS_HXX
166 #define SC_XLADDRESS_HXX
168 +#ifdef XLSX_COPY
169 +#error XLSX_COPY
170 +#endif
172 #include <vector>
173 #include "address.hxx"
175 diff --git sc/source/filter/inc/xlconst.hxx sc/source/filter/inc/xlconst.hxx
176 index 5cca23d..ff9bc8d 100644
177 --- sc/source/filter/inc/xlconst.hxx
178 +++ sc/source/filter/inc/xlconst.hxx
179 @@ -31,6 +31,10 @@
180 #ifndef SC_XLCONST_HXX
181 #define SC_XLCONST_HXX
183 +#ifdef XLSX_COPY
184 +#error XLSX_COPY
185 +#endif
187 #include "address.hxx"
189 // Common =====================================================================
190 diff --git sc/source/filter/inc/xlformula.hxx sc/source/filter/inc/xlformula.hxx
191 index f0f54e4..c145f70 100644
192 --- sc/source/filter/inc/xlformula.hxx
193 +++ sc/source/filter/inc/xlformula.hxx
194 @@ -31,6 +31,10 @@
195 #ifndef SC_XLFORMULA_HXX
196 #define SC_XLFORMULA_HXX
198 +#ifdef XLSX_COPY
199 +#error XLSX_COPY
200 +#endif
202 #include <map>
203 #include "address.hxx"
204 #include "formula/opcode.hxx"
205 diff --git sc/source/filter/inc/xlsx/xetable.hxx sc/source/filter/inc/xlsx/xetable.hxx
206 new file mode 100644
207 index 0000000..7a30a2f
208 --- /dev/null
209 +++ sc/source/filter/inc/xlsx/xetable.hxx
210 @@ -0,0 +1,1092 @@
211 +/*************************************************************************
213 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
214 + *
215 + * Copyright 2008 by Sun Microsystems, Inc.
217 + * OpenOffice.org - a multi-platform office productivity suite
219 + * $RCSfile: xetable.hxx,v $
220 + * $Revision: 1.11 $
222 + * This file is part of OpenOffice.org.
224 + * OpenOffice.org is free software: you can redistribute it and/or modify
225 + * it under the terms of the GNU Lesser General Public License version 3
226 + * only, as published by the Free Software Foundation.
228 + * OpenOffice.org is distributed in the hope that it will be useful,
229 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
230 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
231 + * GNU Lesser General Public License version 3 for more details
232 + * (a copy is included in the LICENSE file that accompanied this code).
234 + * You should have received a copy of the GNU Lesser General Public License
235 + * version 3 along with OpenOffice.org. If not, see
236 + * <http://www.openoffice.org/license.html>
237 + * for a copy of the LGPLv3 License.
239 + ************************************************************************/
241 +#ifndef SC_XETABLE_HXX
242 +#define SC_XETABLE_HXX
244 +#include "xltable.hxx"
246 +#include <deque>
247 +#include <tools/mempool.hxx>
248 +#include "xladdress.hxx"
249 +#include "xerecord.hxx"
250 +#include "xestring.hxx"
251 +#include "xeformula.hxx"
252 +#include "xestyle.hxx"
254 +/* ============================================================================
255 +Export of cell tables including row and column description.
256 +- Managing all used and formatted cells in a sheet.
257 +- Row and column properties, i.e. width/height, visibility.
258 +- Find default row formatting and default column formatting.
259 +- Merged cell ranges.
260 +============================================================================ */
262 +// ============================================================================
263 +// Helper records for cell records
264 +// ============================================================================
266 +/** Represents a STRING record that contains the result of a string formula. */
267 +class XclExpStringRec : public XclExpRecord
269 +public:
270 + explicit XclExpStringRec( const XclExpRoot& rRoot, const String& rResult );
272 +private:
273 + virtual void WriteBody( XclExpStream& rStrm );
275 +private:
276 + XclExpStringRef mxResult;
279 +// Additional records for special formula ranges ==============================
281 +/** Base record for additional range formula records (i.e. ARRAY, SHRFMLA). */
282 +class XclExpRangeFmlaBase : public XclExpRecord
284 +public:
285 + /** Returns true, if the passed cell position is equal to own base position. */
286 + bool IsBasePos( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const;
288 + /** Derived classes create the token array for a corresponding FORMULA cell record. */
289 + virtual XclTokenArrayRef CreateCellTokenArray( const XclExpRoot& rRoot ) const = 0;
290 + /** Derived classes return true, if the own formula contains volatile functions. */
291 + virtual bool IsVolatile() const = 0;
293 +protected:
294 + /** Constructs the record with a single cell. */
295 + explicit XclExpRangeFmlaBase(
296 + sal_uInt16 nRecId, sal_uInt32 nRecSize, const ScAddress& rScPos );
297 + /** Constructs the record with a cell range. */
298 + explicit XclExpRangeFmlaBase(
299 + sal_uInt16 nRecId, sal_uInt32 nRecSize, const ScRange& rScRange );
301 + /** Extends the cell range to include the passed cell address. */
302 + void Extend( const ScAddress& rScPos );
304 + /** Writes the range address covered by this record. */
305 + void WriteRangeAddress( XclExpStream& rStrm ) const;
307 +protected:
308 + XclRange maXclRange; /// Range described by this record.
309 + XclAddress maBaseXclPos; /// Address of base cell (first FORMULA record).
312 +typedef ScfRef< XclExpRangeFmlaBase > XclExpRangeFmlaRef;
314 +// Array formulas =============================================================
316 +class ScTokenArray;
318 +/** Represents an ARRAY record that contains the token array of a matrix formula.
320 + An ARRAY record is stored following the first FORMULA record that is part
321 + of a matrix formula. All FORMULA records of a matrix formula contain a
322 + reference to the ARRAY record, while the ARRAY record contains the formula
323 + token array used by all formulas.
324 + */
325 +class XclExpArray : public XclExpRangeFmlaBase
327 +public:
328 + explicit XclExpArray( XclTokenArrayRef xTokArr, const ScRange& rScRange );
330 + /** Creates and returns the token array for a corresponding FORMULA cell record. */
331 + virtual XclTokenArrayRef CreateCellTokenArray( const XclExpRoot& rRoot ) const;
332 + /** Returns true, if the array formula contains volatile functions. */
333 + virtual bool IsVolatile() const;
335 +private:
336 + virtual void WriteBody( XclExpStream& rStrm );
338 +private:
339 + XclTokenArrayRef mxTokArr; /// The token array of a matrix formula.
342 +typedef ScfRef< XclExpArray > XclExpArrayRef;
344 +// ----------------------------------------------------------------------------
346 +/** Caches all ARRAY records. */
347 +class XclExpArrayBuffer : protected XclExpRoot
349 +public:
350 + explicit XclExpArrayBuffer( const XclExpRoot& rRoot );
352 + /** Inserts a new ARRAY record into the buffer and returns it. */
353 + XclExpArrayRef CreateArray( const ScTokenArray& rScTokArr, const ScRange& rScRange );
354 + /** Tries to find an ARRAY record that corresponds to an ocMatRef token. */
355 + XclExpArrayRef FindArray( const ScTokenArray& rScTokArr ) const;
357 +private:
358 + typedef ::std::map< ScAddress, XclExpArrayRef > XclExpArrayMap;
359 + XclExpArrayMap maRecMap; /// Map containing the ARRAY records.
362 +// Shared formulas ============================================================
364 +/** Represents a SHRFMLA record that contains the token array of a shared formula.
366 + A SHRFMLA record is stored following the first FORMULA record that is part
367 + of a shared formula. All FORMULA records of a shared formula contain a
368 + reference to the SHRFMLA record, while the SHRFMLA record contains the
369 + formula token array used by all formulas.
370 + */
371 +class XclExpShrfmla : public XclExpRangeFmlaBase
373 +public:
374 + /** Creates a SHRFMLA record that consists of the passed cell address only. */
375 + explicit XclExpShrfmla( XclTokenArrayRef xTokArr, const ScAddress& rScPos );
377 + /** Extends the cell range to include the passed cell address. */
378 + void ExtendRange( const ScAddress& rScPos );
380 + /** Creates and returns the token array for a corresponding FORMULA cell record. */
381 + virtual XclTokenArrayRef CreateCellTokenArray( const XclExpRoot& rRoot ) const;
382 + /** Returns true, if the shared formula contains volatile functions. */
383 + virtual bool IsVolatile() const;
385 +private:
386 + virtual void WriteBody( XclExpStream& rStrm );
388 +private:
389 + XclTokenArrayRef mxTokArr; /// The token array of a shared formula.
390 + sal_uInt8 mnUsedCount; /// Number of FORMULA records referring to this record.
393 +typedef ScfRef< XclExpShrfmla > XclExpShrfmlaRef;
395 +// ----------------------------------------------------------------------------
397 +/** Caches all SHRFMLA records and provides functions to update their ranges. */
398 +class XclExpShrfmlaBuffer : protected XclExpRoot
400 +public:
401 + explicit XclExpShrfmlaBuffer( const XclExpRoot& rRoot );
403 + /** Tries to create a new or to update an existing SHRFMLA record.
404 + @return An empty reference, if the passed token array does not contain
405 + a shared formula. If the token array is a shared formula, this
406 + function updates its cell range to include the passed cell position,
407 + if there is a SHRFMLA record for the passed token array; otherwise
408 + this function creates and returns a new SHRFMLA record. */
409 + XclExpShrfmlaRef CreateOrExtendShrfmla(
410 + const ScTokenArray& rScTokArr, const ScAddress& rScPos );
412 +private:
413 + typedef ::std::map< const ScTokenArray*, XclExpShrfmlaRef > XclExpShrfmlaMap;
414 + XclExpShrfmlaMap maRecMap; /// Map containing the SHRFMLA records.
417 +// Multiple operations ========================================================
419 +struct XclMultipleOpRefs;
421 +/** Represents a TABLEOP record for a multiple operations range. */
422 +class XclExpTableop : public XclExpRangeFmlaBase
424 +public:
425 + explicit XclExpTableop( const ScAddress& rScPos,
426 + const XclMultipleOpRefs& rRefs, sal_uInt8 nScMode );
428 + /** Returns true, if the cell range has been extended to the passed position.
429 + @descr All references passed in rRefs must fit the ranges passed in the constructor. */
430 + bool TryExtend( const ScAddress& rScPos, const XclMultipleOpRefs& rRefs );
432 + /** Finalizes the record. Tests on valid cell range and reference addresses. */
433 + void Finalize();
435 + /** Creates and returns the token array for a corresponding FORMULA cell record. */
436 + virtual XclTokenArrayRef CreateCellTokenArray( const XclExpRoot& rRoot ) const;
437 + /** Returns true, if the multiple operations range is volatile. */
438 + virtual bool IsVolatile() const;
439 + /** Writes the record if it is valid. */
440 + virtual void Save( XclExpStream& rStrm );
442 +private:
443 + /** Returns true, if the passed cell position can be appended to this record. */
444 + bool IsAppendable( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const;
446 + /** Writes the contents of the TABLEOP record. */
447 + virtual void WriteBody( XclExpStream& rStrm );
449 +private:
450 + SCTAB mnScTab; /// Sheet index of this record.
451 + sal_uInt16 mnLastAppXclCol;/// Column index of last appended cell.
452 + sal_uInt16 mnColInpXclCol; /// Column index of column input cell.
453 + sal_uInt32 mnColInpXclRow; /// Row index of column input cell.
454 + sal_uInt16 mnRowInpXclCol; /// Column index of row input cell.
455 + sal_uInt32 mnRowInpXclRow; /// Row index of row input cell.
456 + sal_uInt8 mnScMode; /// Type of the multiple operation (Calc constant).
457 + bool mbValid; /// true = Contains valid references.
460 +typedef ScfRef< XclExpTableop > XclExpTableopRef;
462 +// ----------------------------------------------------------------------------
464 +/** Contains all created TABLEOP records and supports creating or updating them. */
465 +class XclExpTableopBuffer : protected XclExpRoot
467 +public:
468 + explicit XclExpTableopBuffer( const XclExpRoot& rRoot );
470 + /** Tries to update an existing or to create a new TABLEOP record.
471 + @return Reference to the TABLEOP record for this cell (existing or new),
472 + or an empty reference, if rScTokArr does not contain a multiple
473 + operations formula. */
474 + XclExpTableopRef CreateOrExtendTableop(
475 + const ScTokenArray& rScTokArr, const ScAddress& rScPos );
477 + /** Finalizes all contained TABLEOP records. */
478 + void Finalize();
480 +private:
481 + /** Tries to create a new TABLEOP record, if rRefs contains valid references. */
482 + XclExpTableopRef TryCreate( const ScAddress& rScPos, const XclMultipleOpRefs& rRefs );
484 +private:
485 + typedef XclExpRecordList< XclExpTableop > XclExpTableopList;
486 + XclExpTableopList maTableopList; /// List of all TABLEOP records.
489 +// ============================================================================
490 +// Cell records
491 +// ============================================================================
493 +/** The base class of all cell records. */
494 +class XclExpCellBase : public XclExpRecord
496 +public:
497 + /** Returns the (first) address of the cell(s). */
498 + inline const XclAddress& GetXclPos() const { return maXclPos; }
499 + /** Returns the (first) Excel column index of the cell(s). */
500 + inline sal_uInt16 GetXclCol() const { return maXclPos.mnCol; }
501 + /** Returns the Excel row index of the cell. */
502 + inline sal_uInt32 GetXclRow() const { return maXclPos.mnRow; }
504 + /** Derived classes return the column index of the last contained cell. */
505 + virtual sal_uInt16 GetLastXclCol() const = 0;
506 + /** Derived classes return the XF identifier of the first contained cell. */
507 + virtual sal_uInt32 GetFirstXFId() const = 0;
508 + /** Derived classes return true, if this record does not contain at least one valid cell. */
509 + virtual bool IsEmpty() const = 0;
510 + /** Derived classes return whether the cell contains multi-line text. */
511 + virtual bool IsMultiLineText() const;
513 + /** Derived classes try to merge the contents of the passed cell to own data. */
514 + virtual bool TryMerge( const XclExpCellBase& rCell );
515 + /** Derived classes convert the XF identifier(s) into the Excel XF index(es).
516 + @param rXFIndexes The converted XF index(es) are inserted here. */
517 + virtual void ConvertXFIndexes( const XclExpRoot& rRoot ) = 0;
518 + /** Derived classes for blank cells insert the Excel XF index(es) into the passed vector. */
519 + virtual void GetBlankXFIndexes( ScfUInt16Vec& rXFIndexes ) const;
520 + /** Derived classes for blank cells remove unused Excel XF index(es). */
521 + virtual void RemoveUnusedBlankCells( const ScfUInt16Vec& rXFIndexes );
523 +protected:
524 + explicit XclExpCellBase(
525 + sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos );
527 + /** Sets this record to a new column position. */
528 + inline void SetXclCol( sal_uInt16 nXclCol ) { maXclPos.mnCol = nXclCol; }
529 + /** Sets this record to a new row position. */
530 + inline void SetXclRow( sal_uInt32 nXclRow ) { maXclPos.mnRow = nXclRow; }
532 +private:
533 + XclAddress maXclPos; /// Address of the cell.
536 +typedef ScfRef< XclExpCellBase > XclExpCellRef;
538 +// Single cell records ========================================================
540 +/** Base class for all cell records not supporting multiple contents. */
541 +class XclExpSingleCellBase : public XclExpCellBase
543 +public:
544 + /** Returns the last column, which is equal to the first column for single cells. */
545 + virtual sal_uInt16 GetLastXclCol() const;
546 + /** Return the XF identifier of the cell. */
547 + virtual sal_uInt32 GetFirstXFId() const;
548 + /** Returns true, if this record does not contain at least one valid cell. */
549 + virtual bool IsEmpty() const;
550 + /** Converts the XF identifier into the Excel XF index. */
551 + virtual void ConvertXFIndexes( const XclExpRoot& rRoot );
552 + /** Writes cell address, XF index, and calls WriteContents() for each cell. */
553 + virtual void Save( XclExpStream& rStrm );
555 +protected:
556 + explicit XclExpSingleCellBase( sal_uInt16 nRecId, sal_Size nContSize,
557 + const XclAddress& rXclPos, sal_uInt32 nXFId );
559 + explicit XclExpSingleCellBase( const XclExpRoot& rRoot,
560 + sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos,
561 + const ScPatternAttr* pPattern, sal_Int16 nScript, sal_uInt32 nForcedXFId );
563 + inline void SetContSize( sal_Size nContSize ) { mnContSize = nContSize; }
564 + inline sal_Size GetContSize() const { return mnContSize; }
566 + inline void SetXFId( sal_uInt32 nXFId ) { maXFId.mnXFId = nXFId; }
567 + inline sal_uInt32 GetXFId() const { return maXFId.mnXFId; }
569 +private:
570 + /** Writes cell address, XF index, and calls WriteContents() for each cell. */
571 + virtual void WriteBody( XclExpStream& rStrm );
572 + /** Derived classes write the contents of the specified cell (without XF index). */
573 + virtual void WriteContents( XclExpStream& rStrm ) = 0;
575 +private:
576 + XclExpXFId maXFId; /// The XF identifier of the cell formatting.
577 + sal_Size mnContSize; /// The size of the cell contents.
580 +// ----------------------------------------------------------------------------
582 +/** Represents a NUMBER record that describes a cell with a double value. */
583 +class XclExpNumberCell : public XclExpSingleCellBase
585 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpNumberCell )
587 +public:
588 + explicit XclExpNumberCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
589 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
590 + double fValue );
592 + virtual void SaveXml( XclExpXmlStream& rStrm );
593 +private:
594 + virtual void WriteContents( XclExpStream& rStrm );
596 +private:
597 + double mfValue; /// The cell value.
600 +// ----------------------------------------------------------------------------
602 +/** Represents a BOOLERR record that describes a cell with a Boolean value. */
603 +class XclExpBooleanCell : public XclExpSingleCellBase
605 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpBooleanCell )
607 +public:
608 + explicit XclExpBooleanCell( const XclExpRoot rRoot, const XclAddress& rXclPos,
609 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
610 + bool bValue );
612 + virtual void SaveXml( XclExpXmlStream& rStrm );
613 +private:
614 + virtual void WriteContents( XclExpStream& rStrm );
616 +private:
617 + bool mbValue; /// The cell value.
620 +// ----------------------------------------------------------------------------
622 +/** Represents a BOOLERR record that describes a cell with an error code. */
623 +class XclExpErrorCell : public XclExpSingleCellBase
625 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpErrorCell )
627 +public:
628 + explicit XclExpErrorCell( const XclExpRoot rRoot, const XclAddress& rXclPos,
629 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
630 + sal_uInt8 nErrCode );
632 + virtual void SaveXml( XclExpXmlStream& rStrm );
633 +private:
634 + virtual void WriteContents( XclExpStream& rStrm );
636 +private:
637 + sal_uInt8 mnErrCode; /// The error code.
640 +// ----------------------------------------------------------------------------
642 +class ScStringCell;
643 +class ScEditCell;
644 +class XclExpHyperlinkHelper;
646 +/** Represents a text cell record.
648 + May contain a BIFF2-BIFF7 LABEL record for a simple string, or a BIFF2-BIFF7
649 + RSTRING record for a formatted string, or a BIFF8 LABELSST string for any
650 + string (simply stores a reference to the Shared String Table).
651 + */
652 +class XclExpLabelCell : public XclExpSingleCellBase
654 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpLabelCell )
656 +public:
657 + /** Constructs the record from an unformatted Calc string cell. */
658 + explicit XclExpLabelCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
659 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
660 + const ScStringCell& rCell );
662 + /** Constructs the record from a formatted Calc edit cell. */
663 + explicit XclExpLabelCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
664 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
665 + const ScEditCell& rCell, XclExpHyperlinkHelper& rHlinkHelper );
667 + /** Returns true if the cell contains multi-line text. */
668 + virtual bool IsMultiLineText() const;
670 + virtual void SaveXml( XclExpXmlStream& rStrm );
671 +private:
672 + /** Initializes the record contents. Called from constructors. */
673 + void Init( const XclExpRoot& rRoot,
674 + const ScPatternAttr* pPattern, XclExpStringRef xText );
676 + virtual void WriteContents( XclExpStream& rStrm );
678 +private:
679 + XclExpStringRef mxText; /// The cell text.
680 + sal_uInt32 mnSstIndex; /// Index into Shared String Table (only used for BIFF8).
681 + bool mbLineBreak; /// True = cell has automatic linebreaks enabled.
684 +// ----------------------------------------------------------------------------
686 +class ScFormulaCell;
688 +/** Represents a FORMULA record that describes a cell with a formula. */
689 +class XclExpFormulaCell : public XclExpSingleCellBase
691 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpFormulaCell )
693 +public:
694 + explicit XclExpFormulaCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
695 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
696 + const ScFormulaCell& rScFmlaCell,
697 + XclExpArrayBuffer& rArrayBfr,
698 + XclExpShrfmlaBuffer& rShrfmlaBfr,
699 + XclExpTableopBuffer& rTableopBfr );
701 + /** Writes the FORMULA record and additional records related to the formula. */
702 + virtual void Save( XclExpStream& rStrm );
703 + virtual void SaveXml( XclExpXmlStream& rStrm );
705 +private:
706 + virtual void WriteContents( XclExpStream& rStrm );
708 +private:
709 + ScFormulaCell& mrScFmlaCell; /// The Calc formula cell.
710 + XclTokenArrayRef mxTokArr; /// The token array of the formula.
711 + XclExpRangeFmlaRef mxAddRec; /// Additional record for matrix/shared formulas.
712 + XclExpRecordRef mxStringRec; /// STRING record for string result.
715 +// Multiple cell records ======================================================
717 +struct XclExpMultiXFId : public XclExpXFId
719 + sal_uInt16 mnCount; /// Number of XF identifiers.
721 + inline explicit XclExpMultiXFId( sal_uInt32 nXFId, sal_uInt16 nCount = 1 ) :
722 + XclExpXFId( nXFId ), mnCount( nCount ) {}
725 +// ----------------------------------------------------------------------------
727 +/** Base class for all cell records supporting multiple contents. */
728 +class XclExpMultiCellBase : public XclExpCellBase
730 +public:
731 + /** Returns the column index of the last cell this record describes. */
732 + virtual sal_uInt16 GetLastXclCol() const;
733 + /** Return the XF identifier of the first contained cell. */
734 + virtual sal_uInt32 GetFirstXFId() const;
735 + /** Returns true, if this record does not contain at least one valid cell. */
736 + virtual bool IsEmpty() const;
738 + /** Convert all XF identifiers into the Excel XF indexes. */
739 + virtual void ConvertXFIndexes( const XclExpRoot& rRoot );
740 + /** Writes the record, calls WriteContents() for each contained cell.
741 + @descr May write several records, if unused XF indexes are contained. */
742 + virtual void Save( XclExpStream& rStrm );
743 + virtual void SaveXml( XclExpXmlStream& rStrm );
745 +protected:
746 + explicit XclExpMultiCellBase( sal_uInt16 nRecId, sal_uInt16 nMulRecId,
747 + sal_Size nContSize, const XclAddress& rXclPos );
749 + /** Sets the size of the remaining contents of one cell (without the XF index). */
750 + inline void SetContSize( sal_Size nContSize ) { mnContSize = nContSize; }
751 + /** Returns the size of the remaining contents of one cell (without the XF index). */
752 + inline sal_Size GetContSize() const { return mnContSize; }
754 + /** Returns the number of cells this record represents. */
755 + sal_uInt16 GetCellCount() const;
757 + /** Appends the passed XF identifier nCount times to the list of XF identifiers. */
758 + void AppendXFId( const XclExpMultiXFId& rXFId );
759 + /** Appends the passed cell format nCount times to the list of XF identifiers. */
760 + void AppendXFId( const XclExpRoot& rRoot,
761 + const ScPatternAttr* pPattern, sal_uInt16 nScript,
762 + sal_uInt32 nForcedXFId, sal_uInt16 nCount = 1 );
764 + /** Tries to merge the XF ID list of the passed cell with the own list. */
765 + bool TryMergeXFIds( const XclExpMultiCellBase& rCell );
766 + /** Inserts the Excel XF index(es) into the passed vector. */
767 + void GetXFIndexes( ScfUInt16Vec& rXFIndexes ) const;
769 + /** Removes unused Excel XF index(es).
770 + @param rXFIndexes Specifies which XF indexes are used. */
771 + void RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes );
773 +private:
774 + /** Derived classes write the remaining contents of the specified cell (without XF index).
775 + @param nRelCol Relative column index (starts with 0 for first cell of this record). */
776 + virtual void WriteContents( XclExpStream& rStrm, sal_uInt16 nRelCol ) = 0;
777 + virtual void WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& rAddress, sal_uInt32 nXFId, sal_uInt16 nRelCol ) = 0;
779 +private:
780 + typedef ::std::deque< XclExpMultiXFId > XclExpMultiXFIdDeq;
782 + sal_uInt16 mnMulRecId; /// Record ID for multiple record variant.
783 + sal_Size mnContSize; /// Data size of contents for one cell
784 + XclExpMultiXFIdDeq maXFIds; /// The XF identifiers of the cell formatting.
787 +// ----------------------------------------------------------------------------
789 +/** Represents a BLANK or MULBLANK record that describes empty but formatted cells. */
790 +class XclExpBlankCell : public XclExpMultiCellBase
792 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpBlankCell )
794 +public:
795 + explicit XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId );
797 + explicit XclExpBlankCell( const XclExpRoot& rRoot,
798 + const XclAddress& rXclPos, sal_uInt16 nLastXclCol,
799 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId );
801 + /** Tries to merge the contents of the passed cell to own data. */
802 + virtual bool TryMerge( const XclExpCellBase& rCell );
803 + /** Inserts the Excel XF index(es) into the passed vector. */
804 + virtual void GetBlankXFIndexes( ScfUInt16Vec& rXFIndexes ) const;
805 + /** Tries to remove unused Excel XF index(es). */
806 + virtual void RemoveUnusedBlankCells( const ScfUInt16Vec& rXFIndexes );
808 +private:
809 + /** Writes the remaining contents of the specified cell (without XF index). */
810 + virtual void WriteContents( XclExpStream& rStrm, sal_uInt16 nRelCol );
811 + virtual void WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& rAddress, sal_uInt32 nXFId, sal_uInt16 nRelCol );
814 +// ----------------------------------------------------------------------------
816 +/** Represents an RK or MULRK record that describes cells with a compressed double values. */
817 +class XclExpRkCell : public XclExpMultiCellBase
819 + DECL_FIXEDMEMPOOL_NEWDEL( XclExpRkCell )
821 +public:
822 + explicit XclExpRkCell( const XclExpRoot& rRoot, const XclAddress& rXclPos,
823 + const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId,
824 + sal_Int32 nRkValue );
826 + /** Tries to merge the contents of the passed cell to own data. */
827 + virtual bool TryMerge( const XclExpCellBase& rCell );
829 +private:
830 + /** Writes the remaining contents of the specified cell (without XF index). */
831 + virtual void WriteContents( XclExpStream& rStrm, sal_uInt16 nRelCol );
832 + virtual void WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& rAddress, sal_uInt32 nXFId, sal_uInt16 nRelCol );
834 +private:
835 + ScfInt32Vec maRkValues; /// The cell values.
838 +// ============================================================================
839 +// Rows and Columns
840 +// ============================================================================
842 +class ScOutlineArray;
844 +/** Base class for buffers containing row or column outline data. */
845 +class XclExpOutlineBuffer
847 +public:
848 + /** Returns true, if a collapsed group ends at the last processed position. */
849 + inline bool IsCollapsed() const { return mbCurrCollapse; }
850 + /** Returns the highest level of an open group at the last processed position. */
851 + inline sal_uInt8 GetLevel() const { return ::std::min( mnCurrLevel, EXC_OUTLINE_MAX ); }
853 +protected:
854 + /** Constructs the outline buffer.
855 + @param bRows true = Process row ouline array; false = Process column outline array. */
856 + explicit XclExpOutlineBuffer( const XclExpRoot& rRoot, bool bRows );
858 + /** Updates the current state by processing the settings at the passed Calc position. */
859 + void UpdateColRow( SCCOLROW nScPos );
861 +private:
862 + /** Data about an outline level. */
863 + struct XclExpLevelInfo
865 + SCCOLROW mnScEndPos; /// The end position of a group in a level.
866 + bool mbHidden; /// true = Group in this level is hidden.
867 + inline explicit XclExpLevelInfo() : mnScEndPos( 0 ), mbHidden( false ) {}
868 + };
869 + typedef ::std::vector< XclExpLevelInfo > XclExpLevelInfoVec;
871 + const ScOutlineArray* mpScOLArray; /// Pointer to Calc outline array.
872 + XclExpLevelInfoVec maLevelInfos; /// Info for current row and all levels.
873 + sal_uInt8 mnCurrLevel; /// Highest level of an open group for current position.
874 + bool mbCurrCollapse; /// true = Collapsed group ends at current position.
877 +// ----------------------------------------------------------------------------
879 +/** The outline buffer for column outlines. */
880 +class XclExpColOutlineBuffer : public XclExpOutlineBuffer
882 +public:
883 + inline explicit XclExpColOutlineBuffer( const XclExpRoot& rRoot ) :
884 + XclExpOutlineBuffer( rRoot, false ) {}
886 + /** Updates the current state by processing the settings of the passed Calc column. */
887 + inline void Update( SCCOL nScCol )
888 + { UpdateColRow( static_cast< SCCOLROW >( nScCol ) ); }
891 +// ----------------------------------------------------------------------------
893 +/** The outline buffer for row outlines. */
894 +class XclExpRowOutlineBuffer : public XclExpOutlineBuffer
896 +public:
897 + inline explicit XclExpRowOutlineBuffer( const XclExpRoot& rRoot ) :
898 + XclExpOutlineBuffer( rRoot, true ) {}
900 + /** Updates the current state by processing the settings of the passed Calc row. */
901 + inline void Update( SCROW nScRow )
902 + { UpdateColRow( static_cast< SCCOLROW >( nScRow ) ); }
905 +// ----------------------------------------------------------------------------
907 +/** Represents a GUTS record containing the level count of row and column outlines. */
908 +class XclExpGuts : public XclExpRecord
910 +public:
911 + explicit XclExpGuts( const XclExpRoot& rRoot );
913 +private:
914 + virtual void WriteBody( XclExpStream& rStrm );
916 +private:
917 + sal_uInt16 mnColLevels; /// Number of visible column outline levels.
918 + sal_uInt16 mnColWidth; /// Width of column outline area (pixels).
919 + sal_uInt16 mnRowLevels; /// Number of visible row outline levels.
920 + sal_uInt16 mnRowWidth; /// Width of row outline area (pixels).
923 +// ----------------------------------------------------------------------------
925 +/** Represents a DIMENSIONS record containing the used area of a sheet. */
926 +class XclExpDimensions : public XclExpRecord
928 +public:
929 + explicit XclExpDimensions( const XclExpRoot& rRoot );
931 + /** Sets the used area to the record. */
932 + void SetDimensions(
933 + sal_uInt16 nFirstUsedXclCol, sal_uInt32 nFirstUsedXclRow,
934 + sal_uInt16 nFirstFreeXclCol, sal_uInt32 nFirstFreeXclRow );
936 + virtual void SaveXml( XclExpXmlStream& rStrm );
937 +private:
938 + /** Writes the contents of the DIMENSIONS record. */
939 + virtual void WriteBody( XclExpStream& rStrm );
941 +private:
942 + sal_uInt32 mnFirstUsedXclRow; /// First used row.
943 + sal_uInt32 mnFirstFreeXclRow; /// First unused row after used area.
944 + sal_uInt16 mnFirstUsedXclCol; /// First used column.
945 + sal_uInt16 mnFirstFreeXclCol; /// First free column after used area.
948 +// ============================================================================
950 +/** Represents the DEFCOLWIDTH record containing the default column width of a sheet.
952 + Excel stores the default column width in entire character widths of the '0'
953 + character using the application default font (i.e. the default width is 10,
954 + if the '0' character fits 10 times into a cell in a column with default
955 + width.
957 + The IsDefWidth() function returns true, if the passed width (measured in
958 + 1/256 of the width of the '0' character) could be converted exactly to the
959 + default width. If the passed width is rounded up or down to get the default
960 + width, the function returns false.
961 + */
962 +class XclExpDefcolwidth : public XclExpUInt16Record, protected XclExpRoot
964 +public:
965 + explicit XclExpDefcolwidth( const XclExpRoot& rRoot );
967 + /** Returns true, if the own default width exactly matches the passed width. */
968 + bool IsDefWidth( sal_uInt16 nXclColWidth ) const;
970 + /** Sets the passed column width (in 1/256 character width) as default width. */
971 + void SetDefWidth( sal_uInt16 nXclColWidth );
974 +// ----------------------------------------------------------------------------
976 +/** Contains the column settings for a range of columns.
978 + After construction the record contains a temporary XF identifier returned
979 + from the XF buffer. After creating the entire Excel document in memory, the
980 + ConvertXFIndexes() function converts it into the real Excel XF index.
981 + */
982 +class XclExpColinfo : public XclExpRecord, protected XclExpRoot
984 +public:
985 + /** Constructs the record with the settings in the Calc document. */
986 + explicit XclExpColinfo( const XclExpRoot& rRoot,
987 + SCCOL nScCol, SCROW nLastScRow,
988 + XclExpColOutlineBuffer& rOutlineBfr );
990 + /** Converts the XF identifier into the Excel XF index, returns the latter. */
991 + sal_uInt16 ConvertXFIndexes();
993 + /** Tries to merge this record with the passed record.
994 + @descr Possible, if passed record directly follows this record and has equal contents.
995 + @return true = This record is equal to passed record and has been updated. */
996 + bool TryMerge( const XclExpColinfo& rColInfo );
998 + /** Returns the Excel width of the column(s). */
999 + inline sal_uInt16 GetColWidth() const { return mnWidth; }
1000 + /** Returns the final Excel XF index of the column(s). */
1001 + inline sal_uInt16 GetXFIndex() const { return maXFId.mnXFIndex; }
1002 + /** Returns the number of columns represented by this record. */
1003 + inline sal_uInt16 GetColCount() const { return mnLastXclCol - mnFirstXclCol + 1; }
1005 + /** Returns true, if the column has default format and width. */
1006 + bool IsDefault( const XclExpDefcolwidth& rDefColWidth ) const;
1008 + virtual void SaveXml( XclExpXmlStream& rStrm );
1010 +private:
1011 + /** Writes the contents of this COLINFO record. */
1012 + virtual void WriteBody( XclExpStream& rStrm );
1014 +private:
1015 + XclExpXFId maXFId; /// The XF identifier for column default format.
1016 + sal_uInt16 mnWidth; /// Excel width of the column.
1017 + sal_uInt16 mnFlags; /// Additional column flags.
1018 + sal_uInt16 mnFirstXclCol; /// Index to first column.
1019 + sal_uInt16 mnLastXclCol; /// Index to last column.
1022 +// ----------------------------------------------------------------------------
1024 +/** Contains COLINFO records for all columns of a Calc sheet.
1026 + On construction one COLINFO record per column is created. After creating
1027 + the entire Excel document in memory, the ConvertXFIndexes() function converts
1028 + all temporary XF identifiers into real Excel XF indexes and merges all equal
1029 + COLINFO records together.
1030 + */
1031 +class XclExpColinfoBuffer : public XclExpRecordBase, protected XclExpRoot
1033 +public:
1034 + explicit XclExpColinfoBuffer( const XclExpRoot& rRoot );
1036 + /** Initializes the buffer: finds settings and formatting of all columns.
1037 + @param nLastScRow Last row used to find default formatting. */
1038 + void Initialize( SCROW nLastScRow );
1039 + /** Converts the XF identifiers into the Excel XF indexes and merges equal columns.
1040 + @param rXFIndexes Returns the final XF indexes of all columns. */
1041 + void Finalize( ScfUInt16Vec& rXFIndexes );
1043 + /** Writes all COLINFO records of this buffer. */
1044 + virtual void Save( XclExpStream& rStrm );
1045 + virtual void SaveXml( XclExpXmlStream& rStrm );
1047 +private:
1048 + typedef XclExpRecordList< XclExpColinfo > XclExpColinfoList;
1049 + typedef XclExpColinfoList::RecordRefType XclExpColinfoRef;
1051 + XclExpColinfoList maColInfos; /// List of COLINFO records.
1052 + XclExpDefcolwidth maDefcolwidth; /// The DEFCOLWIDTH record.
1053 + XclExpColOutlineBuffer maOutlineBfr; /// Buffer for column outline groups.
1056 +// ============================================================================
1058 +class XclExpRow;
1060 +/** Contains all possible default row settings. */
1061 +struct XclExpDefaultRowData
1063 + sal_uInt16 mnFlags; /// Default flags for unspecified rows.
1064 + sal_uInt16 mnHeight; /// Default height for unspecified rows.
1066 + explicit XclExpDefaultRowData();
1067 + explicit XclExpDefaultRowData( const XclExpRow& rRow );
1069 + /** Returns true, if rows are hidden by default. */
1070 + inline bool IsHidden() const { return ::get_flag( mnFlags, EXC_DEFROW_HIDDEN ); }
1071 + /** Returns true, if the rows have a manually set height by default. */
1072 + inline bool IsUnsynced() const { return ::get_flag( mnFlags, EXC_DEFROW_UNSYNCED ); }
1075 +// ----------------------------------------------------------------------------
1077 +/** Represents a DEFROWHEIGHT record containing default format for unused rows. */
1078 +class XclExpDefrowheight : public XclExpRecord
1080 +public:
1081 + explicit XclExpDefrowheight();
1083 + /** Sets the passed default data as current record contents. */
1084 + void SetDefaultData( const XclExpDefaultRowData& rDefData );
1086 +private:
1087 + /** Writes the contents of the record. */
1088 + virtual void WriteBody( XclExpStream& rStrm );
1090 +private:
1091 + XclExpDefaultRowData maDefData; /// Record data.
1094 +// ----------------------------------------------------------------------------
1096 +/** Represents a ROW record and additionally contains all cells records of a row.
1098 + This class contains all cell records of a row in a spreadsheet. There are 2
1099 + cell records in Excel that support storing a range of cells in one record
1100 + (MULBLANK for multiple blank cells, and MULRK for multiple RK values). The
1101 + insertion functions try to merge a new inserted cell with existing
1102 + neighbors, if this is supported by the current type of cell record.
1104 + The Finalize() function converts the XF identifiers of all cell records to
1105 + the final Excel XF indexes. Then a default
1106 + */
1107 +class XclExpRow : public XclExpRecord, protected XclExpRoot
1109 +public:
1110 + /** Constructs the ROW record and converts the Calc row settings.
1111 + @param bAlwaysEmpty true = This row will not be filled with blank cells
1112 + in the Finalize() function. */
1113 + explicit XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
1114 + XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty );
1116 + /** Returns the excel row index of this ROW record. */
1117 + inline sal_uInt32 GetXclRow() const { return mnXclRow; }
1118 + /** Returns the height of the row in twips. */
1119 + inline sal_uInt16 GetHeight() const { return mnHeight; }
1120 + /** Returns true, if this row does not contain at least one valid cell. */
1121 + inline bool IsEmpty() const { return maCellList.IsEmpty(); }
1122 + /** Returns true, if this row is hidden. */
1123 + inline bool IsHidden() const { return ::get_flag( mnFlags, EXC_ROW_HIDDEN ); }
1124 + /** Returns true, if this row contains a manually set height. */
1125 + inline bool IsUnsynced() const { return ::get_flag( mnFlags, EXC_ROW_UNSYNCED ); }
1126 + /** Returns true, if this row is enabled (will be exported). */
1127 + inline bool IsEnabled() const { return mbEnabled; }
1129 + /** Appends the passed cell object to this row. */
1130 + void AppendCell( XclExpCellRef xCell, bool bIsMergedBase );
1132 + /** Converts all XF identifiers into the Excel XF indexes. */
1133 + void Finalize( const ScfUInt16Vec& rColXFIndexes );
1135 + /** Returns the column index of the first used cell in this row.
1136 + @descr This function can only be called after Finalize(). */
1137 + sal_uInt16 GetFirstUsedXclCol() const;
1138 + /** Returns the column index of the first unused cell following all used cells in this row.
1139 + @descr This function can only be called after Finalize(). */
1140 + sal_uInt16 GetFirstFreeXclCol() const;
1142 + /** Returns true, if this row may be omitted by using the DEFROWHEIGHT record.
1143 + @descr A row may be omitted, if it does not contain any cell or
1144 + explicit default cell formatting, and is not part of an outline.
1145 + This function can only be called after Finalize(). */
1146 + bool IsDefaultable() const;
1147 + /** Disables this row, if it is defaultable and has the passed default format.
1148 + @descr Disabled rows will not be saved.
1149 + This function can only be called after Finalize(). */
1150 + void DisableIfDefault( const XclExpDefaultRowData& rDefRowData );
1152 + /** Writes all cell records of this row. */
1153 + void WriteCellList( XclExpStream& rStrm );
1155 + /** Writes the ROW record if the row is not disabled (see DisableIfDefault() function). */
1156 + virtual void Save( XclExpStream& rStrm );
1157 + virtual void SaveXml( XclExpXmlStream& rStrm );
1159 +private:
1160 + /** Initializes the record data. Called from constructors. */
1161 + void Init( sal_uInt32 nXclRow, XclExpRowOutlineBuffer* pOutlineBfr );
1162 + /** Inserts a cell at the specified list position, tries to merge with neighbors. */
1163 + void InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase );
1165 + /** Writes the contents of the ROW record. */
1166 + virtual void WriteBody( XclExpStream& rStrm );
1168 +private:
1169 + typedef XclExpRecordList< XclExpCellBase > XclExpCellList;
1171 + XclExpCellList maCellList; /// List of cell records for this row.
1172 + sal_uInt32 mnXclRow; /// Excel row index of this row.
1173 + sal_uInt16 mnHeight; /// Row height in twips.
1174 + sal_uInt16 mnFlags; /// Flags for the ROW record.
1175 + sal_uInt16 mnXFIndex; /// Default row formatting.
1176 + sal_uInt16 mnOutlineLevel; /// Outline Level (for OOXML)
1177 + bool mbAlwaysEmpty; /// true = Do not add blank cells in Finalize().
1178 + bool mbEnabled; /// true = Write this ROW record.
1181 +// ----------------------------------------------------------------------------
1183 +/** Collects all rows which contain all cells of a sheet.
1185 + This row buffer automatically creates ROW records when cells are inserted
1186 + with the AppendCell() function. It is possible to force creation of more
1187 + ROW records with the CreateRows() function. In both cases, all preceding
1188 + missing ROW records are inserted too.
1189 + */
1190 +class XclExpRowBuffer : public XclExpRecordBase, protected XclExpRoot
1192 +public:
1193 + explicit XclExpRowBuffer( const XclExpRoot& rRoot );
1195 + /** Appends the passed cell object to the row that the cell specifies. */
1196 + void AppendCell( XclExpCellRef xCell, bool bIsMergedBase );
1197 + /** Forces insertion of all ROW records before the passed row. */
1198 + void CreateRows( SCROW nFirstFreeScRow );
1200 + /** Converts all XF identifiers into the Excel XF indexes and calculates default formats.
1201 + @param rDefRowData (out-param) The default row format is returned here.
1202 + @param rColXFIndexes The column default XF indexes. */
1203 + void Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt16Vec& rColXFIndexes );
1205 + /** Writes the DIMENSIONS record, all ROW records and all cell records. */
1206 + virtual void Save( XclExpStream& rStrm );
1207 + virtual void SaveXml( XclExpXmlStream& rStrm );
1209 + XclExpDimensions* GetDimensions();
1211 +private:
1212 + /** Returns access to the specified ROW record. Inserts preceding missing ROW records.
1213 + @param bRowAlwaysEmpty true = Created rows will not be filled with blank cells
1214 + in the XclExpRow::Finalize() function. */
1215 + XclExpRow& GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty );
1217 +private:
1218 + typedef XclExpRecordList< XclExpRow > XclExpRowList;
1219 + typedef XclExpRowList::RecordRefType XclExpRowRef;
1221 + XclExpRowList maRowList; /// List of all ROW records.
1222 + XclExpRowOutlineBuffer maOutlineBfr; /// Buffer for row outline groups.
1223 + XclExpDimensions maDimensions; /// DIMENSIONS record for used area.
1224 + XclExpRow* mpLastUsedRow; /// Last used row for faster access.
1225 + sal_uInt32 mnLastUsedXclRow; /// Last used row for faster access.
1228 +// ============================================================================
1229 +// Cell Table
1230 +// ============================================================================
1232 +class XclExpNote;
1233 +class XclExpMergedcells;
1234 +class XclExpHyperlink;
1235 +class XclExpDval;
1237 +/** This class contains the cell contents and more of an entire sheet.
1239 + The cell table includes the settings and default formatting of all columns,
1240 + the settings and default formatting of all used rows, and the contents of
1241 + all cells of one sheet in a spreadsheet document.
1243 + The constructor does all the work creating the cell table. It reads the
1244 + Calc sheet and converts all columns, rows, and cells to Excel record data.
1245 + Additioanlly, hyperlink records, note records, additional records for
1246 + formula cells, data validation records, and outline records are created.
1248 + The Finalize() function does even more work. It calculates default column
1249 + settings and removes column records that are equal to this default. The
1250 + same happens with rows: A default format is calculated for each row, and
1251 + all blank cells in this row that have the same format are removed. Then,
1252 + the most used row settings are calculated, and all empty rows that have the
1253 + same settings are removed too.
1255 + Records that are not stored inside the cell table area in an Excel file
1256 + (i.e. DEFROWHEIGHT record, NOTE records, MERGEDCELLS record, HLINK records,
1257 + DVAL and DV records for data validation) can be accessed with the function
1258 + CreateRecord(). It returns the reference to the respective record (or
1259 + record list) which can be inserted into a record list.
1260 + */
1261 +class XclExpCellTable : public XclExpRecordBase, protected XclExpRoot
1263 +public:
1264 + explicit XclExpCellTable( const XclExpRoot& rRoot );
1266 + /** Converts all XF identifiers into the Excel XF indexes and calculates default formats. */
1267 + void Finalize();
1269 + /** Returns the reference to an internal record specified by the passed record id.
1270 + @param nRecId The record identifier that specifies which record is
1271 + returned. Possible values are: EXC_ID_DEFROWHEIGHT, EXC_ID_NOTE,
1272 + EXC_ID_MERGEDCELLS, EXC_ID_HLINK, EXC_ID_DVAL. */
1273 + XclExpRecordRef CreateRecord( sal_uInt16 nRecId ) const;
1274 + /** Saves the entire cell table. */
1275 + virtual void Save( XclExpStream& rStrm );
1276 + virtual void SaveXml( XclExpXmlStream& rStrm );
1278 +private:
1279 + typedef XclExpRecordList< XclExpNote > XclExpNoteList;
1280 + typedef XclExpRecordList< XclExpHyperlink > XclExpHyperlinkList;
1282 + typedef ScfRef< XclExpDefrowheight > XclExpDefrowhRef;
1283 + typedef ScfRef< XclExpNoteList > XclExpNoteListRef;
1284 + typedef ScfRef< XclExpMergedcells > XclExpMergedcellsRef;
1285 + typedef ScfRef< XclExpHyperlinkList > XclExpHyperlinkRef;
1286 + typedef ScfRef< XclExpDval > XclExpDvalRef;
1288 + XclExpColinfoBuffer maColInfoBfr; /// Buffer for column formatting.
1289 + XclExpRowBuffer maRowBfr; /// Rows and cell records.
1290 + XclExpArrayBuffer maArrayBfr; /// Buffer for ARRAY records.
1291 + XclExpShrfmlaBuffer maShrfmlaBfr; /// Buffer for SHRFMLA records.
1292 + XclExpTableopBuffer maTableopBfr; /// Buffer for TABLEOP records.
1293 + XclExpDefrowhRef mxDefrowheight; /// DEFROWHEIGHT record for default row format.
1294 + XclExpRecordRef mxGuts; /// GUTS record for outline areas.
1295 + XclExpNoteListRef mxNoteList; /// List of NOTE records.
1296 + XclExpMergedcellsRef mxMergedcells; /// MERGEDCELLS record for merged cell ranges.
1297 + XclExpHyperlinkRef mxHyperlinkList; /// List of HLINK records.
1298 + XclExpDvalRef mxDval; /// Data validation with DVAL and DV records.
1301 +#endif
1303 diff --git sc/source/filter/inc/xlsx/xladdress.hxx sc/source/filter/inc/xlsx/xladdress.hxx
1304 new file mode 100644
1305 index 0000000..79ccc28
1306 --- /dev/null
1307 +++ sc/source/filter/inc/xlsx/xladdress.hxx
1308 @@ -0,0 +1,200 @@
1309 +/*************************************************************************
1311 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1313 + * Copyright 2008 by Sun Microsystems, Inc.
1315 + * OpenOffice.org - a multi-platform office productivity suite
1317 + * $RCSfile: xladdress.hxx,v $
1318 + * $Revision: 1.6 $
1320 + * This file is part of OpenOffice.org.
1322 + * OpenOffice.org is free software: you can redistribute it and/or modify
1323 + * it under the terms of the GNU Lesser General Public License version 3
1324 + * only, as published by the Free Software Foundation.
1326 + * OpenOffice.org is distributed in the hope that it will be useful,
1327 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1328 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1329 + * GNU Lesser General Public License version 3 for more details
1330 + * (a copy is included in the LICENSE file that accompanied this code).
1332 + * You should have received a copy of the GNU Lesser General Public License
1333 + * version 3 along with OpenOffice.org. If not, see
1334 + * <http://www.openoffice.org/license.html>
1335 + * for a copy of the LGPLv3 License.
1337 + ************************************************************************/
1339 +#ifndef SC_XLADDRESS_HXX
1340 +#define SC_XLADDRESS_HXX
1342 +#include <vector>
1343 +#include "address.hxx"
1345 +class ScRangeList;
1346 +class XclImpStream;
1347 +class XclExpStream;
1349 +// ============================================================================
1351 +/** A 2D cell address struct with Excel column and row indexes. */
1352 +struct XclAddress
1354 + sal_uInt16 mnCol;
1355 + sal_uInt32 mnRow;
1357 + inline explicit XclAddress( ScAddress::Uninitialized ) {}
1358 + inline explicit XclAddress() : mnCol( 0 ), mnRow( 0 ) {}
1359 + inline explicit XclAddress( sal_uInt16 nCol, sal_uInt32 nRow ) : mnCol( nCol ), mnRow( nRow ) {}
1361 + inline void Set( sal_uInt16 nCol, sal_uInt32 nRow ) { mnCol = nCol; mnRow = nRow; }
1363 + void Read( XclImpStream& rStrm, bool bCol16Bit = true );
1364 + void Write( XclExpStream& rStrm, bool bCol16Bit = true ) const;
1367 +inline bool operator==( const XclAddress& rL, const XclAddress& rR )
1369 + return (rL.mnCol == rR.mnCol) && (rL.mnRow == rR.mnRow);
1372 +inline bool operator<( const XclAddress& rL, const XclAddress& rR )
1374 + return (rL.mnCol < rR.mnCol) || ((rL.mnCol == rR.mnCol) && (rL.mnRow < rR.mnRow));
1377 +inline XclImpStream& operator>>( XclImpStream& rStrm, XclAddress& rXclPos )
1379 + rXclPos.Read( rStrm );
1380 + return rStrm;
1383 +inline XclExpStream& operator<<( XclExpStream& rStrm, const XclAddress& rXclPos )
1385 + rXclPos.Write( rStrm );
1386 + return rStrm;
1389 +// ----------------------------------------------------------------------------
1391 +/** A 2D cell range address struct with Excel column and row indexes. */
1392 +struct XclRange
1394 + XclAddress maFirst;
1395 + XclAddress maLast;
1397 + inline explicit XclRange( ScAddress::Uninitialized e ) : maFirst( e ), maLast( e ) {}
1398 + inline explicit XclRange() {}
1399 + inline explicit XclRange( const XclAddress& rPos ) : maFirst( rPos ), maLast( rPos ) {}
1400 + inline explicit XclRange( const XclAddress& rFirst, const XclAddress& rLast ) : maFirst( rFirst ), maLast( rLast ) {}
1401 + inline explicit XclRange( sal_uInt16 nCol1, sal_uInt32 nRow1, sal_uInt16 nCol2, sal_uInt32 nRow2 ) :
1402 + maFirst( nCol1, nRow1 ), maLast( nCol2, nRow2 ) {}
1404 + inline void Set( const XclAddress& rFirst, const XclAddress& rLast )
1405 + { maFirst = rFirst; maLast = rLast; }
1406 + inline void Set( sal_uInt16 nCol1, sal_uInt32 nRow1, sal_uInt16 nCol2, sal_uInt32 nRow2 )
1407 + { maFirst.Set( nCol1, nRow1 ); maLast.Set( nCol2, nRow2 ); }
1409 + inline sal_uInt16 GetColCount() const { return maLast.mnCol - maFirst.mnCol + 1; }
1410 + inline sal_uInt32 GetRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
1411 + bool Contains( const XclAddress& rPos ) const;
1413 + void Read( XclImpStream& rStrm, bool bCol16Bit = true );
1414 + void Write( XclExpStream& rStrm, bool bCol16Bit = true ) const;
1417 +inline bool operator==( const XclRange& rL, const XclRange& rR )
1419 + return (rL.maFirst == rR.maFirst) && (rL.maLast == rR.maLast);
1422 +inline bool operator<( const XclRange& rL, const XclRange& rR )
1424 + return (rL.maFirst < rR.maFirst) || ((rL.maFirst == rR.maFirst) && (rL.maLast < rR.maLast));
1427 +inline XclImpStream& operator>>( XclImpStream& rStrm, XclRange& rXclRange )
1429 + rXclRange.Read( rStrm );
1430 + return rStrm;
1433 +inline XclExpStream& operator<<( XclExpStream& rStrm, const XclRange& rXclRange )
1435 + rXclRange.Write( rStrm );
1436 + return rStrm;
1439 +// ----------------------------------------------------------------------------
1441 +/** A 2D cell range address list with Excel column and row indexes. */
1442 +class XclRangeList : public ::std::vector< XclRange >
1444 +public:
1445 + inline explicit XclRangeList() {}
1447 + XclRange GetEnclosingRange() const;
1449 + void Read( XclImpStream& rStrm, bool bCol16Bit = true );
1450 + void Write( XclExpStream& rStrm, bool bCol16Bit = true ) const;
1451 + void WriteSubList( XclExpStream& rStrm,
1452 + size_t nBegin, size_t nCount, bool bCol16Bit = true ) const;
1455 +inline XclImpStream& operator>>( XclImpStream& rStrm, XclRangeList& rXclRanges )
1457 + rXclRanges.Read( rStrm );
1458 + return rStrm;
1461 +inline XclExpStream& operator<<( XclExpStream& rStrm, const XclRangeList& rXclRanges )
1463 + rXclRanges.Write( rStrm );
1464 + return rStrm;
1467 +// ============================================================================
1469 +class XclTracer;
1471 +/** Base class for import/export address converters. */
1472 +class XclAddressConverterBase
1474 +public:
1475 + explicit XclAddressConverterBase( XclTracer& rTracer, const ScAddress& rMaxPos );
1476 + virtual ~XclAddressConverterBase();
1478 + /** Returns whether the "some columns have been cut" warning box should be shown. */
1479 + inline bool IsColTruncated() const { return mbColTrunc; }
1480 + /** Returns whether the "some rows have been cut" warning box should be shown. */
1481 + inline bool IsRowTruncated() const { return mbRowTrunc; }
1482 + /** Returns whether the "some sheets have been cut" warning box should be shown. */
1483 + inline bool IsTabTruncated() const { return mbTabTrunc; }
1485 + // ------------------------------------------------------------------------
1487 + /** Checks if the passed sheet index is valid.
1488 + @param nScTab The sheet index to check.
1489 + @param bWarn true = Sets the internal flag that produces a warning box
1490 + after loading/saving the file, if the sheet index is not valid.
1491 + @return true = Sheet index in nScTab is valid. */
1492 + bool CheckScTab( SCTAB nScTab, bool bWarn );
1494 + // ------------------------------------------------------------------------
1495 +protected:
1496 + XclTracer& mrTracer; /// Tracer for invalid addresses.
1497 + ScAddress maMaxPos; /// Default maximum position.
1498 + sal_uInt16 mnMaxCol; /// Maximum column index, as 16-bit value.
1499 + sal_uInt32 mnMaxRow; /// Maximum row index
1500 + bool mbColTrunc; /// Flag for "columns truncated" warning box.
1501 + bool mbRowTrunc; /// Flag for "rows truncated" warning box.
1502 + bool mbTabTrunc; /// Flag for "tables truncated" warning box.
1505 +// ============================================================================
1507 +#endif
1509 diff --git sc/source/filter/inc/xlsx/xlconst.hxx sc/source/filter/inc/xlsx/xlconst.hxx
1510 new file mode 100644
1511 index 0000000..bec17d3
1512 --- /dev/null
1513 +++ sc/source/filter/inc/xlsx/xlconst.hxx
1514 @@ -0,0 +1,236 @@
1515 +/*************************************************************************
1517 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1518 + *
1519 + * Copyright 2008 by Sun Microsystems, Inc.
1521 + * OpenOffice.org - a multi-platform office productivity suite
1523 + * $RCSfile: xlconst.hxx,v $
1524 + * $Revision: 1.29 $
1526 + * This file is part of OpenOffice.org.
1528 + * OpenOffice.org is free software: you can redistribute it and/or modify
1529 + * it under the terms of the GNU Lesser General Public License version 3
1530 + * only, as published by the Free Software Foundation.
1532 + * OpenOffice.org is distributed in the hope that it will be useful,
1533 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1534 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1535 + * GNU Lesser General Public License version 3 for more details
1536 + * (a copy is included in the LICENSE file that accompanied this code).
1538 + * You should have received a copy of the GNU Lesser General Public License
1539 + * version 3 along with OpenOffice.org. If not, see
1540 + * <http://www.openoffice.org/license.html>
1541 + * for a copy of the LGPLv3 License.
1543 + ************************************************************************/
1545 +#ifndef SC_XLCONST_HXX
1546 +#define SC_XLCONST_HXX
1548 +#include "address.hxx"
1550 +// Common =====================================================================
1552 +// BIFF versions --------------------------------------------------------------
1554 +/** An enumeration for all Excel file format types (BIFF types). */
1555 +enum XclBiff
1557 + EXC_BIFF2 = 0, /// MS Excel 2.1
1558 + EXC_BIFF3, /// MS Excel 3.0
1559 + EXC_BIFF4, /// MS Excel 4.0
1560 + EXC_BIFF5, /// MS Excel 5.0, MS Excel 7.0 (95)
1561 + EXC_BIFF8, /// MS Excel 8.0 (97), 9.0 (2000), 10.0 (XP), 11.0 (2003)
1562 + EXC_BIFF_UNKNOWN /// Unknown BIFF version.
1565 +/** An enumeration for all Excel output format types. */
1566 +enum XclOutput
1568 + EXC_OUTPUT_BINARY, /// MS Excel binary .xls
1569 + EXC_OUTPUT_XML_2007, /// MS Excel 2007 .xlsx
1572 +// Excel sheet dimensions -----------------------------------------------------
1574 +const SCCOL EXC_MAXCOL2 = 255;
1575 +const SCROW EXC_MAXROW2 = 16383;
1576 +const SCTAB EXC_MAXTAB2 = 0;
1578 +const SCCOL EXC_MAXCOL3 = EXC_MAXCOL2;
1579 +const SCROW EXC_MAXROW3 = EXC_MAXROW2;
1580 +const SCTAB EXC_MAXTAB3 = EXC_MAXTAB2;
1582 +const SCCOL EXC_MAXCOL4 = EXC_MAXCOL3;
1583 +const SCROW EXC_MAXROW4 = EXC_MAXROW3;
1584 +const SCTAB EXC_MAXTAB4 = 32767;
1586 +const SCCOL EXC_MAXCOL5 = EXC_MAXCOL4;
1587 +const SCROW EXC_MAXROW5 = EXC_MAXROW4;
1588 +const SCTAB EXC_MAXTAB5 = EXC_MAXTAB4;
1590 +const SCCOL EXC_MAXCOL8 = EXC_MAXCOL5;
1591 +const SCROW EXC_MAXROW8 = MAXROWCOUNT_DEFINE;
1592 +const SCTAB EXC_MAXTAB8 = EXC_MAXTAB5;
1594 +const sal_uInt16 EXC_NOTAB = SAL_MAX_UINT16; /// An invalid Excel sheet index, for common use.
1595 +const SCTAB SCTAB_INVALID = SCTAB_MAX; /// An invalid Calc sheet index, for common use.
1596 +const SCTAB SCTAB_GLOBAL = SCTAB_MAX; /// A Calc sheet index for the workbook globals.
1598 +// Storage/stream names -------------------------------------------------------
1600 +#define EXC_STORAGE_OLE_LINKED CREATE_STRING( "LNK" )
1601 +#define EXC_STORAGE_OLE_EMBEDDED CREATE_STRING( "MBD" )
1602 +#define EXC_STORAGE_VBA_PROJECT CREATE_STRING( "_VBA_PROJECT_CUR" )
1603 +#define EXC_STORAGE_VBA CREATE_STRING( "VBA" )
1605 +#define EXC_STREAM_BOOK CREATE_STRING( "Book" )
1606 +#define EXC_STREAM_WORKBOOK CREATE_STRING( "Workbook" )
1607 +#define EXC_STREAM_CTLS CREATE_STRING( "Ctls" )
1609 +// Encoded URLs ---------------------------------------------------------------
1611 +const sal_Unicode EXC_URLSTART_ENCODED = '\x01'; /// Encoded URL.
1612 +const sal_Unicode EXC_URLSTART_SELF = '\x02'; /// Reference to own workbook.
1613 +const sal_Unicode EXC_URLSTART_SELFENCODED = '\x03'; /// Encoded self reference.
1614 +const sal_Unicode EXC_URLSTART_OWNDOC = '\x04'; /// Reference to own workbook (BIFF5/BIFF7).
1616 +const sal_Unicode EXC_URL_DOSDRIVE = '\x01'; /// DOS drive letter or UNC server name.
1617 +const sal_Unicode EXC_URL_DRIVEROOT = '\x02'; /// Root directory of current drive.
1618 +const sal_Unicode EXC_URL_SUBDIR = '\x03'; /// Directory name delimiter.
1619 +const sal_Unicode EXC_URL_PARENTDIR = '\x04'; /// Parent directory.
1620 +const sal_Unicode EXC_URL_RAW = '\x05'; /// Unencoded URL.
1621 +const sal_Unicode EXC_URL_SHEETNAME = '\x09'; /// Sheet name starts here (BIFF4).
1623 +const sal_Unicode EXC_DDE_DELIM = '\x03'; /// DDE application-topic delimiter
1625 +// Error codes ----------------------------------------------------------------
1627 +const sal_uInt8 EXC_ERR_NULL = 0x00;
1628 +const sal_uInt8 EXC_ERR_DIV0 = 0x07;
1629 +const sal_uInt8 EXC_ERR_VALUE = 0x0F;
1630 +const sal_uInt8 EXC_ERR_REF = 0x17;
1631 +const sal_uInt8 EXC_ERR_NAME = 0x1D;
1632 +const sal_uInt8 EXC_ERR_NUM = 0x24;
1633 +const sal_uInt8 EXC_ERR_NA = 0x2A;
1635 +// Cached values list (EXTERNNAME, ptgArray, ...) -----------------------------
1637 +const sal_uInt8 EXC_CACHEDVAL_EMPTY = 0x00;
1638 +const sal_uInt8 EXC_CACHEDVAL_DOUBLE = 0x01;
1639 +const sal_uInt8 EXC_CACHEDVAL_STRING = 0x02;
1640 +const sal_uInt8 EXC_CACHEDVAL_BOOL = 0x04;
1641 +const sal_uInt8 EXC_CACHEDVAL_ERROR = 0x10;
1643 +// RK values ------------------------------------------------------------------
1645 +const sal_Int32 EXC_RK_100FLAG = 0x00000001;
1646 +const sal_Int32 EXC_RK_INTFLAG = 0x00000002;
1647 +const sal_Int32 EXC_RK_VALUEMASK = 0xFFFFFFFC;
1649 +const sal_Int32 EXC_RK_DBL = 0x00000000;
1650 +const sal_Int32 EXC_RK_DBL100 = EXC_RK_100FLAG;
1651 +const sal_Int32 EXC_RK_INT = EXC_RK_INTFLAG;
1652 +const sal_Int32 EXC_RK_INT100 = EXC_RK_100FLAG | EXC_RK_INTFLAG;
1654 +// Measures -------------------------------------------------------------------
1656 +const sal_Int32 EXC_POINTS_PER_INCH = 72;
1657 +const sal_Int32 EXC_TWIPS_PER_INCH = EXC_POINTS_PER_INCH * 20;
1659 +const sal_uInt8 EXC_ORIENT_NONE = 0; /// Text orientation: not rotated.
1660 +const sal_uInt8 EXC_ORIENT_STACKED = 1; /// Text orientation: vertically stacked.
1661 +const sal_uInt8 EXC_ORIENT_90CCW = 2; /// Text orientation: 90 deg counterclockwise.
1662 +const sal_uInt8 EXC_ORIENT_90CW = 3; /// Text orientation: 90 deg clockwise.
1664 +const sal_uInt8 EXC_ROT_NONE = 0; /// Text rotation: not rotated.
1665 +const sal_uInt8 EXC_ROT_90CCW = 90; /// Text rotation: 90 deg counterclockwise.
1666 +const sal_uInt8 EXC_ROT_90CW = 180; /// Text rotation: 90 deg clockwise.
1667 +const sal_uInt8 EXC_ROT_STACKED = 255; /// Text rotation: vertically stacked.
1669 +// Records (ordered by lowest record ID) ======================================
1671 +// (0x0009, 0x0209, 0x0409, 0x0809) BOF ---------------------------------------
1673 +const sal_uInt16 EXC_ID2_BOF = 0x0009;
1674 +const sal_uInt16 EXC_ID3_BOF = 0x0209;
1675 +const sal_uInt16 EXC_ID4_BOF = 0x0409;
1676 +const sal_uInt16 EXC_ID5_BOF = 0x0809;
1678 +const sal_uInt16 EXC_BOF_BIFF2 = 0x0200;
1679 +const sal_uInt16 EXC_BOF_BIFF3 = 0x0300;
1680 +const sal_uInt16 EXC_BOF_BIFF4 = 0x0400;
1681 +const sal_uInt16 EXC_BOF_BIFF5 = 0x0500;
1682 +const sal_uInt16 EXC_BOF_BIFF8 = 0x0600;
1684 +const sal_uInt16 EXC_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals.
1685 +const sal_uInt16 EXC_BOF_VBMODULE = 0x0006; /// BIFF5-BIFF8 Visual BASIC module.
1686 +const sal_uInt16 EXC_BOF_SHEET = 0x0010; /// Regular worksheet.
1687 +const sal_uInt16 EXC_BOF_CHART = 0x0020; /// Chart sheet.
1688 +const sal_uInt16 EXC_BOF_MACROSHEET = 0x0040; /// Macro sheet.
1689 +const sal_uInt16 EXC_BOF_WORKSPACE = 0x0100; /// Workspace.
1690 +const sal_uInt16 EXC_BOF_UNKNOWN = 0xFFFF; /// Internal use only.
1692 +// (0x000A) EOF ---------------------------------------------------------------
1694 +const sal_uInt16 EXC_ID_EOF = 0x000A;
1696 +// (0x0012) PROTECT -----------------------------------------------------------
1698 +const sal_uInt16 EXC_ID_PROTECT = 0x0012;
1700 +// (0x0013) PASSWORD ----------------------------------------------------------
1702 +const sal_uInt16 EXC_ID_PASSWORD = 0x0013;
1704 +// (0x0019) WINDOWPROTECT -----------------------------------------------------
1706 +const sal_uInt16 EXC_ID_WINDOWPROTECT = 0x0019;
1708 +// (0x0042) CODEPAGE ----------------------------------------------------------
1710 +const sal_uInt16 EXC_ID_CODEPAGE = 0x0042;
1712 +// (0x0081) WSBOOL ------------------------------------------------------------
1714 +const sal_uInt16 EXC_ID_WSBOOL = 0x0081;
1716 +const sal_uInt16 EXC_WSBOOL_ROWBELOW = 0x0040;
1717 +const sal_uInt16 EXC_WSBOOL_COLBELOW = 0x0080;
1718 +const sal_uInt16 EXC_WSBOOL_FITTOPAGE = 0x0100;
1720 +const sal_uInt16 EXC_WSBOOL_DEFAULTFLAGS = 0x04C1;
1722 +// (0x008C) COUNTRY -----------------------------------------------------------
1724 +const sal_uInt16 EXC_ID_COUNTRY = 0x008C;
1726 +// (0x009B) FILTERMODE --------------------------------------------------------
1728 +const sal_uInt16 EXC_ID_FILTERMODE = 0x009B;
1730 +// (0x009D) AUTOFILTERINFO ----------------------------------------------------
1732 +const sal_uInt16 EXC_ID_AUTOFILTERINFO = 0x009D;
1734 +// (0x009E) AUTOFILTER --------------------------------------------------------
1736 +const sal_uInt16 EXC_ID_AUTOFILTER = 0x009E;
1738 +// (0x0160) USESELFS ----------------------------------------------------------
1740 +const sal_uInt16 EXC_ID_USESELFS = 0x0160;
1742 +// (0x01AA,0x01AB) USERSVIEWBEGIN, USERSVIEWEND -------------------------------
1744 +const sal_uInt16 EXC_ID_USERSVIEWBEGIN = 0x01AA;
1745 +const sal_uInt16 EXC_ID_USERSVIEWEND = 0x01AB;
1747 +// ============================================================================
1749 +#endif
1751 diff --git sc/source/filter/inc/xlsx/xlformula.hxx sc/source/filter/inc/xlsx/xlformula.hxx
1752 new file mode 100644
1753 index 0000000..d8ffa5a
1754 --- /dev/null
1755 +++ sc/source/filter/inc/xlsx/xlformula.hxx
1756 @@ -0,0 +1,477 @@
1757 +/*************************************************************************
1759 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1760 + *
1761 + * Copyright 2008 by Sun Microsystems, Inc.
1763 + * OpenOffice.org - a multi-platform office productivity suite
1765 + * $RCSfile: xlformula.hxx,v $
1766 + * $Revision: 1.14 $
1768 + * This file is part of OpenOffice.org.
1770 + * OpenOffice.org is free software: you can redistribute it and/or modify
1771 + * it under the terms of the GNU Lesser General Public License version 3
1772 + * only, as published by the Free Software Foundation.
1774 + * OpenOffice.org is distributed in the hope that it will be useful,
1775 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1776 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1777 + * GNU Lesser General Public License version 3 for more details
1778 + * (a copy is included in the LICENSE file that accompanied this code).
1780 + * You should have received a copy of the GNU Lesser General Public License
1781 + * version 3 along with OpenOffice.org. If not, see
1782 + * <http://www.openoffice.org/license.html>
1783 + * for a copy of the LGPLv3 License.
1785 + ************************************************************************/
1787 +#ifndef SC_XLFORMULA_HXX
1788 +#define SC_XLFORMULA_HXX
1790 +#include <map>
1791 +#include "address.hxx"
1792 +#include "formula/opcode.hxx"
1793 +#include "ftools.hxx"
1795 +// Constants ==================================================================
1797 +const size_t EXC_TOKARR_MAXLEN = 4096; /// Maximum size of a token array.
1799 +// Token class flags ----------------------------------------------------------
1801 +const sal_uInt8 EXC_TOKCLASS_MASK = 0x60;
1802 +const sal_uInt8 EXC_TOKCLASS_INOP_FLAG = 0x80; /// Used in operators (internal flag).
1804 +const sal_uInt8 EXC_TOKCLASS_NONE = 0x00; /// 00-1F: Base tokens.
1805 +const sal_uInt8 EXC_TOKCLASS_REF = 0x20; /// 20-3F: Reference class tokens.
1806 +const sal_uInt8 EXC_TOKCLASS_VAL = 0x40; /// 40-5F: Value class tokens.
1807 +const sal_uInt8 EXC_TOKCLASS_ARR = 0x60; /// 60-7F: Array class tokens.
1809 +const sal_uInt8 EXC_TOKCLASS_ANY_IN_REFOP = EXC_TOKCLASS_INOP_FLAG | EXC_TOKCLASS_NONE;
1810 +const sal_uInt8 EXC_TOKCLASS_REF_IN_VALOP = EXC_TOKCLASS_INOP_FLAG | EXC_TOKCLASS_REF;
1811 +const sal_uInt8 EXC_TOKCLASS_VAL_IN_VALOP = EXC_TOKCLASS_INOP_FLAG | EXC_TOKCLASS_VAL;
1812 +const sal_uInt8 EXC_TOKCLASS_ARR_IN_VALOP = EXC_TOKCLASS_INOP_FLAG | EXC_TOKCLASS_ARR;
1814 +// Base tokens ----------------------------------------------------------------
1816 +const sal_uInt8 EXC_TOKID_MASK = 0x1F;
1818 +const sal_uInt8 EXC_TOKID_NONE = 0x00; /// Placeholder for invalid token id.
1819 +const sal_uInt8 EXC_TOKID_EXP = 0x01; /// Array or shared formula reference.
1820 +const sal_uInt8 EXC_TOKID_TBL = 0x02; /// Multiple operation reference.
1821 +const sal_uInt8 EXC_TOKID_ADD = 0x03; /// Addition operator.
1822 +const sal_uInt8 EXC_TOKID_SUB = 0x04; /// Subtraction operator.
1823 +const sal_uInt8 EXC_TOKID_MUL = 0x05; /// Multiplication operator.
1824 +const sal_uInt8 EXC_TOKID_DIV = 0x06; /// Division operator.
1825 +const sal_uInt8 EXC_TOKID_POWER = 0x07; /// Power operator.
1826 +const sal_uInt8 EXC_TOKID_CONCAT = 0x08; /// String concatenation operator.
1827 +const sal_uInt8 EXC_TOKID_LT = 0x09; /// Less than operator.
1828 +const sal_uInt8 EXC_TOKID_LE = 0x0A; /// Less than or equal operator.
1829 +const sal_uInt8 EXC_TOKID_EQ = 0x0B; /// Equal operator.
1830 +const sal_uInt8 EXC_TOKID_GE = 0x0C; /// Greater than or equal operator.
1831 +const sal_uInt8 EXC_TOKID_GT = 0x0D; /// Greater than operator.
1832 +const sal_uInt8 EXC_TOKID_NE = 0x0E; /// Not equal operator.
1833 +const sal_uInt8 EXC_TOKID_ISECT = 0x0F; /// Intersection operator.
1834 +const sal_uInt8 EXC_TOKID_LIST = 0x10; /// List operator.
1835 +const sal_uInt8 EXC_TOKID_RANGE = 0x11; /// Range operator.
1836 +const sal_uInt8 EXC_TOKID_UPLUS = 0x12; /// Unary plus.
1837 +const sal_uInt8 EXC_TOKID_UMINUS = 0x13; /// Unary minus.
1838 +const sal_uInt8 EXC_TOKID_PERCENT = 0x14; /// Percent sign.
1839 +const sal_uInt8 EXC_TOKID_PAREN = 0x15; /// Parentheses.
1840 +const sal_uInt8 EXC_TOKID_MISSARG = 0x16; /// Missing argument.
1841 +const sal_uInt8 EXC_TOKID_STR = 0x17; /// String constant.
1842 +const sal_uInt8 EXC_TOKID_NLR = 0x18; /// Natural language reference (NLR).
1843 +const sal_uInt8 EXC_TOKID_ATTR = 0x19; /// Special attribute.
1844 +const sal_uInt8 EXC_TOKID_SHEET = 0x1A; /// Start of a sheet reference (BIFF2-BIFF4).
1845 +const sal_uInt8 EXC_TOKID_ENDSHEET = 0x1B; /// End of a sheet reference (BIFF2-BIFF4).
1846 +const sal_uInt8 EXC_TOKID_ERR = 0x1C; /// Error constant.
1847 +const sal_uInt8 EXC_TOKID_BOOL = 0x1D; /// Boolean constant.
1848 +const sal_uInt8 EXC_TOKID_INT = 0x1E; /// Integer constant.
1849 +const sal_uInt8 EXC_TOKID_NUM = 0x1F; /// Floating-point constant.
1851 +// Base IDs of classified tokens ----------------------------------------------
1853 +const sal_uInt8 EXC_TOKID_ARRAY = 0x00; /// Array constant.
1854 +const sal_uInt8 EXC_TOKID_FUNC = 0x01; /// Function, fixed number of arguments.
1855 +const sal_uInt8 EXC_TOKID_FUNCVAR = 0x02; /// Function, variable number of arguments.
1856 +const sal_uInt8 EXC_TOKID_NAME = 0x03; /// Defined name.
1857 +const sal_uInt8 EXC_TOKID_REF = 0x04; /// 2D cell reference.
1858 +const sal_uInt8 EXC_TOKID_AREA = 0x05; /// 2D area reference.
1859 +const sal_uInt8 EXC_TOKID_MEMAREA = 0x06; /// Constant reference subexpression.
1860 +const sal_uInt8 EXC_TOKID_MEMERR = 0x07; /// Deleted reference subexpression.
1861 +const sal_uInt8 EXC_TOKID_MEMNOMEM = 0x08; /// Constant reference subexpression without result.
1862 +const sal_uInt8 EXC_TOKID_MEMFUNC = 0x09; /// Variable reference subexpression.
1863 +const sal_uInt8 EXC_TOKID_REFERR = 0x0A; /// Deleted 2D cell reference.
1864 +const sal_uInt8 EXC_TOKID_AREAERR = 0x0B; /// Deleted 2D area reference.
1865 +const sal_uInt8 EXC_TOKID_REFN = 0x0C; /// Relative 2D cell reference (in names).
1866 +const sal_uInt8 EXC_TOKID_AREAN = 0x0D; /// Relative 2D area reference (in names).
1867 +const sal_uInt8 EXC_TOKID_MEMAREAN = 0x0E; /// Reference subexpression (in names).
1868 +const sal_uInt8 EXC_TOKID_MEMNOMEMN = 0x0F; /// Reference subexpression (in names) without result.
1869 +const sal_uInt8 EXC_TOKID_FUNCCE = 0x18;
1870 +const sal_uInt8 EXC_TOKID_NAMEX = 0x19; /// External reference.
1871 +const sal_uInt8 EXC_TOKID_REF3D = 0x1A; /// 3D cell reference.
1872 +const sal_uInt8 EXC_TOKID_AREA3D = 0x1B; /// 3D area reference.
1873 +const sal_uInt8 EXC_TOKID_REFERR3D = 0x1C; /// Deleted 3D cell reference.
1874 +const sal_uInt8 EXC_TOKID_AREAERR3D = 0x1D; /// Deleted 3D area reference
1876 +// specific token constants ---------------------------------------------------
1878 +const sal_uInt16 EXC_TOK_STR_MAXLEN = 255; /// Maximum string length of a tStr token.
1880 +const sal_uInt8 EXC_TOK_BOOL_FALSE = 0; /// FALSE value of a tBool token.
1881 +const sal_uInt8 EXC_TOK_BOOL_TRUE = 1; /// TRUE value of a tBool token.
1883 +const sal_uInt8 EXC_TOK_ATTR_VOLATILE = 0x01; /// Volatile function.
1884 +const sal_uInt8 EXC_TOK_ATTR_IF = 0x02; /// Start of true condition in IF function.
1885 +const sal_uInt8 EXC_TOK_ATTR_CHOOSE = 0x04; /// Jump array of CHOOSE function.
1886 +const sal_uInt8 EXC_TOK_ATTR_GOTO = 0x08; /// Jump to token.
1887 +const sal_uInt8 EXC_TOK_ATTR_SUM = 0x10; /// SUM function with one parameter.
1888 +const sal_uInt8 EXC_TOK_ATTR_ASSIGN = 0x20; /// BASIC style assignment.
1889 +const sal_uInt8 EXC_TOK_ATTR_SPACE = 0x40; /// Spaces in formula representation.
1891 +const sal_uInt8 EXC_TOK_ATTR_SPACE_SP = 0x00; /// Spaces before next token.
1892 +const sal_uInt8 EXC_TOK_ATTR_SPACE_BR = 0x01; /// Line breaks before next token.
1893 +const sal_uInt8 EXC_TOK_ATTR_SPACE_SP_OPEN = 0x02; /// Spaces before opening parenthesis.
1894 +const sal_uInt8 EXC_TOK_ATTR_SPACE_BR_OPEN = 0x03; /// Line breaks before opening parenthesis.
1895 +const sal_uInt8 EXC_TOK_ATTR_SPACE_SP_CLOSE = 0x04; /// Spaces before closing parenthesis.
1896 +const sal_uInt8 EXC_TOK_ATTR_SPACE_BR_CLOSE = 0x05; /// Line breaks before closing parenthesis.
1897 +const sal_uInt8 EXC_TOK_ATTR_SPACE_SP_PRE = 0x06; /// Spaces before formula (BIFF3).
1899 +const sal_uInt16 EXC_TOK_FUNCVAR_CMD = 0x8000; /// Macro command.
1900 +const sal_uInt16 EXC_TOK_FUNCVAR_INDEXMASK = 0x7FFF; /// Mask for function/command index.
1901 +const sal_uInt8 EXC_TOK_FUNCVAR_PROMPT = 0x80; /// User prompt for macro commands.
1902 +const sal_uInt8 EXC_TOK_FUNCVAR_COUNTMASK = 0x7F; /// Mask for parameter count.
1904 +const sal_uInt16 EXC_TOK_REF_COLREL = 0x4000; /// True = Column is relative.
1905 +const sal_uInt32 EXC_TOK_REF_ROWREL = 0x8000; /// True = Row is relative.
1907 +const sal_uInt8 EXC_TOK_NLR_ERR = 0x01; /// NLR: Invalid/deleted.
1908 +const sal_uInt8 EXC_TOK_NLR_ROWR = 0x02; /// NLR: Row index.
1909 +const sal_uInt8 EXC_TOK_NLR_COLR = 0x03; /// NLR: Column index.
1910 +const sal_uInt8 EXC_TOK_NLR_ROWV = 0x06; /// NLR: Value in row.
1911 +const sal_uInt8 EXC_TOK_NLR_COLV = 0x07; /// NLR: Value in column.
1912 +const sal_uInt8 EXC_TOK_NLR_RANGE = 0x0A; /// NLR: Range.
1913 +const sal_uInt8 EXC_TOK_NLR_SRANGE = 0x0B; /// Stacked NLR: Range.
1914 +const sal_uInt8 EXC_TOK_NLR_SROWR = 0x0C; /// Stacked NLR: Row index.
1915 +const sal_uInt8 EXC_TOK_NLR_SCOLR = 0x0D; /// Stacked NLR: Column index.
1916 +const sal_uInt8 EXC_TOK_NLR_SROWV = 0x0E; /// Stacked NLR: Value in row.
1917 +const sal_uInt8 EXC_TOK_NLR_SCOLV = 0x0F; /// Stacked NLR: Value in column.
1918 +const sal_uInt8 EXC_TOK_NLR_RANGEERR = 0x10; /// NLR: Invalid/deleted range.
1919 +const sal_uInt8 EXC_TOK_NLR_SXNAME = 0x1D; /// NLR: Pivot table name.
1920 +const sal_uInt16 EXC_TOK_NLR_REL = 0x8000; /// True = Natural language ref is relative.
1922 +const sal_uInt32 EXC_TOK_NLR_ADDREL = 0x80000000; /// NLR relative (in appended data).
1923 +const sal_uInt32 EXC_TOK_NLR_ADDMASK = 0x3FFFFFFF; /// Mask for number of appended ranges.
1925 +// ----------------------------------------------------------------------------
1927 +/** Type of a formula. */
1928 +enum XclFormulaType
1930 + EXC_FMLATYPE_CELL, /// Simple cell formula, also used in change tracking.
1931 + EXC_FMLATYPE_MATRIX, /// Matrix (array) formula.
1932 + EXC_FMLATYPE_SHARED, /// Shared formula.
1933 + EXC_FMLATYPE_CONDFMT, /// Conditional format.
1934 + EXC_FMLATYPE_DATAVAL, /// Data validation.
1935 + EXC_FMLATYPE_NAME, /// Defined name.
1936 + EXC_FMLATYPE_CHART, /// Chart source ranges.
1937 + EXC_FMLATYPE_CONTROL, /// Spreadsheet links in form controls.
1938 + EXC_FMLATYPE_WQUERY, /// Web query source range.
1939 + EXC_FMLATYPE_LISTVAL /// List (cell range) validation.
1942 +// Function data ==============================================================
1944 +const sal_uInt8 EXC_FUNC_MAXPARAM = 30; /// Maximum parameter count.
1946 +const sal_uInt8 EXC_FUNC_PAR_CALCONLY = 0xFD; /// Placeholder for a parameter existing in Calc, but not in Excel.
1947 +const sal_uInt8 EXC_FUNC_PAR_EXCELONLY = 0xFE; /// Placeholder for a parameter existing in Excel, but not in Calc.
1948 +const sal_uInt8 EXC_FUNC_PAR_INVALID = 0xFF; /// Placeholder for an invalid token class.
1950 +const sal_uInt8 EXC_FUNCINFO_CLASSCOUNT = 5; /// Number of token class entries.
1952 +const sal_uInt8 EXC_FUNCFLAG_VOLATILE = 0x01; /// Result is volatile (e.g. NOW() function).
1953 +const sal_uInt8 EXC_FUNCFLAG_IMPORTONLY = 0x02; /// Only used in import filter.
1954 +const sal_uInt8 EXC_FUNCFLAG_EXPORTONLY = 0x04; /// Only used in export filter.
1956 +// selected function IDs
1957 +const sal_uInt16 EXC_FUNCID_IF = 1;
1958 +const sal_uInt16 EXC_FUNCID_SUM = 4;
1959 +const sal_uInt16 EXC_FUNCID_AND = 36;
1960 +const sal_uInt16 EXC_FUNCID_OR = 37;
1961 +const sal_uInt16 EXC_FUNCID_CHOOSE = 100;
1962 +const sal_uInt16 EXC_FUNCID_EXTERNCALL = 255;
1964 +/** Represents information for a spreadsheet function for import and export.
1966 + The member mpnParamClass contains an array of token classes for each
1967 + parameter of the function. The last existing (non-null) value in this array
1968 + is used for all following parameters used in a function. Additionally to
1969 + the three actual token classes, this array may contain the special values
1970 + EXC_FUNC_PAR_CALCONLY, EXC_FUNC_PAR_EXCELONLY, and EXC_FUNC_PAR_INVALID.
1971 + The former two specify parameters only existing in one of the applications.
1972 + EXC_FUNC_PAR_INVALID is simply a terminator for the array to prevent that
1973 + the last token class or special value is repeated for additional parameters.
1974 + */
1975 +struct XclFunctionInfo
1977 + OpCode meOpCode; /// Calc function opcode.
1978 + sal_uInt16 mnXclFunc; /// Excel function index.
1979 + sal_uInt8 mnMinParamCount; /// Minimum number of parameters.
1980 + sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
1981 + sal_uInt8 mnRetClass; /// Token class of the return value.
1982 + sal_uInt8 mpnParamClass[ EXC_FUNCINFO_CLASSCOUNT ]; /// Expected token classes of parameters.
1983 + sal_uInt8 mnFlags; /// Additional flags.
1984 + const sal_Char* mpcMacroName; /// Function name, if simulated by a macro call (UTF-8).
1986 + /** Returns true, if the function is volatile. */
1987 + inline bool IsVolatile() const { return ::get_flag( mnFlags, EXC_FUNCFLAG_VOLATILE ); }
1988 + /** Returns true, if the function is simulated by a macro call. */
1989 + inline bool IsMacroFunc() const { return mpcMacroName != 0; }
1990 + /** Returns the name of the external function as string. */
1991 + String GetMacroFuncName() const;
1994 +// ----------------------------------------------------------------------------
1996 +class XclRoot;
1998 +/** Provides access to function info structs for all available functions. */
1999 +class XclFunctionProvider
2001 +public:
2002 + explicit XclFunctionProvider( const XclRoot& rRoot );
2004 + /** Returns the function data for an Excel function index, or 0 on error. */
2005 + const XclFunctionInfo* GetFuncInfoFromXclFunc( sal_uInt16 nXclFunc ) const;
2006 + /** Returns the function data for an Excel function simulated by a macro call, or 0 on error. */
2007 + const XclFunctionInfo* GetFuncInfoFromXclMacroName( const String& rXclMacroName ) const;
2008 + /** Returns the function data for a Calc opcode, or 0 on error. */
2009 + const XclFunctionInfo* GetFuncInfoFromOpCode( OpCode eOpCode ) const;
2011 +private:
2012 + void FillXclFuncMap( const XclFunctionInfo* pBeg, const XclFunctionInfo* pEnd );
2013 + void FillScFuncMap( const XclFunctionInfo* pBeg, const XclFunctionInfo* pEnd );
2015 +private:
2016 + typedef ::std::map< sal_uInt16, const XclFunctionInfo* > XclFuncMap;
2017 + typedef ::std::map< String, const XclFunctionInfo* > XclMacroNameMap;
2018 + typedef ::std::map< OpCode, const XclFunctionInfo* > ScFuncMap;
2020 + XclFuncMap maXclFuncMap; /// Maps Excel function indexes to function data.
2021 + XclMacroNameMap maXclMacroNameMap; /// Maps macro function names to function data.
2022 + ScFuncMap maScFuncMap; /// Maps Calc opcodes to function data.
2025 +// Token array ================================================================
2027 +class XclImpStream;
2028 +class XclExpStream;
2030 +/** Binary representation of an Excel token array. */
2031 +class XclTokenArray
2033 +public:
2034 + /** Creates an empty token array. */
2035 + explicit XclTokenArray( bool bVolatile = false );
2036 + /** Creates a token array, swaps passed token vector into own data. */
2037 + explicit XclTokenArray( ScfUInt8Vec& rTokVec, bool bVolatile = false,
2038 + ScfUInt8Vec* pExtensionTokens = NULL);
2040 + /** Returns true, if the token array is empty. */
2041 + inline bool Empty() const { return maTokVec.empty(); }
2042 + /** Returns the size of the token array in bytes. */
2043 + sal_uInt16 GetSize() const;
2044 + /** Returns read-only access to the byte vector storing token data. */
2045 + inline const sal_uInt8* GetData() const { return maTokVec.empty() ? 0 : &maTokVec.front(); }
2046 + /** Returns true, if the formula contains a volatile function. */
2047 + inline bool IsVolatile() const { return mbVolatile; }
2049 + /** Reads the size field of the token array. */
2050 + void ReadSize( XclImpStream& rStrm );
2051 + /** Reads the tokens of the token array (without size field). */
2052 + void ReadArray( XclImpStream& rStrm );
2053 + /** Reads size field and the tokens. */
2054 + void Read( XclImpStream& rStrm );
2056 + /** Writes the size field of the token array. */
2057 + void WriteSize( XclExpStream& rStrm ) const;
2058 + /** Writes the tokens of the token array (without size field). */
2059 + void WriteArray( XclExpStream& rStrm ) const;
2060 + /** Writes size field and the tokens. */
2061 + void Write( XclExpStream& rStrm ) const;
2063 + /** Compares this token array with the passed. */
2064 + bool operator==( const XclTokenArray& rTokArr ) const;
2066 +private:
2067 + ScfUInt8Vec maTokVec; /// Byte vector containing token data.
2068 + ScfUInt8Vec maExtensions; /// Byte vector of extensions (eg inline arrays)
2069 + bool mbVolatile; /// True = Formula contains volatile function.
2072 +typedef ScfRef< XclTokenArray > XclTokenArrayRef;
2074 +/** Calls the Read() function at the passed token array. */
2075 +XclImpStream& operator>>( XclImpStream& rStrm, XclTokenArray& rTokArr );
2076 +/** Calls the Read() function at the passed token array. */
2077 +XclImpStream& operator>>( XclImpStream& rStrm, XclTokenArrayRef& rxTokArr );
2078 +/** Calls the Write() function at the passed token array. */
2079 +XclExpStream& operator<<( XclExpStream& rStrm, const XclTokenArray& rTokArr );
2080 +/** Calls the Write() function at the passed token array. */
2081 +XclExpStream& operator<<( XclExpStream& rStrm, const XclTokenArrayRef& rxTokArr );
2083 +// ----------------------------------------------------------------------------
2085 +namespace formula
2087 + class FormulaToken;
2089 +class ScTokenArray;
2091 +/** Special token array iterator for the Excel filters.
2093 + Iterates over a Calc token array without modifying it (therefore the
2094 + iterator can be used with constant token arrays).
2096 + Usage: Construct a new iterator object and pass a Calc token array, or use
2097 + the Init() function to assign another Calc token array. As long as the Is()
2098 + function returns true, the accessor functions can be used to get the
2099 + current Calc token.
2100 + */
2101 +class XclTokenArrayIterator
2103 +public:
2104 + explicit XclTokenArrayIterator();
2105 + explicit XclTokenArrayIterator( const ScTokenArray& rScTokArr, bool bSkipSpaces );
2106 + /** Copy constructor that allowa to change the skip-spaces mode. */
2107 + explicit XclTokenArrayIterator( const XclTokenArrayIterator& rTokArrIt, bool bSkipSpaces );
2109 + void Init();
2110 + void Init( const ScTokenArray& rScTokArr, bool bSkipSpaces );
2112 + inline bool Is() const { return mppScToken != 0; }
2113 + inline bool operator!() const { return !Is(); }
2114 + inline const formula::FormulaToken* Get() const { return mppScToken ? *mppScToken : 0; }
2115 + inline const formula::FormulaToken* operator->() const { return Get(); }
2116 + inline const formula::FormulaToken& operator*() const { return *Get(); }
2118 + XclTokenArrayIterator& operator++();
2120 +private:
2121 + void NextRawToken();
2122 + void SkipSpaces();
2124 +private:
2125 + const formula::FormulaToken*const* mppScTokenBeg; /// Pointer to first token pointer of token array.
2126 + const formula::FormulaToken*const* mppScTokenEnd; /// Pointer behind last token pointer of token array.
2127 + const formula::FormulaToken*const* mppScToken; /// Pointer to current token pointer of token array.
2128 + bool mbSkipSpaces; /// true = Skip whitespace tokens.
2131 +// ----------------------------------------------------------------------------
2133 +/** Contains all cell references that can be extracted from a multiple operations formula. */
2134 +struct XclMultipleOpRefs
2136 + ScAddress maFmlaScPos; /// Position of the (first) formula cell.
2137 + ScAddress maColFirstScPos;
2138 + ScAddress maColRelScPos;
2139 + ScAddress maRowFirstScPos;
2140 + ScAddress maRowRelScPos;
2141 + bool mbDblRefMode; /// true = One formula with row and column values.
2144 +// ----------------------------------------------------------------------------
2146 +/** A helper with Excel specific token array functions.
2148 + The purpose to not add these functions to ScTokenArray is to prevent code
2149 + changes in low-level Calc headers and to keep the Excel specific source
2150 + code in the filter directory. Deriving from ScTokenArray is not viable
2151 + because that would need expensive copy-constructions of the token arrays.
2152 + */
2153 +class XclTokenArrayHelper
2155 +public:
2156 + // token identifiers ------------------------------------------------------
2158 + /** Returns the base token ID of the passed (classified) token ID. */
2159 + inline static sal_uInt8 GetBaseTokenId( sal_uInt8 nTokenId ) { return nTokenId & EXC_TOKID_MASK; }
2160 + /** Returns the classified token ID from a base ID and the token class. */
2161 + inline static sal_uInt8 GetTokenId( sal_uInt8 nBaseId, sal_uInt8 nTokenClass );
2163 + /** Returns the token class of the passed token ID. */
2164 + inline static sal_uInt8 GetTokenClass( sal_uInt8 nTokenId ) { return nTokenId & EXC_TOKCLASS_MASK; }
2165 + /** Changes the token class in the passed classified token ID. */
2166 + inline static void ChangeTokenClass( sal_uInt8& rnTokenId, sal_uInt8 nTokenClass );
2168 + // strings and string lists -----------------------------------------------
2170 + /** Tries to extract a string from the passed token.
2171 + @param rString (out-parameter) The string contained in the token.
2172 + @return true = Passed token is a string token, rString parameter is valid. */
2173 + static bool GetTokenString( String& rString, const formula::FormulaToken& rScToken );
2175 + /** Parses the passed formula and tries to find a single string token, i.e. "abc".
2176 + @param rString (out-parameter) The string contained in the formula.
2177 + @return true = String token found, rString parameter is valid. */
2178 + static bool GetString( String& rString, const ScTokenArray& rScTokArr );
2180 + /** Parses the passed formula and tries to find a string token list, i.e. "abc";"def";"ghi".
2181 + @descr Returns the unquoted (!) strings in a single string, separated with the
2182 + passed character. If a comma is specified, the function will return abc,def,ghi from
2183 + the example above.
2184 + @param rStringList (out-parameter) All strings contained in the formula as list.
2185 + @param cSep List separator character.
2186 + @return true = String token list found, rString parameter is valid. */
2187 + static bool GetStringList( String& rStringList, const ScTokenArray& rScTokArr, sal_Unicode cSep );
2189 + /** Tries to convert a formula that consists of a single string token to a list of strings.
2190 + @descr Example: The formula ="abc\ndef\nghi" will be converted to the formula
2191 + ="abc";"def";"ghi", if the LF character is specified as separator.
2192 + @param rScTokArr (in/out-parameter) The token array to modify.
2193 + @param cStringSep The separator in the source string.
2194 + @param bTrimLeadingSpaces true = remove leading spaces from each token. */
2195 + static void ConvertStringToList( ScTokenArray& rScTokArr, sal_Unicode cStringSep, bool bTrimLeadingSpaces );
2197 + // shared formulas --------------------------------------------------------
2199 + /** Tries to extract the definition of a shared formula from the passed token array.
2200 + @descr Shared formulas are stored as hidden defined names in Calc. This
2201 + function looks if the passed token array consists of the reference to
2202 + such a hidden defined name and returns its definition on success. */
2203 + static const ScTokenArray* GetSharedFormula( const XclRoot& rRoot, const ScTokenArray& rScTokArr );
2205 + // multiple operations ----------------------------------------------------
2207 + /** Parses the passed formula and tries to extract references of a multiple operation.
2208 + @descr Requires that the formula contains a single MULTIPLE.OPERATION function call.
2209 + Spaces in the formula are silently ignored.
2210 + @return true = Multiple operation found, and all references successfully extracted. */
2211 + static bool GetMultipleOpRefs( XclMultipleOpRefs& rRefs, const ScTokenArray& rScTokArr );
2214 +// ----------------------------------------------------------------------------
2216 +inline sal_uInt8 XclTokenArrayHelper::GetTokenId( sal_uInt8 nBaseId, sal_uInt8 nTokenClass )
2218 + DBG_ASSERT( !::get_flag( nBaseId, static_cast< sal_uInt8 >( ~EXC_TOKID_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token ID" );
2219 + DBG_ASSERT( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token class" );
2220 + return nBaseId | nTokenClass;
2223 +inline void XclTokenArrayHelper::ChangeTokenClass( sal_uInt8& rnTokenId, sal_uInt8 nTokenClass )
2225 + DBG_ASSERT( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::ChangeTokenClass - invalid token class" );
2226 + ::set_flag( rnTokenId, EXC_TOKCLASS_MASK, false );
2227 + ::set_flag( rnTokenId, nTokenClass );
2230 +// ============================================================================
2232 +#endif
2234 diff --git sc/source/filter/xlsx/XclExpChangeTrack.hxx sc/source/filter/xlsx/XclExpChangeTrack.hxx
2235 index 59ec5db..0c6a0d7 100644
2236 --- sc/source/filter/xlsx/XclExpChangeTrack.hxx
2237 +++ sc/source/filter/xlsx/XclExpChangeTrack.hxx
2238 @@ -426,14 +426,14 @@ public:
2240 inline void XclExpChTrAction::Write2DAddress( XclExpStream& rStrm, const ScAddress& rAddress ) const
2242 - rStrm << (sal_uInt16) rAddress.Row()
2243 + rStrm << (sal_uInt32) rAddress.Row()
2244 << (sal_uInt16) rAddress.Col();
2247 inline void XclExpChTrAction::Write2DRange( XclExpStream& rStrm, const ScRange& rRange ) const
2249 - rStrm << (sal_uInt16) rRange.aStart.Row()
2250 - << (sal_uInt16) rRange.aEnd.Row()
2251 + rStrm << (sal_uInt32) rRange.aStart.Row()
2252 + << (sal_uInt32) rRange.aEnd.Row()
2253 << (sal_uInt16) rRange.aStart.Col()
2254 << (sal_uInt16) rRange.aEnd.Col();
2256 diff --git sc/source/filter/xlsx/excrecds.hxx sc/source/filter/xlsx/excrecds.hxx
2257 index 57744dc..2752561 100644
2258 --- sc/source/filter/xlsx/excrecds.hxx
2259 +++ sc/source/filter/xlsx/excrecds.hxx
2260 @@ -39,6 +39,9 @@
2263 #include <vector>
2264 +#include "xlsx/xladdress.hxx"
2265 +#include "xlsx/xlconst.hxx"
2266 +#include "xlsx/xlformula.hxx"
2267 #include "olinetab.hxx"
2268 #include "filter.hxx"
2269 #include "rangelst.hxx"
2270 diff --git sc/source/filter/xlsx/makefile.mk sc/source/filter/xlsx/makefile.mk
2271 index 63b9235..b31b352 100644
2272 --- sc/source/filter/xlsx/makefile.mk
2273 +++ sc/source/filter/xlsx/makefile.mk
2274 @@ -46,6 +46,8 @@ PROJECTPCHSOURCE=..\pch\filt_pch
2275 .INCLUDE : settings.mk
2276 .INCLUDE : sc.mk
2278 +CFLAGS+=-DXLSX_COPY
2280 # --- Files --------------------------------------------------------
2282 SLOFILES = \
2283 diff --git sc/source/filter/xlsx/xestream.hxx sc/source/filter/xlsx/xestream.hxx
2284 index e18fe72..3863e8b 100644
2285 --- sc/source/filter/xlsx/xestream.hxx
2286 +++ sc/source/filter/xlsx/xestream.hxx
2287 @@ -40,6 +40,9 @@
2288 #include <oox/core/xmlfilterbase.hxx>
2289 #include <sax/fshelper.hxx>
2291 +#include "xlsx/xladdress.hxx"
2292 +#include "xlsx/xlconst.hxx"
2293 +#include "xlsx/xlformula.hxx"
2294 #include "xlstream.hxx"
2295 #include "xestring.hxx"
2297 diff --git sc/source/filter/xlsx/xlsx-colrowst.cxx sc/source/filter/xlsx/xlsx-colrowst.cxx
2298 index 9c686fe..996303a 100644
2299 --- sc/source/filter/xlsx/xlsx-colrowst.cxx
2300 +++ sc/source/filter/xlsx/xlsx-colrowst.cxx
2301 @@ -31,7 +31,8 @@
2302 // MARKER(update_precomp.py): autogen include statement, do not remove
2303 #include "precompiled_sc.hxx"
2306 +#include "xlsx/xladdress.hxx"
2307 +#include "xlsx/xlconst.hxx"
2309 #include "colrowst.hxx"
2311 diff --git sc/source/filter/xlsx/xlsx-excdoc.cxx sc/source/filter/xlsx/xlsx-excdoc.cxx
2312 index 0e213f6..29ab499 100644
2313 --- sc/source/filter/xlsx/xlsx-excdoc.cxx
2314 +++ sc/source/filter/xlsx/xlsx-excdoc.cxx
2315 @@ -31,6 +31,10 @@
2316 // MARKER(update_precomp.py): autogen include statement, do not remove
2317 #include "precompiled_sc.hxx"
2319 +#include "xlsx/xladdress.hxx"
2320 +#include "xlsx/xlconst.hxx"
2321 +#include "xlsx/xlformula.hxx"
2322 +#include "xlsx/xetable.hxx"
2324 //------------------------------------------------------------------------
2326 diff --git sc/source/filter/xlsx/xlsx-excel.cxx sc/source/filter/xlsx/xlsx-excel.cxx
2327 index d19958d..cbc4a16 100644
2328 --- sc/source/filter/xlsx/xlsx-excel.cxx
2329 +++ sc/source/filter/xlsx/xlsx-excel.cxx
2330 @@ -31,6 +31,9 @@
2331 // MARKER(update_precomp.py): autogen include statement, do not remove
2332 #include "precompiled_sc.hxx"
2334 +#include "xlsx/xladdress.hxx"
2335 +#include "xlsx/xlconst.hxx"
2336 +#include "xlsx/xlformula.hxx"
2337 #include <sfx2/docfile.hxx>
2338 #include <sfx2/objsh.hxx>
2339 #include <sfx2/app.hxx>
2340 diff --git sc/source/filter/xlsx/xlsx-excform.cxx sc/source/filter/xlsx/xlsx-excform.cxx
2341 index f30eb80..b6cf22c 100644
2342 --- sc/source/filter/xlsx/xlsx-excform.cxx
2343 +++ sc/source/filter/xlsx/xlsx-excform.cxx
2344 @@ -30,6 +30,9 @@
2346 // MARKER(update_precomp.py): autogen include statement, do not remove
2347 #include "precompiled_sc.hxx"
2348 +#include "xlsx/xladdress.hxx"
2349 +#include "xlsx/xlconst.hxx"
2350 +#include "xlsx/xlformula.hxx"
2351 #include "excform.hxx"
2352 #include <osl/endian.h>
2354 diff --git sc/source/filter/xlsx/xlsx-excform8.cxx sc/source/filter/xlsx/xlsx-excform8.cxx
2355 index c6340a1..24f50b1 100644
2356 --- sc/source/filter/xlsx/xlsx-excform8.cxx
2357 +++ sc/source/filter/xlsx/xlsx-excform8.cxx
2358 @@ -30,6 +30,9 @@
2360 // MARKER(update_precomp.py): autogen include statement, do not remove
2361 #include "precompiled_sc.hxx"
2362 +#include "xlsx/xladdress.hxx"
2363 +#include "xlsx/xlconst.hxx"
2364 +#include "xlsx/xlformula.hxx"
2365 #include "excform.hxx"
2367 #include "cell.hxx"
2368 diff --git sc/source/filter/xlsx/xlsx-excimp8.cxx sc/source/filter/xlsx/xlsx-excimp8.cxx
2369 index 60c2f6d..2995571 100644
2370 --- sc/source/filter/xlsx/xlsx-excimp8.cxx
2371 +++ sc/source/filter/xlsx/xlsx-excimp8.cxx
2372 @@ -31,6 +31,9 @@
2373 // MARKER(update_precomp.py): autogen include statement, do not remove
2374 #include "precompiled_sc.hxx"
2376 +#include "xlsx/xladdress.hxx"
2377 +#include "xlsx/xlconst.hxx"
2378 +#include "xlsx/xlformula.hxx"
2379 #include "excimp8.hxx"
2382 diff --git sc/source/filter/xlsx/xlsx-exctools.cxx sc/source/filter/xlsx/xlsx-exctools.cxx
2383 index 4243edf..365b31a 100644
2384 --- sc/source/filter/xlsx/xlsx-exctools.cxx
2385 +++ sc/source/filter/xlsx/xlsx-exctools.cxx
2386 @@ -390,7 +390,7 @@ void ExcScenario::Apply( const XclImpRoot& rRoot, const BOOL bLast )
2387 while( p )
2389 UINT16 nCol = p->nCol;
2390 - UINT16 nRow = p->nRow;
2391 + sal_uInt32 nRow = p->nRow;
2392 String aVal = p->GetValue();
2394 r.ApplyFlagsTab( nCol, nRow, nCol, nRow, nNewTab, SC_MF_SCENARIO );
2395 diff --git sc/source/filter/xlsx/xlsx-expop2.cxx sc/source/filter/xlsx/xlsx-expop2.cxx
2396 index b4763c4..3561bf7 100644
2397 --- sc/source/filter/xlsx/xlsx-expop2.cxx
2398 +++ sc/source/filter/xlsx/xlsx-expop2.cxx
2399 @@ -31,6 +31,9 @@
2400 // MARKER(update_precomp.py): autogen include statement, do not remove
2401 #include "precompiled_sc.hxx"
2403 +#include "xlsx/xladdress.hxx"
2404 +#include "xlsx/xlconst.hxx"
2405 +#include "xlsx/xlformula.hxx"
2408 //------------------------------------------------------------------------
2409 diff --git sc/source/filter/xlsx/xlsx-impop.cxx sc/source/filter/xlsx/xlsx-impop.cxx
2410 index 666ce76..35fb4fc 100644
2411 --- sc/source/filter/xlsx/xlsx-impop.cxx
2412 +++ sc/source/filter/xlsx/xlsx-impop.cxx
2413 @@ -30,6 +30,9 @@
2415 // MARKER(update_precomp.py): autogen include statement, do not remove
2416 #include "precompiled_sc.hxx"
2417 +#include "xlsx/xladdress.hxx"
2418 +#include "xlsx/xlconst.hxx"
2419 +#include "xlsx/xlformula.hxx"
2421 #include "imp_op.hxx"
2423 diff --git sc/source/filter/xlsx/xlsx-namebuff.cxx sc/source/filter/xlsx/xlsx-namebuff.cxx
2424 index 0c42767..eb4e73a 100644
2425 --- sc/source/filter/xlsx/xlsx-namebuff.cxx
2426 +++ sc/source/filter/xlsx/xlsx-namebuff.cxx
2427 @@ -30,6 +30,9 @@
2429 // MARKER(update_precomp.py): autogen include statement, do not remove
2430 #include "precompiled_sc.hxx"
2431 +#include "xlsx/xladdress.hxx"
2432 +#include "xlsx/xlconst.hxx"
2433 +#include "xlsx/xlformula.hxx"
2435 #include "namebuff.hxx"
2437 diff --git sc/source/filter/xlsx/xlsx-read.cxx sc/source/filter/xlsx/xlsx-read.cxx
2438 index 6c1e50a..86f108c 100644
2439 --- sc/source/filter/xlsx/xlsx-read.cxx
2440 +++ sc/source/filter/xlsx/xlsx-read.cxx
2441 @@ -30,6 +30,9 @@
2443 // MARKER(update_precomp.py): autogen include statement, do not remove
2444 #include "precompiled_sc.hxx"
2445 +#include "xlsx/xladdress.hxx"
2446 +#include "xlsx/xlconst.hxx"
2447 +#include "xlsx/xlformula.hxx"
2451 diff --git sc/source/filter/xlsx/xlsx-xcl97esc.cxx sc/source/filter/xlsx/xlsx-xcl97esc.cxx
2452 index e4f2344..828a7a1 100644
2453 --- sc/source/filter/xlsx/xlsx-xcl97esc.cxx
2454 +++ sc/source/filter/xlsx/xlsx-xcl97esc.cxx
2455 @@ -30,6 +30,9 @@
2457 // MARKER(update_precomp.py): autogen include statement, do not remove
2458 #include "precompiled_sc.hxx"
2459 +#include "xlsx/xladdress.hxx"
2460 +#include "xlsx/xlconst.hxx"
2461 +#include "xlsx/xlformula.hxx"
2463 #include <com/sun/star/awt/XControlModel.hpp>
2464 #include <com/sun/star/embed/XClassifiedObject.hpp>
2465 diff --git sc/source/filter/xlsx/xlsx-xechart.cxx sc/source/filter/xlsx/xlsx-xechart.cxx
2466 index cf3f218..5198737 100644
2467 --- sc/source/filter/xlsx/xlsx-xechart.cxx
2468 +++ sc/source/filter/xlsx/xlsx-xechart.cxx
2469 @@ -31,6 +31,9 @@
2470 // MARKER(update_precomp.py): autogen include statement, do not remove
2471 #include "precompiled_sc.hxx"
2473 +#include "xlsx/xladdress.hxx"
2474 +#include "xlsx/xlconst.hxx"
2475 +#include "xlsx/xlformula.hxx"
2476 #include "xechart.hxx"
2478 #include <com/sun/star/i18n/XBreakIterator.hpp>
2479 diff --git sc/source/filter/xlsx/xlsx-xecontent.cxx sc/source/filter/xlsx/xlsx-xecontent.cxx
2480 index 9b8986e..3117555 100644
2481 --- sc/source/filter/xlsx/xlsx-xecontent.cxx
2482 +++ sc/source/filter/xlsx/xlsx-xecontent.cxx
2483 @@ -30,6 +30,9 @@
2485 // MARKER(update_precomp.py): autogen include statement, do not remove
2486 #include "precompiled_sc.hxx"
2487 +#include "xlsx/xladdress.hxx"
2488 +#include "xlsx/xlconst.hxx"
2489 +#include "xlsx/xlformula.hxx"
2490 #include "xecontent.hxx"
2492 #include <list>
2493 @@ -526,7 +529,7 @@ String XclExpHyperlink::BuildFileName(
2494 void XclExpHyperlink::WriteBody( XclExpStream& rStrm )
2496 sal_uInt16 nXclCol = static_cast< sal_uInt16 >( maScPos.Col() );
2497 - sal_uInt16 nXclRow = static_cast< sal_uInt16 >( maScPos.Row() );
2498 + sal_uInt32 nXclRow = static_cast< sal_uInt32 >( maScPos.Row() );
2499 rStrm << nXclRow << nXclRow << nXclCol << nXclCol;
2500 WriteEmbeddedData( rStrm );
2502 diff --git sc/source/filter/xlsx/xlsx-xeescher.cxx sc/source/filter/xlsx/xlsx-xeescher.cxx
2503 index d3d10ff..43c6f54 100644
2504 --- sc/source/filter/xlsx/xlsx-xeescher.cxx
2505 +++ sc/source/filter/xlsx/xlsx-xeescher.cxx
2506 @@ -948,14 +948,14 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm )
2507 FSEND );
2508 rComments->startElement( XML_text, FSEND );
2509 // OOXTODO: phoneticPr, rPh, r
2510 -#if 0
2511 - rComments->startElement( XML_t, FSEND );
2512 - rComments->writeEscaped( XclXmlUtils::ToOUString( maOrigNoteText ) );
2513 - rComments->endElement ( XML_t );
2514 -#else
2515 if( mpNoteContents.is() )
2516 mpNoteContents->WriteXml( rStrm );
2517 -#endif
2518 + else
2520 + rComments->startElement( XML_t, FSEND );
2521 + rComments->writeEscaped( XclXmlUtils::ToOUString( maOrigNoteText ) );
2522 + rComments->endElement ( XML_t );
2524 rComments->endElement( XML_text );
2525 rComments->endElement( XML_comment );
2527 diff --git sc/source/filter/xlsx/xlsx-xeformula.cxx sc/source/filter/xlsx/xlsx-xeformula.cxx
2528 index 956d72a..31af0f9 100644
2529 --- sc/source/filter/xlsx/xlsx-xeformula.cxx
2530 +++ sc/source/filter/xlsx/xlsx-xeformula.cxx
2531 @@ -429,7 +429,7 @@ private:
2532 const SCsCOL mnMaxScCol; /// Maximum column index in Calc itself.
2533 const SCsROW mnMaxScRow; /// Maximum row index in Calc itself.
2534 const sal_uInt16 mnMaxColMask; /// Mask to delete invalid bits in column fields.
2535 - const sal_uInt16 mnMaxRowMask; /// Mask to delete invalid bits in row fields.
2536 + const sal_uInt32 mnMaxRowMask; /// Mask to delete invalid bits in row fields.
2537 bool mbRunning; /// true = compiler already running (for recursive calls).
2540 @@ -466,7 +466,7 @@ XclExpFmlaCompImpl::XclExpFmlaCompImpl( const XclExpRoot& rRoot ) :
2541 mnMaxScCol( static_cast< SCsCOL >( rRoot.GetScMaxPos().Col() ) ),
2542 mnMaxScRow( static_cast< SCsROW >( rRoot.GetScMaxPos().Row() ) ),
2543 mnMaxColMask( static_cast< sal_uInt16 >( rRoot.GetXclMaxPos().Col() ) ),
2544 - mnMaxRowMask( static_cast< sal_uInt16 >( rRoot.GetXclMaxPos().Row() ) ),
2545 + mnMaxRowMask( static_cast< sal_uInt32 >( rRoot.GetXclMaxPos().Row() ) ),
2546 mbRunning( false )
2548 // build the configuration map
2549 @@ -1863,7 +1863,7 @@ void XclExpFmlaCompImpl::ConvertRefData(
2550 rnScRow = mnMaxAbsRow;
2551 else if( (rnScRow < 0) || (rnScRow > mnMaxAbsRow) )
2552 rRefData.SetRowDeleted( TRUE );
2553 - rXclPos.mnRow = static_cast< sal_uInt16 >( rnScRow ) & mnMaxRowMask;
2554 + rXclPos.mnRow = static_cast< sal_uInt32 >( rnScRow ) & mnMaxRowMask;
2556 else
2558 @@ -1874,8 +1874,8 @@ void XclExpFmlaCompImpl::ConvertRefData(
2559 rXclPos.mnCol = static_cast< sal_uInt16 >( nXclRelCol ) & mnMaxColMask;
2561 // convert row index (2-step-cast ScsROW->sal_Int16->sal_uInt16 to get all bits correctly)
2562 - sal_Int16 nXclRelRow = static_cast< sal_Int16 >( rRefData.IsRowRel() ? rRefData.nRelRow : rRefData.nRow );
2563 - rXclPos.mnRow = static_cast< sal_uInt16 >( nXclRelRow ) & mnMaxRowMask;
2564 + sal_Int32 nXclRelRow = static_cast< sal_Int32 >( rRefData.IsRowRel() ? rRefData.nRelRow : rRefData.nRow );
2565 + rXclPos.mnRow = static_cast< sal_uInt32 >( nXclRelRow ) & mnMaxRowMask;
2568 // flags for relative column and row
2569 @@ -1887,9 +1887,16 @@ void XclExpFmlaCompImpl::ConvertRefData(
2571 else
2573 - sal_uInt16& rnRelField = (meBiff <= EXC_BIFF5) ? rXclPos.mnRow : rXclPos.mnCol;
2574 - ::set_flag( rnRelField, EXC_TOK_REF_COLREL, rRefData.IsColRel() );
2575 - ::set_flag( rnRelField, EXC_TOK_REF_ROWREL, rRefData.IsRowRel() );
2576 + if (meBiff <= EXC_BIFF5)
2578 + ::set_flag( rXclPos.mnRow, EXC_TOK_REF_ROWREL, rRefData.IsColRel() );
2579 + ::set_flag( rXclPos.mnRow, EXC_TOK_REF_ROWREL, rRefData.IsRowRel() );
2581 + else
2583 + ::set_flag( rXclPos.mnCol, EXC_TOK_REF_COLREL, rRefData.IsColRel() );
2584 + ::set_flag( rXclPos.mnCol, EXC_TOK_REF_COLREL, rRefData.IsRowRel() );
2589 @@ -2540,7 +2547,10 @@ void XclExpFmlaCompImpl::ProcessMatrix( const XclExpTokenData& rTokData, sal_uIn
2591 AppendOpTokenId( GetTokenId( EXC_TOKID_ARRAY, EXC_TOKCLASS_ARR ), nExpClass, rTokData.mnSpaces );
2592 Append( static_cast< sal_uInt8 >( (meBiff == EXC_BIFF8) ? (nCols - 1) : nCols ) );
2593 - Append( static_cast< sal_uInt16 >( (meBiff == EXC_BIFF8) ? (nRows - 1) : nRows ) );
2594 + if (meBiff == EXC_BIFF8)
2595 + Append( static_cast< sal_uInt16 > ( nRows - 1 ) );
2596 + else
2597 + Append( static_cast< sal_uInt16 > ( nRows - 1 ) );
2598 Append( static_cast< sal_uInt32 >( 0 ) );
2600 if( !mxInlineArr )
2601 diff --git sc/source/filter/xlsx/xlsx-xehelper.cxx sc/source/filter/xlsx/xlsx-xehelper.cxx
2602 index 7dbe4b8..ca3fc38 100644
2603 --- sc/source/filter/xlsx/xlsx-xehelper.cxx
2604 +++ sc/source/filter/xlsx/xlsx-xehelper.cxx
2605 @@ -30,6 +30,9 @@
2607 // MARKER(update_precomp.py): autogen include statement, do not remove
2608 #include "precompiled_sc.hxx"
2609 +#include "xlsx/xladdress.hxx"
2610 +#include "xlsx/xlconst.hxx"
2611 +#include "xlsx/xlformula.hxx"
2612 #include <com/sun/star/i18n/XBreakIterator.hpp>
2613 #include <com/sun/star/i18n/ScriptType.hpp>
2614 #include <sfx2/objsh.hxx>
2615 @@ -159,7 +162,7 @@ namespace {
2616 inline void lclFillAddress( XclAddress& rXclPos, SCCOL nScCol, SCROW nScRow )
2618 rXclPos.mnCol = static_cast< sal_uInt16 >( nScCol );
2619 - rXclPos.mnRow = static_cast< sal_uInt16 >( nScRow );
2620 + rXclPos.mnRow = static_cast< sal_uInt32 >( nScRow );
2623 } // namespace
2624 diff --git sc/source/filter/xlsx/xlsx-xelink.cxx sc/source/filter/xlsx/xlsx-xelink.cxx
2625 index 0277877..66dc667 100644
2626 --- sc/source/filter/xlsx/xlsx-xelink.cxx
2627 +++ sc/source/filter/xlsx/xlsx-xelink.cxx
2628 @@ -30,6 +30,9 @@
2630 // MARKER(update_precomp.py): autogen include statement, do not remove
2631 #include "precompiled_sc.hxx"
2632 +#include "xlsx/xladdress.hxx"
2633 +#include "xlsx/xlconst.hxx"
2634 +#include "xlsx/xlformula.hxx"
2635 #include "xelink.hxx"
2637 #include <algorithm>
2638 diff --git sc/source/filter/xlsx/xlsx-xename.cxx sc/source/filter/xlsx/xlsx-xename.cxx
2639 index 9bd6ac4..3cf1e7f 100644
2640 --- sc/source/filter/xlsx/xlsx-xename.cxx
2641 +++ sc/source/filter/xlsx/xlsx-xename.cxx
2642 @@ -30,6 +30,9 @@
2644 // MARKER(update_precomp.py): autogen include statement, do not remove
2645 #include "precompiled_sc.hxx"
2646 +#include "xlsx/xladdress.hxx"
2647 +#include "xlsx/xlconst.hxx"
2648 +#include "xlsx/xlformula.hxx"
2649 #include "xename.hxx"
2651 #include <map>
2652 diff --git sc/source/filter/xlsx/xlsx-xepage.cxx sc/source/filter/xlsx/xlsx-xepage.cxx
2653 index f99b732..d79e950 100644
2654 --- sc/source/filter/xlsx/xlsx-xepage.cxx
2655 +++ sc/source/filter/xlsx/xlsx-xepage.cxx
2656 @@ -30,6 +30,9 @@
2658 // MARKER(update_precomp.py): autogen include statement, do not remove
2659 #include "precompiled_sc.hxx"
2660 +#include "xlsx/xladdress.hxx"
2661 +#include "xlsx/xlconst.hxx"
2662 +#include "xlsx/xlformula.hxx"
2664 #include "xepage.hxx"
2665 #include <svtools/itemset.hxx>
2666 @@ -310,7 +313,7 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
2667 set<SCROW> aRowBreaks;
2668 rDoc.GetAllRowBreaks(aRowBreaks, nScTab, false, true);
2670 - SCROW nMaxRow = numeric_limits<sal_uInt16>::max();
2671 + SCROW nMaxRow = numeric_limits<sal_uInt32>::max();
2672 for (set<SCROW>::const_iterator itr = aRowBreaks.begin(), itrEnd = aRowBreaks.end(); itr != itrEnd; ++itr)
2674 SCROW nRow = *itr;
2675 diff --git sc/source/filter/xlsx/xlsx-xepivot.cxx sc/source/filter/xlsx/xlsx-xepivot.cxx
2676 index c19bee2..57409c1 100644
2677 --- sc/source/filter/xlsx/xlsx-xepivot.cxx
2678 +++ sc/source/filter/xlsx/xlsx-xepivot.cxx
2679 @@ -1593,9 +1593,9 @@ void XclExpPivotTable::Finalize()
2681 // update output range (initialized in ctor)
2682 sal_uInt16& rnXclCol1 = maPTInfo.maOutXclRange.maFirst.mnCol;
2683 - sal_uInt16& rnXclRow1 = maPTInfo.maOutXclRange.maFirst.mnRow;
2684 + sal_uInt32& rnXclRow1 = maPTInfo.maOutXclRange.maFirst.mnRow;
2685 sal_uInt16& rnXclCol2 = maPTInfo.maOutXclRange.maLast.mnCol;
2686 - sal_uInt16& rnXclRow2 = maPTInfo.maOutXclRange.maLast.mnRow;
2687 + sal_uInt32& rnXclRow2 = maPTInfo.maOutXclRange.maLast.mnRow;
2688 // exclude page fields from output range
2689 rnXclRow1 = rnXclRow1 + maPTInfo.mnPageFields;
2690 // exclude filter button from output range
2691 @@ -1607,7 +1607,7 @@ void XclExpPivotTable::Finalize()
2693 // data area
2694 sal_uInt16& rnDataXclCol = maPTInfo.maDataXclPos.mnCol;
2695 - sal_uInt16& rnDataXclRow = maPTInfo.maDataXclPos.mnRow;
2696 + sal_uInt32& rnDataXclRow = maPTInfo.maDataXclPos.mnRow;
2697 rnDataXclCol = rnXclCol1 + maPTInfo.mnRowFields;
2698 rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1;
2699 if( maDataFields.empty() )
2700 diff --git sc/source/filter/xlsx/xlsx-xerecord.cxx sc/source/filter/xlsx/xlsx-xerecord.cxx
2701 index 8b927c5..225b030 100644
2702 --- sc/source/filter/xlsx/xlsx-xerecord.cxx
2703 +++ sc/source/filter/xlsx/xlsx-xerecord.cxx
2704 @@ -30,6 +30,9 @@
2706 // MARKER(update_precomp.py): autogen include statement, do not remove
2707 #include "precompiled_sc.hxx"
2708 +#include "xlsx/xladdress.hxx"
2709 +#include "xlsx/xlconst.hxx"
2710 +#include "xlsx/xlformula.hxx"
2711 #include "xerecord.hxx"
2712 #include "xeroot.hxx"
2714 diff --git sc/source/filter/xlsx/xlsx-xeroot.cxx sc/source/filter/xlsx/xlsx-xeroot.cxx
2715 index 600a928..0e76f05 100644
2716 --- sc/source/filter/xlsx/xlsx-xeroot.cxx
2717 +++ sc/source/filter/xlsx/xlsx-xeroot.cxx
2718 @@ -30,6 +30,9 @@
2720 // MARKER(update_precomp.py): autogen include statement, do not remove
2721 #include "precompiled_sc.hxx"
2722 +#include "xlsx/xladdress.hxx"
2723 +#include "xlsx/xlconst.hxx"
2724 +#include "xlsx/xlformula.hxx"
2725 #include <sfx2/docfile.hxx>
2726 #include <sfx2/sfxsids.hrc>
2727 #include <svtools/saveopt.hxx>
2728 diff --git sc/source/filter/xlsx/xlsx-xestream.cxx sc/source/filter/xlsx/xlsx-xestream.cxx
2729 index 14bc6b4..0568512 100644
2730 --- sc/source/filter/xlsx/xlsx-xestream.cxx
2731 +++ sc/source/filter/xlsx/xlsx-xestream.cxx
2732 @@ -802,8 +802,8 @@ static ScAddress lcl_ToAddress( const XclAddress& rAddress )
2733 // For some reason, ScRange::Format() returns omits row numbers if
2734 // the row is >= MAXROW or the column is >= MAXCOL, and Excel doesn't
2735 // like "A:IV" (i.e. no row numbers). Prevent this.
2736 - aAddress.SetRow( std::min<sal_Int32>( rAddress.mnRow, MAXROW-1 ) );
2737 - aAddress.SetCol( static_cast<sal_Int16>(std::min<sal_Int32>( rAddress.mnCol, MAXCOL-1 )) );
2738 + aAddress.SetRow( std::min<sal_Int32>( rAddress.mnRow, MAXROW ) );
2739 + aAddress.SetCol( static_cast<sal_Int16>(std::min<sal_Int32>( rAddress.mnCol, MAXCOL )) );
2741 return aAddress;
2743 diff --git sc/source/filter/xlsx/xlsx-xetable.cxx sc/source/filter/xlsx/xlsx-xetable.cxx
2744 index 92dd71e..bf7af82 100644
2745 --- sc/source/filter/xlsx/xlsx-xetable.cxx
2746 +++ sc/source/filter/xlsx/xlsx-xetable.cxx
2747 @@ -31,7 +31,7 @@
2748 // MARKER(update_precomp.py): autogen include statement, do not remove
2749 #include "precompiled_sc.hxx"
2750 #include "xestream.hxx"
2751 -#include "xetable.hxx"
2752 +#include "xlsx/xetable.hxx"
2754 #include <map>
2755 #include <com/sun/star/i18n/ScriptType.hpp>
2756 @@ -81,7 +81,7 @@ XclExpRangeFmlaBase::XclExpRangeFmlaBase(
2757 maXclRange( ScAddress::UNINITIALIZED ),
2758 maBaseXclPos( ScAddress::UNINITIALIZED )
2760 - maBaseXclPos.Set( static_cast< sal_uInt16 >( rScPos.Col() ), static_cast< sal_uInt16 >( rScPos.Row() ) );
2761 + maBaseXclPos.Set( static_cast< sal_uInt16 >( rScPos.Col() ), static_cast< sal_uInt32 >( rScPos.Row() ) );
2762 maXclRange.maFirst = maXclRange.maLast = maBaseXclPos;
2765 @@ -93,13 +93,13 @@ XclExpRangeFmlaBase::XclExpRangeFmlaBase(
2767 maXclRange.Set(
2768 static_cast< sal_uInt16 >( rScRange.aStart.Col() ),
2769 - static_cast< sal_uInt16 >( rScRange.aStart.Row() ),
2770 + static_cast< sal_uInt32 >( rScRange.aStart.Row() ),
2771 static_cast< sal_uInt16 >( rScRange.aEnd.Col() ),
2772 - static_cast< sal_uInt16 >( rScRange.aEnd.Row() ) );
2773 + static_cast< sal_uInt32 >( rScRange.aEnd.Row() ) );
2774 maBaseXclPos = maXclRange.maFirst;
2777 -bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) const
2778 +bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const
2780 return (maBaseXclPos.mnCol == nXclCol) && (maBaseXclPos.mnRow == nXclRow);
2782 @@ -107,7 +107,7 @@ bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) co
2783 void XclExpRangeFmlaBase::Extend( const ScAddress& rScPos )
2785 sal_uInt16 nXclCol = static_cast< sal_uInt16 >( rScPos.Col() );
2786 - sal_uInt16 nXclRow = static_cast< sal_uInt16 >( rScPos.Row() );
2787 + sal_uInt32 nXclRow = static_cast< sal_uInt32 >( rScPos.Row() );
2788 maXclRange.maFirst.mnCol = ::std::min( maXclRange.maFirst.mnCol, nXclCol );
2789 maXclRange.maFirst.mnRow = ::std::min( maXclRange.maFirst.mnRow, nXclRow );
2790 maXclRange.maLast.mnCol = ::std::max( maXclRange.maLast.mnCol, nXclCol );
2791 @@ -252,9 +252,9 @@ XclExpTableop::XclExpTableop( const ScAddress& rScPos,
2792 XclExpRangeFmlaBase( EXC_ID3_TABLEOP, 16, rScPos ),
2793 mnLastAppXclCol( static_cast< sal_uInt16 >( rScPos.Col() ) ),
2794 mnColInpXclCol( static_cast< sal_uInt16 >( rRefs.maColFirstScPos.Col() ) ),
2795 - mnColInpXclRow( static_cast< sal_uInt16 >( rRefs.maColFirstScPos.Row() ) ),
2796 + mnColInpXclRow( static_cast< sal_uInt32 >( rRefs.maColFirstScPos.Row() ) ),
2797 mnRowInpXclCol( static_cast< sal_uInt16 >( rRefs.maRowFirstScPos.Col() ) ),
2798 - mnRowInpXclRow( static_cast< sal_uInt16 >( rRefs.maRowFirstScPos.Row() ) ),
2799 + mnRowInpXclRow( static_cast< sal_uInt32 >( rRefs.maRowFirstScPos.Row() ) ),
2800 mnScMode( nScMode ),
2801 mbValid( false )
2803 @@ -263,7 +263,7 @@ XclExpTableop::XclExpTableop( const ScAddress& rScPos,
2804 bool XclExpTableop::TryExtend( const ScAddress& rScPos, const XclMultipleOpRefs& rRefs )
2806 sal_uInt16 nXclCol = static_cast< sal_uInt16 >( rScPos.Col() );
2807 - sal_uInt16 nXclRow = static_cast< sal_uInt16 >( rScPos.Row() );
2808 + sal_uInt32 nXclRow = static_cast< sal_uInt32 >( rScPos.Row() );
2810 bool bOk = IsAppendable( nXclCol, nXclRow );
2811 if( bOk )
2812 @@ -374,7 +374,7 @@ void XclExpTableop::Save( XclExpStream& rStrm )
2813 XclExpRangeFmlaBase::Save( rStrm );
2816 -bool XclExpTableop::IsAppendable( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) const
2817 +bool XclExpTableop::IsAppendable( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const
2819 return ((nXclCol == mnLastAppXclCol + 1) && (nXclRow == maXclRange.maFirst.mnRow)) ||
2820 ((nXclCol == mnLastAppXclCol + 1) && (nXclCol <= maXclRange.maLast.mnCol) && (nXclRow == maXclRange.maLast.mnRow)) ||
2821 @@ -1747,7 +1747,7 @@ void XclExpDefrowheight::WriteBody( XclExpStream& rStrm )
2823 // ----------------------------------------------------------------------------
2825 -XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt16 nXclRow,
2826 +XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
2827 XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty ) :
2828 XclExpRecord( EXC_ID3_ROW, 16 ),
2829 XclExpRoot( rRoot ),
2830 @@ -2061,7 +2061,7 @@ void XclExpRowBuffer::AppendCell( XclExpCellRef xCell, bool bIsMergedBase )
2831 void XclExpRowBuffer::CreateRows( SCROW nFirstFreeScRow )
2833 if( nFirstFreeScRow > 0 )
2834 - GetOrCreateRow( static_cast< sal_uInt16 >( nFirstFreeScRow - 1 ), true );
2835 + GetOrCreateRow( static_cast< sal_uInt32 >( nFirstFreeScRow - 1 ), true );
2838 void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt16Vec& rColXFIndexes )
2839 @@ -2092,7 +2092,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt
2840 #i59220# Tolerance of +-128 rows for inserted/removed rows. */
2841 if( (nDefaultXclRow < 31872) || (nDefaultXclRow > 32128) )
2843 - sal_uInt16 nLastXclRow = static_cast< sal_uInt16 >( GetMaxPos().Row() );
2844 + sal_uInt32 nLastXclRow = static_cast< sal_uInt32 >( GetMaxPos().Row() );
2845 if( nDefaultXclRow <= nLastXclRow )
2847 // create a dummy ROW record and fill aMaxDefData
2848 @@ -2154,7 +2154,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt
2849 // find used row range
2850 if( xRow->IsEnabled() )
2852 - sal_uInt16 nXclRow = xRow->GetXclRow();
2853 + sal_uInt32 nXclRow = xRow->GetXclRow();
2854 nFirstUsedXclRow = ::std::min< sal_uInt32 >( nFirstUsedXclRow, nXclRow );
2855 nFirstFreeXclRow = ::std::max< sal_uInt32 >( nFirstFreeXclRow, nXclRow + 1 );
2857 @@ -2177,7 +2177,7 @@ void XclExpRowBuffer::Save( XclExpStream& rStrm )
2858 // save in blocks of 32 rows, each block contains first all ROWs, then all cells
2859 size_t nSize = maRowList.GetSize();
2860 size_t nBlockStart = 0;
2861 - sal_uInt16 nStartXclRow = (nSize == 0) ? 0 : maRowList.GetRecord( 0 )->GetXclRow();
2862 + sal_uInt32 nStartXclRow = (nSize == 0) ? 0 : maRowList.GetRecord( 0 )->GetXclRow();
2864 while( nBlockStart < nSize )
2866 @@ -2227,7 +2227,7 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions()
2867 return &maDimensions;
2870 -XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty )
2871 +XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty )
2873 if( !mpLastUsedRow || (mnLastUsedXclRow != nXclRow) )
2875 @@ -2235,7 +2235,7 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysE
2876 // do not use sal_uInt16 for nFirstFreeXclRow, would cause loop in full sheets
2877 for( size_t nFirstFreeXclRow = maRowList.GetSize(); nFirstFreeXclRow <= nXclRow; ++nFirstFreeXclRow )
2878 maRowList.AppendNewRecord( new XclExpRow(
2879 - GetRoot(), static_cast< sal_uInt16 >( nFirstFreeXclRow ), maOutlineBfr, bRowAlwaysEmpty ) );
2880 + GetRoot(), static_cast< sal_uInt32 >( nFirstFreeXclRow ), maOutlineBfr, bRowAlwaysEmpty ) );
2882 mpLastUsedRow = maRowList.GetRecord( nXclRow ).get();
2883 mnLastUsedXclRow = nXclRow;
2884 @@ -2320,7 +2320,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
2885 SCCOL nLastScCol = aIt.GetEndCol();
2886 ScAddress aScPos( nScCol, nScRow, nScTab );
2888 - XclAddress aXclPos( static_cast< sal_uInt16 >( nScCol ), static_cast< sal_uInt16 >( nScRow ) );
2889 + XclAddress aXclPos( static_cast< sal_uInt16 >( nScCol ), static_cast< sal_uInt32 >( nScRow ) );
2890 sal_uInt16 nLastXclCol = static_cast< sal_uInt16 >( nLastScCol );
2892 const ScBaseCell* pScCell = aIt.GetCell();
2893 diff --git sc/source/filter/xlsx/xlsx-xeview.cxx sc/source/filter/xlsx/xlsx-xeview.cxx
2894 index d15634b..4cf8efb 100644
2895 --- sc/source/filter/xlsx/xlsx-xeview.cxx
2896 +++ sc/source/filter/xlsx/xlsx-xeview.cxx
2897 @@ -30,6 +30,9 @@
2899 // MARKER(update_precomp.py): autogen include statement, do not remove
2900 #include "precompiled_sc.hxx"
2901 +#include "xlsx/xladdress.hxx"
2902 +#include "xlsx/xlconst.hxx"
2903 +#include "xlsx/xlformula.hxx"
2904 #include "xeview.hxx"
2905 #include "document.hxx"
2906 #include "scextopt.hxx"
2907 diff --git sc/source/filter/xlsx/xlsx-xichart.cxx sc/source/filter/xlsx/xlsx-xichart.cxx
2908 index 77d9eae..fb19b0c 100644
2909 --- sc/source/filter/xlsx/xlsx-xichart.cxx
2910 +++ sc/source/filter/xlsx/xlsx-xichart.cxx
2911 @@ -30,6 +30,9 @@
2913 // MARKER(update_precomp.py): autogen include statement, do not remove
2914 #include "precompiled_sc.hxx"
2915 +#include "xlsx/xladdress.hxx"
2916 +#include "xlsx/xlconst.hxx"
2917 +#include "xlsx/xlformula.hxx"
2919 #include "xichart.hxx"
2921 diff --git sc/source/filter/xlsx/xlsx-xicontent.cxx sc/source/filter/xlsx/xlsx-xicontent.cxx
2922 index abc5d02..a6f1dad 100644
2923 --- sc/source/filter/xlsx/xlsx-xicontent.cxx
2924 +++ sc/source/filter/xlsx/xlsx-xicontent.cxx
2925 @@ -30,6 +30,9 @@
2927 // MARKER(update_precomp.py): autogen include statement, do not remove
2928 #include "precompiled_sc.hxx"
2929 +#include "xlsx/xladdress.hxx"
2930 +#include "xlsx/xlconst.hxx"
2931 +#include "xlsx/xlformula.hxx"
2932 #include "xicontent.hxx"
2933 #include <sfx2/objsh.hxx>
2934 #include <sfx2/docfile.hxx>
2935 diff --git sc/source/filter/xlsx/xlsx-xiescher.cxx sc/source/filter/xlsx/xlsx-xiescher.cxx
2936 index b1ea638..3751674 100644
2937 --- sc/source/filter/xlsx/xlsx-xiescher.cxx
2938 +++ sc/source/filter/xlsx/xlsx-xiescher.cxx
2939 @@ -30,6 +30,9 @@
2941 // MARKER(update_precomp.py): autogen include statement, do not remove
2942 #include "precompiled_sc.hxx"
2943 +#include "xlsx/xladdress.hxx"
2944 +#include "xlsx/xlconst.hxx"
2945 +#include "xlsx/xlformula.hxx"
2947 #include "xiescher.hxx"
2949 diff --git sc/source/filter/xlsx/xlsx-xiformula.cxx sc/source/filter/xlsx/xlsx-xiformula.cxx
2950 index 240358e..5ae34f1 100644
2951 --- sc/source/filter/xlsx/xlsx-xiformula.cxx
2952 +++ sc/source/filter/xlsx/xlsx-xiformula.cxx
2953 @@ -29,6 +29,8 @@
2954 ************************************************************************/
2956 #include "precompiled_sc.hxx"
2957 +#include "xlsx/xlconst.hxx"
2958 +#include "xlsx/xlformula.hxx"
2959 #include "xiformula.hxx"
2960 #include "rangelst.hxx"
2961 #include "xistream.hxx"
2962 diff --git sc/source/filter/xlsx/xlsx-xihelper.cxx sc/source/filter/xlsx/xlsx-xihelper.cxx
2963 index 0e44ba6..d2fd000 100644
2964 --- sc/source/filter/xlsx/xlsx-xihelper.cxx
2965 +++ sc/source/filter/xlsx/xlsx-xihelper.cxx
2966 @@ -30,6 +30,9 @@
2968 // MARKER(update_precomp.py): autogen include statement, do not remove
2969 #include "precompiled_sc.hxx"
2970 +#include "xlsx/xladdress.hxx"
2971 +#include "xlsx/xlconst.hxx"
2972 +#include "xlsx/xlformula.hxx"
2973 #include "xihelper.hxx"
2974 #include <svtools/itemset.hxx>
2975 #include <svx/editobj.hxx>
2976 @@ -126,7 +129,7 @@ bool XclImpAddressConverter::ConvertRange( ScRange& rScRange,
2978 // check & correct end position
2979 sal_uInt16 nXclCol2 = rXclRange.maLast.mnCol;
2980 - sal_uInt16 nXclRow2 = rXclRange.maLast.mnRow;
2981 + sal_uInt32 nXclRow2 = rXclRange.maLast.mnRow;
2982 if( !CheckAddress( rXclRange.maLast, bWarn ) )
2984 nXclCol2 = ::std::min( nXclCol2, mnMaxCol );
2985 diff --git sc/source/filter/xlsx/xlsx-xilink.cxx sc/source/filter/xlsx/xlsx-xilink.cxx
2986 index 2c24263..3f9cb2a 100644
2987 --- sc/source/filter/xlsx/xlsx-xilink.cxx
2988 +++ sc/source/filter/xlsx/xlsx-xilink.cxx
2989 @@ -30,6 +30,9 @@
2991 // MARKER(update_precomp.py): autogen include statement, do not remove
2992 #include "precompiled_sc.hxx"
2993 +#include "xlsx/xladdress.hxx"
2994 +#include "xlsx/xlconst.hxx"
2995 +#include "xlsx/xlformula.hxx"
2996 #include "xilink.hxx"
2997 #include "document.hxx"
2998 #include "cell.hxx"
2999 diff --git sc/source/filter/xlsx/xlsx-xiname.cxx sc/source/filter/xlsx/xlsx-xiname.cxx
3000 index 72f4701..84e8098 100644
3001 --- sc/source/filter/xlsx/xlsx-xiname.cxx
3002 +++ sc/source/filter/xlsx/xlsx-xiname.cxx
3003 @@ -30,6 +30,9 @@
3005 // MARKER(update_precomp.py): autogen include statement, do not remove
3006 #include "precompiled_sc.hxx"
3007 +#include "xlsx/xladdress.hxx"
3008 +#include "xlsx/xlconst.hxx"
3009 +#include "xlsx/xlformula.hxx"
3010 #include "xiname.hxx"
3011 #include "rangenam.hxx"
3012 #include "xistream.hxx"
3013 diff --git sc/source/filter/xlsx/xlsx-xipage.cxx sc/source/filter/xlsx/xlsx-xipage.cxx
3014 index cb1aba2..d1ab698 100644
3015 --- sc/source/filter/xlsx/xlsx-xipage.cxx
3016 +++ sc/source/filter/xlsx/xlsx-xipage.cxx
3017 @@ -30,6 +30,9 @@
3019 // MARKER(update_precomp.py): autogen include statement, do not remove
3020 #include "precompiled_sc.hxx"
3021 +#include "xlsx/xladdress.hxx"
3022 +#include "xlsx/xlconst.hxx"
3023 +#include "xlsx/xlformula.hxx"
3024 #include "xipage.hxx"
3025 #include <svtools/itemset.hxx>
3026 #include <vcl/graph.hxx>
3027 diff --git sc/source/filter/xlsx/xlsx-xipivot.cxx sc/source/filter/xlsx/xlsx-xipivot.cxx
3028 index fd85060..23ac48a 100644
3029 --- sc/source/filter/xlsx/xlsx-xipivot.cxx
3030 +++ sc/source/filter/xlsx/xlsx-xipivot.cxx
3031 @@ -30,6 +30,9 @@
3033 // MARKER(update_precomp.py): autogen include statement, do not remove
3034 #include "precompiled_sc.hxx"
3035 +#include "xlsx/xladdress.hxx"
3036 +#include "xlsx/xlconst.hxx"
3037 +#include "xlsx/xlformula.hxx"
3039 #include "xipivot.hxx"
3041 diff --git sc/source/filter/xlsx/xlsx-xiroot.cxx sc/source/filter/xlsx/xlsx-xiroot.cxx
3042 index 55ba4bd..63985cb 100644
3043 --- sc/source/filter/xlsx/xlsx-xiroot.cxx
3044 +++ sc/source/filter/xlsx/xlsx-xiroot.cxx
3045 @@ -30,6 +30,9 @@
3047 // MARKER(update_precomp.py): autogen include statement, do not remove
3048 #include "precompiled_sc.hxx"
3049 +#include "xlsx/xladdress.hxx"
3050 +#include "xlsx/xlconst.hxx"
3051 +#include "xlsx/xlformula.hxx"
3052 #include "xiroot.hxx"
3053 #include "addincol.hxx"
3054 #include "xltracer.hxx"
3055 diff --git sc/source/filter/xlsx/xlsx-xistream.cxx sc/source/filter/xlsx/xlsx-xistream.cxx
3056 index 7b19660..89a9302 100644
3057 --- sc/source/filter/xlsx/xlsx-xistream.cxx
3058 +++ sc/source/filter/xlsx/xlsx-xistream.cxx
3059 @@ -30,6 +30,9 @@
3061 // MARKER(update_precomp.py): autogen include statement, do not remove
3062 #include "precompiled_sc.hxx"
3063 +#include "xlsx/xladdress.hxx"
3064 +#include "xlsx/xlconst.hxx"
3065 +#include "xlsx/xlformula.hxx"
3067 // ============================================================================
3068 #include "xistream.hxx"
3069 diff --git sc/source/filter/xlsx/xlsx-xistring.cxx sc/source/filter/xlsx/xlsx-xistring.cxx
3070 index 5e785ca..b67db15 100644
3071 --- sc/source/filter/xlsx/xlsx-xistring.cxx
3072 +++ sc/source/filter/xlsx/xlsx-xistring.cxx
3073 @@ -29,6 +29,9 @@
3074 ************************************************************************/
3076 #include "precompiled_sc.hxx"
3077 +#include "xlsx/xladdress.hxx"
3078 +#include "xlsx/xlconst.hxx"
3079 +#include "xlsx/xlformula.hxx"
3080 #include "xistring.hxx"
3081 #include "xlstyle.hxx"
3082 #include "xistream.hxx"
3083 diff --git sc/source/filter/xlsx/xlsx-xistyle.cxx sc/source/filter/xlsx/xlsx-xistyle.cxx
3084 index d81bcc5..d63cbf8 100644
3085 --- sc/source/filter/xlsx/xlsx-xistyle.cxx
3086 +++ sc/source/filter/xlsx/xlsx-xistyle.cxx
3087 @@ -30,6 +30,9 @@
3089 // MARKER(update_precomp.py): autogen include statement, do not remove
3090 #include "precompiled_sc.hxx"
3091 +#include "xlsx/xladdress.hxx"
3092 +#include "xlsx/xlconst.hxx"
3093 +#include "xlsx/xlformula.hxx"
3094 #include "xistyle.hxx"
3095 #include <sfx2/printer.hxx>
3096 #include <sfx2/objsh.hxx>
3097 diff --git sc/source/filter/xlsx/xlsx-xiview.cxx sc/source/filter/xlsx/xlsx-xiview.cxx
3098 index ce76483..39a8678 100644
3099 --- sc/source/filter/xlsx/xlsx-xiview.cxx
3100 +++ sc/source/filter/xlsx/xlsx-xiview.cxx
3101 @@ -30,6 +30,9 @@
3103 // MARKER(update_precomp.py): autogen include statement, do not remove
3104 #include "precompiled_sc.hxx"
3105 +#include "xlsx/xladdress.hxx"
3106 +#include "xlsx/xlconst.hxx"
3107 +#include "xlsx/xlformula.hxx"
3108 #include "xiview.hxx"
3109 #include "document.hxx"
3110 #include "scextopt.hxx"
3111 diff --git sc/source/filter/xlsx/xlsx-xladdress.cxx sc/source/filter/xlsx/xlsx-xladdress.cxx
3112 index 290a7dc..5455d2c 100644
3113 --- sc/source/filter/xlsx/xlsx-xladdress.cxx
3114 +++ sc/source/filter/xlsx/xlsx-xladdress.cxx
3115 @@ -30,7 +30,7 @@
3117 // MARKER(update_precomp.py): autogen include statement, do not remove
3118 #include "precompiled_sc.hxx"
3119 -#include "xladdress.hxx"
3120 +#include "xlsx/xladdress.hxx"
3121 #include "xestream.hxx"
3122 #include "xltracer.hxx"
3123 #include "xistream.hxx"
3124 diff --git sc/source/filter/xlsx/xlsx-xlchart.cxx sc/source/filter/xlsx/xlsx-xlchart.cxx
3125 index 76253fc..50d4095 100644
3126 --- sc/source/filter/xlsx/xlsx-xlchart.cxx
3127 +++ sc/source/filter/xlsx/xlsx-xlchart.cxx
3128 @@ -30,6 +30,9 @@
3130 // MARKER(update_precomp.py): autogen include statement, do not remove
3131 #include "precompiled_sc.hxx"
3132 +#include "xlsx/xladdress.hxx"
3133 +#include "xlsx/xlconst.hxx"
3134 +#include "xlsx/xlformula.hxx"
3136 #include "xlchart.hxx"
3138 diff --git sc/source/filter/xlsx/xlsx-xlescher.cxx sc/source/filter/xlsx/xlsx-xlescher.cxx
3139 index a2a64b8..841eeb7 100644
3140 --- sc/source/filter/xlsx/xlsx-xlescher.cxx
3141 +++ sc/source/filter/xlsx/xlsx-xlescher.cxx
3142 @@ -137,7 +137,7 @@ void lclGetColFromX(
3143 /** Calculates an object row position from a drawing layer Y position (in twips). */
3144 void lclGetRowFromY(
3145 ScDocument& rDoc, SCTAB nScTab,
3146 - sal_uInt16& rnXclRow, sal_uInt16& rnOffset, sal_uInt16 nXclStartRow,
3147 + sal_uInt32& rnXclRow, sal_uInt16& rnOffset, sal_uInt32 nXclStartRow,
3148 long& rnStartH, long nY, double fScale )
3150 // rnStartH in conjunction with nXclStartRow is used as buffer for previously calculated height
3151 diff --git sc/source/filter/xlsx/xlsx-xlformula.cxx sc/source/filter/xlsx/xlsx-xlformula.cxx
3152 index 94b3951..c55c02a 100644
3153 --- sc/source/filter/xlsx/xlsx-xlformula.cxx
3154 +++ sc/source/filter/xlsx/xlsx-xlformula.cxx
3155 @@ -31,7 +31,7 @@
3156 // MARKER(update_precomp.py): autogen include statement, do not remove
3157 #include "precompiled_sc.hxx"
3158 #include "xestream.hxx"
3159 -#include "xlformula.hxx"
3160 +#include "xlsx/xlformula.hxx"
3161 #include "compiler.hxx"
3162 #include "rangenam.hxx"
3163 #include "xlroot.hxx"
3164 diff --git sc/source/filter/xlsx/xlsx-xlpage.cxx sc/source/filter/xlsx/xlsx-xlpage.cxx
3165 index e9a8142..66920a6 100644
3166 --- sc/source/filter/xlsx/xlsx-xlpage.cxx
3167 +++ sc/source/filter/xlsx/xlsx-xlpage.cxx
3168 @@ -30,6 +30,7 @@
3170 // MARKER(update_precomp.py): autogen include statement, do not remove
3171 #include "precompiled_sc.hxx"
3172 +#include "xlsx/xlconst.hxx"
3173 #include "xlpage.hxx"
3174 #include <sfx2/printer.hxx>
3175 #include <svx/svxenum.hxx>
3176 diff --git sc/source/filter/xlsx/xlsx-xlpivot.cxx sc/source/filter/xlsx/xlsx-xlpivot.cxx
3177 index c915903..9568c09 100644
3178 --- sc/source/filter/xlsx/xlsx-xlpivot.cxx
3179 +++ sc/source/filter/xlsx/xlsx-xlpivot.cxx
3180 @@ -30,6 +30,9 @@
3182 // MARKER(update_precomp.py): autogen include statement, do not remove
3183 #include "precompiled_sc.hxx"
3184 +#include "xlsx/xladdress.hxx"
3185 +#include "xlsx/xlconst.hxx"
3186 +#include "xlsx/xlformula.hxx"
3187 #include "dpgroup.hxx"
3188 #include "dpsave.hxx"
3189 #include "xestream.hxx"
3190 diff --git sc/source/filter/xlsx/xlsx-xlroot.cxx sc/source/filter/xlsx/xlsx-xlroot.cxx
3191 index 8f5ddad..4f218e4 100644
3192 --- sc/source/filter/xlsx/xlsx-xlroot.cxx
3193 +++ sc/source/filter/xlsx/xlsx-xlroot.cxx
3194 @@ -30,6 +30,7 @@
3196 // MARKER(update_precomp.py): autogen include statement, do not remove
3197 #include "precompiled_sc.hxx"
3198 +#include "xlsx/xlconst.hxx"
3199 #include "xlroot.hxx"
3200 #include <com/sun/star/i18n/ScriptType.hpp>
3201 #include <vcl/svapp.hxx>
3202 diff --git sc/source/filter/xlsx/xlsx-xlstyle.cxx sc/source/filter/xlsx/xlsx-xlstyle.cxx
3203 index bd56de2..cb3ba62 100644
3204 --- sc/source/filter/xlsx/xlsx-xlstyle.cxx
3205 +++ sc/source/filter/xlsx/xlsx-xlstyle.cxx
3206 @@ -31,6 +31,7 @@
3207 // MARKER(update_precomp.py): autogen include statement, do not remove
3208 #include "precompiled_sc.hxx"
3210 +#include "xlsx/xlconst.hxx"
3211 #include "xlstyle.hxx"
3212 #include <com/sun/star/awt/FontFamily.hpp>
3213 #include <com/sun/star/awt/FontSlant.hpp>
3214 diff --git sc/source/filter/xlsx/xlsx-xlview.cxx sc/source/filter/xlsx/xlsx-xlview.cxx
3215 index 8580d7a..78d07ed 100644
3216 --- sc/source/filter/xlsx/xlsx-xlview.cxx
3217 +++ sc/source/filter/xlsx/xlsx-xlview.cxx
3218 @@ -30,6 +30,7 @@
3220 // MARKER(update_precomp.py): autogen include statement, do not remove
3221 #include "precompiled_sc.hxx"
3222 +#include "xlsx/xladdress.hxx"
3223 #include "xlview.hxx"
3224 #include "ftools.hxx"
3227 1.6.0.rc1.49.g98a8