Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_IMP_OP_HXX
30 : : #define SC_IMP_OP_HXX
31 : :
32 : : #include <tools/gen.hxx>
33 : : #include "xiroot.hxx"
34 : : #include "xistream.hxx"
35 : : #include "xistyle.hxx"
36 : : #include "flttypes.hxx"
37 : : #include "namebuff.hxx"
38 : : #include "root.hxx"
39 : : #include "otlnbuff.hxx"
40 : : #include "colrowst.hxx"
41 : : #include "excdefs.hxx"
42 : : #include <boost/shared_ptr.hpp>
43 : : #include <boost/ptr_container/ptr_vector.hpp>
44 : :
45 : :
46 : : class SvStream;
47 : :
48 : : class ScFormulaCell;
49 : : class ScDocument;
50 : :
51 : : class ExcelToSc;
52 : :
53 : :
54 : : class ImportTyp
55 : : {
56 : : protected:
57 : : CharSet eQuellChar; // Quell-Zeichensatz
58 : : ScDocument* pD; // Dokument
59 : :
60 : : public:
61 : : ImportTyp( ScDocument*, CharSet eSrc );
62 : : virtual ~ImportTyp();
63 : :
64 : : virtual FltError Read( void );
65 : : };
66 : :
67 : : class XclImpOutlineDataBuffer : protected XclImpRoot
68 : : {
69 : : public:
70 : : explicit XclImpOutlineDataBuffer( const XclImpRoot& rRoot, SCTAB nScTab );
71 : : virtual ~XclImpOutlineDataBuffer();
72 : :
73 : 165 : inline XclImpColRowSettings* GetColRowBuff() const { return mxColRowBuff.get(); }
74 : 165 : inline XclImpOutlineBuffer* GetColOutline() const { return mxColOutlineBuff.get(); }
75 : 165 : inline XclImpOutlineBuffer* GetRowOutline() const { return mxRowOutlineBuff.get(); }
76 : : void Convert();
77 : :
78 : : private:
79 : : typedef boost::shared_ptr< XclImpOutlineBuffer > XclImpOutlineBfrRef;
80 : : typedef boost::shared_ptr< XclImpColRowSettings > XclImpColRowSettRef;
81 : :
82 : : XclImpOutlineBfrRef mxColOutlineBuff;
83 : : XclImpOutlineBfrRef mxRowOutlineBuff;
84 : : XclImpColRowSettRef mxColRowBuff;
85 : : SCTAB mnScTab;
86 : : };
87 : :
88 : : class ImportExcel : public ImportTyp, protected XclImpRoot
89 : : {
90 : : protected:
91 : : static const double fExcToTwips; // Umrechnung 1/256 Zeichen -> Twips
92 : :
93 : : RootData* pExcRoot;
94 : :
95 : : XclImpStream maStrm; // input stream
96 : : XclImpStream& aIn; // input stream
97 : :
98 : : ScfUInt32Vec maSheetOffsets;
99 : : ScRange maScOleSize; /// Visible range if embedded.
100 : :
101 : : NameBuffer* pExtNameBuff; // ... externe Namen (Ind.-Basis=1)
102 : : ExcelToSc* pFormConv; // Formel-Konverter
103 : :
104 : : XclImpOutlineBuffer* pColOutlineBuff;
105 : : XclImpOutlineBuffer* pRowOutlineBuff;
106 : : XclImpColRowSettings* pColRowBuff; // Col/Row-Einstellungen 1 Tabelle
107 : :
108 : : typedef boost::ptr_vector< XclImpOutlineDataBuffer > XclImpOutlineListBuffer;
109 : : XclImpOutlineListBuffer* pOutlineListBuffer;
110 : :
111 : : sal_Int16 mnLastRefIdx;
112 : : sal_uInt16 nIxfeIndex; // merkt sich Angabe im IXFE-Record
113 : : sal_uInt16 nLastXF; // letzter XF in Formula-Record
114 : : SCTAB nBdshtTab; // Counter fuer Boundsheet
115 : : ScFormulaCell* pLastFormCell; // fuer String-Records
116 : :
117 : : sal_Bool bTabTruncated; // wenn Bereichsueberschreitung zum
118 : : // Abschneiden von Zellen fuehrt
119 : :
120 : : // Record-Funktionen
121 : : void ReadFileSharing();
122 : :
123 : : sal_uInt16 ReadXFIndex( bool bBiff2 );
124 : :
125 : : void ReadDimensions();
126 : : void ReadBlank();
127 : : void ReadInteger();
128 : : void ReadNumber();
129 : : void ReadLabel();
130 : : void ReadBoolErr();
131 : : void ReadRk();
132 : :
133 : : void Window1();
134 : : void Formula25( void ); // 0x06 -> excform.cxx
135 : : void Row25( void ); // 0x08
136 : : void Bof2( void ); // 0x09
137 : : void Eof( void ); // 0x0A
138 : : void DocProtect( void ); // 0x12
139 : : void SheetProtect( void ); // 0x12 Sheet Protection
140 : : void DocPasssword( void ); // 0x13 document password
141 : : void SheetPassword( void ); // 0x13 sheet password
142 : : void Externsheet( void ); // 0x17
143 : : void WinProtection( void ); // 0x19
144 : : void Columndefault( void ); // 0x20
145 : : void Array25( void ); // 0x21
146 : : void Rec1904( void ); // 0x22
147 : : void Externname25( void ); // 0x23
148 : : void Colwidth( void ); // 0x24
149 : : void Defrowheight2( void ); // 0x25
150 : : // void Window1( void ); // 0x3D
151 : : void Codepage( void ); // 0x42
152 : : void Ixfe( void ); // 0x44
153 : : void DefColWidth( void ); // 0x55
154 : : void Builtinfmtcnt( void ); // 0x56
155 : : void Colinfo( void ); // 0x7D
156 : : void Wsbool( void ); // 0x81
157 : : void Boundsheet( void ); // 0x85
158 : : void Country( void ); // 0x8C
159 : : void Hideobj( void ); // 0x8D
160 : : void Bundleheader( void ); // 0x8F
161 : : void Standardwidth( void ); // 0x99
162 : : void Shrfmla( void ); // 0xBC
163 : : void Mulrk( void ); // 0xBD
164 : : void Mulblank( void ); // 0xBE
165 : : void Rstring( void ); // 0xD6
166 : : void Cellmerging( void ); // 0xE5
167 : : void Olesize( void ); // 0xDE
168 : : void ReadUsesElfs(); // 0x0160
169 : : void Formula3( void ); // 0x0206 -> excform.cxx
170 : : // 0x0207 -> 0x07
171 : : void Row34( void ); // 0x0208
172 : : void Bof3( void ); // 0x0209
173 : : void Array34( void ); // 0x0221
174 : : void Externname34( void ); // 0x0223
175 : : void Defrowheight345( void ); // 0x0225
176 : : void TableOp( void ); // 0x0236
177 : : //void Rk( void ); // 0x027E -> 0x7E
178 : : void Formula4( void ); // 0x0406 -> excform.cxx
179 : : void Bof4( void ); // 0x0409
180 : : void Bof5( void ); // 0x0809
181 : :
182 : : // ---------------------------------------------------------------
183 : : void Formula(
184 : : const XclAddress& rXclPos, sal_uInt16 nXF, sal_uInt16 nFormLen, double fCurVal, bool bShrFmla);
185 : : // -> excform.cxx
186 : :
187 : : virtual void EndSheet( void );
188 : : void NeueTabelle( void );
189 : : const ScTokenArray* ErrorToFormula( sal_uInt8 bErrOrVal, sal_uInt8 nError,
190 : : double& rVal );
191 : :
192 : : virtual void AdjustRowHeight();
193 : : virtual void PostDocLoad( void );
194 : :
195 : : public:
196 : : ImportExcel( XclImpRootData& rImpData, SvStream& rStrm );
197 : :
198 : : virtual ~ImportExcel( void );
199 : :
200 : : virtual FltError Read( void );
201 : : };
202 : :
203 : : #endif
204 : :
205 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|