1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include "xerecord.hxx"
24 #include "excrecds.hxx"
32 class XclExpXmlStream
;
33 class XclExpChangeTrack
;
36 class XclExpCellTable
;
38 class ExcTable final
: public XclExpRecordBase
, public XclExpRoot
41 typedef XclExpRecordList
< ExcBundlesheetBase
> ExcBoundsheetList
;
42 typedef rtl::Reference
< XclExpCellTable
> XclExpCellTableRef
;
43 typedef XclExpRecordList
< XclExpNote
> XclExpNoteList
;
44 typedef rtl::Reference
< XclExpNoteList
> XclExpNoteListRef
;
46 XclExpRecordList
<> aRecList
;
47 XclExpCellTableRef mxCellTable
;
49 SCTAB mnScTab
; // table number SC document
50 sal_uInt16 nExcTab
; // table number Excel document
52 XclExpNoteListRef mxNoteList
;
54 // re-create and forget pRec; delete is done by ExcTable itself!
55 void Add( XclExpRecordBase
* pRec
);
58 ExcTable( const XclExpRoot
& rRoot
);
59 ExcTable( const XclExpRoot
& rRoot
, SCTAB nScTab
);
60 virtual ~ExcTable() override
;
62 void FillAsHeaderBinary( ExcBoundsheetList
& rBoundsheetList
);
63 void FillAsHeaderXml( ExcBoundsheetList
& rBoundsheetList
);
65 void FillAsTableBinary( SCTAB nCodeNameIdx
);
66 void FillAsTableXml();
68 void FillAsEmptyTable( SCTAB nCodeNameIdx
);
70 void Write( XclExpStream
& );
71 void WriteXml( XclExpXmlStream
& );
74 class ExcDocument final
: protected XclExpRoot
76 friend class ExcTable
;
79 typedef XclExpRecordList
< ExcTable
> ExcTableList
;
80 typedef XclExpRecordList
< ExcBundlesheetBase
> ExcBoundsheetList
;
81 typedef ExcBoundsheetList::RecordRefType ExcBoundsheetRef
;
85 ExcTableList maTableList
;
86 ExcBoundsheetList maBoundsheetList
;
88 std::unique_ptr
<XclExpChangeTrack
> m_xExpChangeTrack
;
91 explicit ExcDocument( const XclExpRoot
& rRoot
);
92 virtual ~ExcDocument() override
;
95 void Write( SvStream
& rSvStrm
);
96 void WriteXml( XclExpXmlStream
& );
98 // add an element attributes and values to FastAttributeList
99 static void addElemensToAttrList(rtl::Reference
<sax_fastparser::FastAttributeList
>& pAttrList
,
100 css::uno::Sequence
<css::uno::Any
>& aSeqs
);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */