Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef SC_LOTIMPOP_HXX
21 : #define SC_LOTIMPOP_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 :
25 : #include "imp_op.hxx"
26 : #include "flttypes.hxx"
27 : #include "ftools.hxx"
28 : #include "lotform.hxx"
29 : #include "lotattr.hxx"
30 :
31 : class ScFormulaCell;
32 : class LotusFontBuffer;
33 :
34 :
35 : class ImportLotus : public ImportTyp
36 : {
37 : private:
38 : SvStream* pIn; // benoetigt wegen multiplem Read()!
39 : LotusToSc aConv;
40 : sal_uInt16 nTab; // z.Zt. bearbeitete Tabelle
41 : sal_Int32 nExtTab;
42 :
43 : // in WK?-Datei
44 : void Bof( void ); // 0x0000 00
45 : bool BofFm3( void ); // 0x0000 00
46 : void Columnwidth( sal_uInt16 nRecLen ); // 0x0007 07
47 : void Hiddencolumn( sal_uInt16 nRecLen ); // 0x0008 08
48 : void Userrange( void ); // 0x0009 09
49 : void Errcell( void ); // 0x0014 20
50 : void Nacell( void ); // 0x0015 21
51 : void Labelcell( void ); // 0x0016 22
52 : void Numbercell( void ); // 0x0017 23
53 : void Smallnumcell( void ); // 0x0018 24
54 : ScFormulaCell* Formulacell( sal_uInt16 nRecLen ); // 0x0019 25
55 : void Formulastring( ScFormulaCell& ); // 0x001a 26
56 : // 0x001b 27 special
57 : void NamedSheet( void ); // 14000
58 : void RowPresentation( sal_uInt16 nRecLen ); // 2007
59 :
60 :
61 : // in FM?-Datei
62 : void Font_Face( void ); // 174
63 : void Font_Type( void ); // 176
64 : void Font_Ysize( void ); // 177
65 : void _Row( const sal_uInt16 nRecLen ); // 197 ?
66 :
67 : inline void Read( ScAddress& );
68 : inline void Read( ScRange& );
69 : // fuer Addresses/Ranges im Format Row(16)/Tab(8)/Col(8)
70 : inline void Read( sal_Char& );
71 : inline void Read( sal_uInt8& );
72 : inline void Read( sal_uInt16& );
73 : inline void Read( sal_Int16& );
74 : inline void Read( sal_uInt32& );
75 : inline void Read( double& ); // 10-Byte-IEEE lesen
76 : inline void Read( LotAttrWK3& );
77 : void Read( OUString& ); // 0-terminierten String einlesen
78 : inline void Skip( const sal_uInt16 nNumBytes );
79 :
80 : public:
81 : ImportLotus( SvStream&, ScDocument*, rtl_TextEncoding eSrc );
82 :
83 : virtual ~ImportLotus();
84 :
85 : FltError Read() SAL_OVERRIDE;
86 : FltError Read( SvStream& ); // special for *.fm3-Dateien
87 : };
88 :
89 :
90 0 : inline void ImportLotus::Read( ScAddress& rAddr )
91 : {
92 : sal_uInt16 nRow;
93 0 : pIn->ReadUInt16( nRow );
94 0 : rAddr.SetRow( static_cast<SCROW>(nRow) );
95 : sal_uInt8 nByte;
96 0 : pIn->ReadUChar( nByte );
97 0 : rAddr.SetTab( static_cast<SCTAB>(nByte) );
98 0 : pIn->ReadUChar( nByte );
99 0 : rAddr.SetCol( static_cast<SCCOL>(nByte) );
100 0 : }
101 :
102 :
103 0 : inline void ImportLotus::Read( ScRange& rRange )
104 : {
105 0 : Read( rRange.aStart );
106 0 : Read( rRange.aEnd );
107 0 : }
108 :
109 :
110 0 : inline void ImportLotus::Read( sal_Char& r )
111 : {
112 0 : pIn->ReadChar( r );
113 0 : }
114 :
115 :
116 0 : inline void ImportLotus::Read( sal_uInt8& r )
117 : {
118 0 : pIn->ReadUChar( r );
119 0 : }
120 :
121 :
122 0 : inline void ImportLotus::Read( sal_uInt16& r )
123 : {
124 0 : pIn->ReadUInt16( r );
125 0 : }
126 :
127 :
128 0 : inline void ImportLotus::Read( sal_Int16& r )
129 : {
130 0 : pIn->ReadInt16( r );
131 0 : }
132 :
133 :
134 : inline void ImportLotus::Read( sal_uInt32& r )
135 : {
136 : pIn->ReadUInt32( r );
137 : }
138 :
139 :
140 0 : inline void ImportLotus::Read( double& r )
141 : {
142 0 : r = ScfTools::ReadLongDouble( *pIn );
143 0 : }
144 :
145 :
146 0 : inline void ImportLotus::Read( LotAttrWK3& r )
147 : {
148 0 : pIn->ReadUChar( r.nFont ).ReadUChar( r.nFontCol ).ReadUChar( r.nBack ).ReadUChar( r.nLineStyle );
149 0 : }
150 :
151 :
152 0 : inline void ImportLotus::Skip( const sal_uInt16 n )
153 : {
154 0 : pIn->SeekRel( n );
155 0 : }
156 :
157 : #endif
158 :
159 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|