xref: /trunk/main/sc/source/filter/inc/lotimpop.hxx (revision 3ee7c2db)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_LOTIMPOP_HXX
25 #define SC_LOTIMPOP_HXX
26 
27 #include <tools/string.hxx>
28 
29 #include "imp_op.hxx"
30 #include "flttypes.hxx"
31 #include "ftools.hxx"
32 #include "lotform.hxx"
33 #include "lotattr.hxx"
34 
35 class ScFormulaCell;
36 class LotusFontBuffer;
37 class SvxBorderLine;
38 
39 
40 class ImportLotus : public ImportTyp
41 {
42 private:
43 	SvStream*			pIn;			// benoetigt wegen multiplem Read()!
44 	LotusToSc			aConv;
45     sal_uInt16              nTab;           // z.Zt. bearbeitete Tabelle
46 	sal_Int32				nExtTab;
47 	// -------------------------------------------------------------------
48 	// in WK?-Datei
49 	void				Bof( void );						// 0x0000	00
50 	sal_Bool				BofFm3( void );						// 0x0000	00
51 	void				Columnwidth( sal_uInt16 nRecLen );		// 0x0007	07
52 	void				Hiddencolumn( sal_uInt16 nRecLen );		// 0x0008	08
53 	void				Userrange( void );					// 0x0009	09
54 	void				Errcell( void );					// 0x0014	20
55 	void				Nacell( void );						// 0x0015	21
56 	void				Labelcell( void );					// 0x0016	22
57 	void				Numbercell( void );					// 0x0017	23
58 	void				Smallnumcell( void );				// 0x0018	24
59 	ScFormulaCell*		Formulacell( sal_uInt16 nRecLen );		// 0x0019	25
60 	void				Formulastring( ScFormulaCell& );	// 0x001a	26
61 															// 0x001b	27 special
62 	void				NamedSheet( void );					//			14000
63 	void				RowPresentation( sal_uInt16 nRecLen );	//			 2007
64 
65 	// -------------------------------------------------------------------
66 	// in FM?-Datei
67 	void				Font_Face( void );					// 174
68 	void				Font_Type( void );					// 176
69 	void				Font_Ysize( void );					// 177
70 	void				_Row( const sal_uInt16 nRecLen );		// 197 ?
71 	// -------------------------------------------------------------------
72 	inline void			Read( ScAddress& );
73 	inline void			Read( ScRange& );
74 		// fuer Addresses/Ranges im Format Row(16)/Tab(8)/Col(8)
75 	inline void			Read( sal_Char& );
76 	inline void			Read( sal_uInt8& );
77 	inline void			Read( sal_uInt16& );
78 	inline void			Read( sal_Int16& );
79 	inline void			Read( sal_uInt32& );
80 	inline void			Read( double& );					// 10-Byte-IEEE lesen
81 	inline void			Read( LotAttrWK3& );
82 	void				Read( String& );					// 0-terminierten String einlesen
83 	inline void			Skip( const sal_uInt16 nNumBytes );
84 	// -------------------------------------------------------------------
85 public:
86 						ImportLotus( SvStream&, ScDocument*, CharSet eSrc );
87 
88 	virtual				~ImportLotus();
89 
90 	FltError			Read();
91 	FltError			Read( SvStream& );					// special for *.fm3-Dateien
92 };
93 
94 
Read(ScAddress & rAddr)95 inline void ImportLotus::Read( ScAddress& rAddr )
96 {
97 	sal_uInt16 nRow;
98 	*pIn >> nRow;
99 	rAddr.SetRow( static_cast<SCROW>(nRow) );
100 	sal_uInt8 nByte;
101 	*pIn >> nByte;
102 	rAddr.SetTab( static_cast<SCTAB>(nByte) );
103 	*pIn >> nByte;
104 	rAddr.SetCol( static_cast<SCCOL>(nByte) );
105 }
106 
107 
Read(ScRange & rRange)108 inline void ImportLotus::Read( ScRange& rRange )
109 {
110 	Read( rRange.aStart );
111 	Read( rRange.aEnd );
112 }
113 
114 
Read(sal_Char & r)115 inline void ImportLotus::Read( sal_Char& r )
116 {
117 	*pIn >> r;
118 }
119 
120 
Read(sal_uInt8 & r)121 inline void ImportLotus::Read( sal_uInt8& r )
122 {
123 	*pIn >> r;
124 }
125 
126 
Read(sal_uInt16 & r)127 inline void ImportLotus::Read( sal_uInt16& r )
128 {
129 	*pIn >> r;
130 }
131 
132 
Read(sal_Int16 & r)133 inline void ImportLotus::Read( sal_Int16& r )
134 {
135 	*pIn >> r;
136 }
137 
138 
Read(sal_uInt32 & r)139 inline void ImportLotus::Read( sal_uInt32& r )
140 {
141 	*pIn >> r;
142 }
143 
144 
Read(double & r)145 inline void ImportLotus::Read( double& r )
146 {
147     r = ScfTools::ReadLongDouble( *pIn );
148 }
149 
150 
Read(LotAttrWK3 & r)151 inline void ImportLotus::Read( LotAttrWK3& r )
152 {
153 	*pIn >> r.nFont >> r.nFontCol >> r.nBack >> r.nLineStyle;
154 }
155 
156 
Skip(const sal_uInt16 n)157 inline void ImportLotus::Skip( const sal_uInt16 n )
158 {
159 	pIn->SeekRel( n );
160 }
161 
162 
163 
164 #endif
165