LotusSpreadsheet.h Source File documentation

LotusSpreadsheet.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
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 * Major Contributor(s):
10 * Copyright (C) 2006, 2007 Andrew Ziem
11 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 */
21
22 #ifndef LOTUS_SPREADSHEET_H
23 #define LOTUS_SPREADSHEET_H
24
25 #include <ostream>
26 #include <vector>
27
28 #include <librevenge-stream/librevenge-stream.h>
29
30 #include "libwps_internal.h"
31
32 #include "WPSDebug.h"
33 #include "WKSContentListener.h"
34
35 namespace LotusSpreadsheetInternal
36 {
37 class Cell;
38 class Spreadsheet;
39 struct Style;
40 struct State;
41 struct Table123Styles;
42 class SubDocument;
43 }
44
45 class LotusParser;
46 class LotusStyleManager;
47
52 class LotusSpreadsheet
53 {
54 public:
55 friend class LotusParser;
56 friend class LotusSpreadsheetInternal::SubDocument;
57
59 explicit LotusSpreadsheet(LotusParser &parser);
61 ~LotusSpreadsheet();
63 void cleanState();
65 void updateState();
67 void setListener(WKSContentListenerPtr &listen)
68 {
69 m_listener = listen;
70 }
72 void setLastSpreadsheetId(int id);
73
74 // interface which LotusParser
75
77 bool getLeftTopPosition(Vec2i const &cell, int spreadsheet, Vec2f &pos);
78 protected:
80 int version() const;
82 bool hasSomeSpreadsheetData() const;
83
85 void sendSpreadsheet(int sheetId);
87 librevenge::RVNGString getSheetName(int id) const;
88
92 void sendRowContent(LotusSpreadsheetInternal::Spreadsheet const &sheet, int row, LotusSpreadsheetInternal::Table123Styles const *table123Styles);
94 void sendCellContent(LotusSpreadsheetInternal::Cell const &cell,
95 LotusSpreadsheetInternal::Style const &style, int numRepeated=1);
97 void sendText(RVNGInputStreamPtr &input, long endPos, LotusSpreadsheetInternal::Style const &style) const;
99 void sendTextNote(RVNGInputStreamPtr &input, WPSEntry const &entry) const;
100
102
103 //
104 // low level
105 //
107
109 bool readSheetName(std::shared_ptr<WPSStream> stream);
111 bool readSheetName1B(std::shared_ptr<WPSStream> stream, long endPos);
112
114 bool readCellsFormat801(std::shared_ptr<WPSStream> stream, WPSVec3i const &minC, WPSVec3i const &maxC, int typeZone);
116 bool readColumnDefinition(std::shared_ptr<WPSStream> stream);
118 bool readColumnSizes(std::shared_ptr<WPSStream> stream);
120 bool readRowFormats(std::shared_ptr<WPSStream> stream);
122 bool readRowFormat(std::shared_ptr<WPSStream> stream, LotusSpreadsheetInternal::Style &style, int &numCell, long endPos);
124 bool readRowSizes(std::shared_ptr<WPSStream> stream, long endPos);
125
127 bool readCell(std::shared_ptr<WPSStream> stream);
129 bool readCellName(std::shared_ptr<WPSStream> stream);
130
131 // in fmt
132
134 bool readSheetHeader(std::shared_ptr<WPSStream> stream);
136 bool readExtraRowFormats(std::shared_ptr<WPSStream> stream);
137
138 // in zone 0x1b
139
141 static bool readNote(std::shared_ptr<WPSStream> stream, long endPos);
142
143 // data in formula
144
145 /* reads a cell */
146 bool readCell(WPSStream &stream, int sId, bool isList, WKSContentListener::FormulaInstruction &instr);
147 /* reads a formula */
148 bool readFormula(WPSStream &stream, long endPos, int sId, bool newFormula,
149 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
150 /* try to parse a variable data */
151 static bool parseVariable(std::string const &variable, WKSContentListener::FormulaInstruction &instr);
153 static std::string getDebugStringForText(std::string const &text);
154 private:
155 LotusSpreadsheet(LotusSpreadsheet const &orig) = delete;
156 LotusSpreadsheet &operator=(LotusSpreadsheet const &orig) = delete;
157 std::shared_ptr<WKSContentListener> m_listener;
158 LotusParser &m_mainParser;
161 std::shared_ptr<LotusStyleManager> m_styleManager;
163 std::shared_ptr<LotusSpreadsheetInternal::State> m_state;
164 };
165
166 #endif /* LOTUS_SPREAD_SHEET_H */
167 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
LotusSpreadsheetInternal::Style::operator==
bool operator==(Style const &st) const
operator==
Definition: LotusSpreadsheet.cpp:81
WKSContentListener::FormulaInstruction::F_Text
@ F_Text
Definition: WKSContentListener.h:59
LotusSpreadsheet::readRowSizes
bool readRowSizes(std::shared_ptr< WPSStream > stream, long endPos)
reads the row size ( in pt*32 )
Definition: LotusSpreadsheet.cpp:1759
LotusSpreadsheetInternal::Cell::Cell
Cell()
constructor
Definition: LotusSpreadsheet.cpp:223
WPSCellFormat::F_BOOLEAN
@ F_BOOLEAN
Definition: WPSCell.h:54
LotusSpreadsheetInternal::Format123Style::operator=
Format123Style & operator=(Format123Style const &)=default
LotusSpreadsheet::version
int version() const
return the file version
Definition: LotusSpreadsheet.cpp:914
WKSSubDocument::parser
WKSParser * parser() const
returns the parser
Definition: WKSSubDocument.h:44
LotusSpreadsheetInternal::SubDocument::m_sheetParser
LotusSpreadsheet * m_sheetParser
the spreadsheet parse
Definition: LotusSpreadsheet.cpp:779
LotusSpreadsheetInternal::Spreadsheet::m_rowPageBreaksList
std::vector< int > m_rowPageBreaksList
the list of row page break
Definition: LotusSpreadsheet.cpp:483
LotusSpreadsheetInternal::Cell::m_styleId
int m_styleId
the style
Definition: LotusSpreadsheet.cpp:252
LotusSpreadsheet::readSheetName1B
bool readSheetName1B(std::shared_ptr< WPSStream > stream, long endPos)
reads a sheet name: zone 0x1b 36b0
Definition: LotusSpreadsheet.cpp:3262
LotusSpreadsheetInternal::State::m_version
int m_version
the file version
Definition: LotusSpreadsheet.cpp:735
LotusSpreadsheetInternal::CellsList::CellsList
CellsList()
constructor
Definition: LotusSpreadsheet.cpp:196
LotusSpreadsheetInternal::ExtraStyle::m_color
WPSColor m_color
the font color
Definition: LotusSpreadsheet.cpp:147
WKSContentListener::FormulaInstruction::m_fileName
librevenge::RVNGString m_fileName
the file name (external reference)
Definition: WKSContentListener.h:96
LotusSpreadsheetInternal::Format123Style::update
void update(Style &style) const
update the cell style
Definition: LotusSpreadsheet.cpp:508
WKSContentListener::CellContent::m_formula
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: WKSContentListener.h:155
LotusSpreadsheet::hasSomeSpreadsheetData
bool hasSomeSpreadsheetData() const
returns true if some spreadsheet are defined
Definition: LotusSpreadsheet.cpp:921
libwps::DebugStream::str
static std::string str()
Definition: WPSDebug.h:200
LotusSpreadsheetInternal::Spreadsheet::getRowHeight
WPSRowFormat getRowHeight(int row) const
returns the row size in point
Definition: LotusSpreadsheet.cpp:341
LotusSpreadsheet::readSheetHeader
bool readSheetHeader(std::shared_ptr< WPSStream > stream)
try to read a sheet header: 0xc3
Definition: LotusSpreadsheet.cpp:1879
WKSContentListener::FormulaInstruction::F_Long
@ F_Long
Definition: WKSContentListener.h:59
WPSCellFormat::HALIGN_FULL
@ HALIGN_FULL
Definition: WPSCell.h:47
WKSContentListener::CellContent::C_FORMULA
@ C_FORMULA
Definition: WKSContentListener.h:102
WPS_BOLD_BIT
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
LotusSpreadsheetInternal::Table123Styles::addCellStyle
void addCellStyle(Vec2i const &cols, Vec2i const &rows, Format123Style const &format)
add a extra style to a list of cell
Definition: LotusSpreadsheet.cpp:621
libwps::DebugFile::addPos
static void addPos(long)
Definition: WPSDebug.h:220
LotusSpreadsheetInternal::Table123Styles
a class used to store the styles of a table in LotusSpreadsheet in a lotus 123 files
Definition: LotusSpreadsheet.cpp:569
WKSContentListener::FormulaInstruction::F_Cell
@ F_Cell
Definition: WKSContentListener.h:59
LotusSpreadsheet::readCell
bool readCell(std::shared_ptr< WPSStream > stream)
reads a cell
Definition: LotusSpreadsheet.cpp:2109
WPSEntry::end
long end() const
returns the end offset
Definition: WPSEntry.h:78
LotusSpreadsheet::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: LotusSpreadsheet.h:67
LotusSpreadsheetInternal::Extra123Style::update
void update(Style &style) const
update the cell style
Definition: LotusSpreadsheet.cpp:556
WPSCell.h
LotusSpreadsheetInternal::Spreadsheet::empty
bool empty() const
returns true if the spreedsheet is empty
Definition: LotusSpreadsheet.cpp:464
WPSBox2::setMin
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libwps_internal.h:771
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
LotusSpreadsheetInternal::Spreadsheet::m_rowHeightMap
std::map< Vec2i, WPSRowFormat > m_rowHeightMap
the map Vec2i(min row, max row) to size in points
Definition: LotusSpreadsheet.cpp:479
LotusSpreadsheet::getDebugStringForText
static std::string getDebugStringForText(std::string const &text)
small debug function used to print text with format sequence
Definition: LotusSpreadsheet.cpp:3488
LotusSpreadsheetInternal::ExtraStyle::m_flag
int m_flag
the second flag: graph
Definition: LotusSpreadsheet.cpp:153
LotusSpreadsheetInternal::Format123Style::m_alignAcrossColumn
bool m_alignAcrossColumn
flag to know if we must align across column
Definition: LotusSpreadsheet.cpp:520
LotusSpreadsheet::m_styleManager
std::shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition: LotusSpreadsheet.h:161
LotusSpreadsheetInternal::Table123Styles::Table123Styles
Table123Styles()
constructor
Definition: LotusSpreadsheet.cpp:572
libwps::readDouble2Inv
bool readDouble2Inv(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 2 bytes: exponent 1.5 bytes, kind of mantisse 0.5 bytes
Definition: libwps_internal.cpp:273
LotusSpreadsheetInternal::Style::m_fontType
libwps_tools_win::Font::Type m_fontType
font encoding type
Definition: LotusSpreadsheet.cpp:92
LotusSpreadsheetInternal::s_listFunctions
static const Functions s_listFunctions[]
Definition: LotusSpreadsheet.cpp:2866
LotusSpreadsheet::readSheetName
bool readSheetName(std::shared_ptr< WPSStream > stream)
reads a sheet name: zone 0x23
Definition: LotusSpreadsheet.cpp:1821
LotusSpreadsheetInternal::Style::m_extra
std::string m_extra
extra data
Definition: LotusSpreadsheet.cpp:94
WPSTable.h
WPS_UNDERLINE_BIT
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
LotusSpreadsheetInternal::Format123Style::operator==
bool operator==(Format123Style const &f) const
operator==
Definition: LotusSpreadsheet.cpp:515
WPSCellFormat::getFormat
FormatType getFormat() const
returns the format type
Definition: WPSCell.h:152
WKSSubDocument.h
WPSCellFormat::HALIGN_DEFAULT
@ HALIGN_DEFAULT
Definition: WPSCell.h:47
LotusSpreadsheetInternal::Table123Styles::addCellStyle
void addCellStyle(Vec2i const &cols, Vec2i const &rows, Extra123Style const &extra)
add a extra style to a list of cell
Definition: LotusSpreadsheet.cpp:602
WKSContentListener::FormulaInstruction::F_Operator
@ F_Operator
Definition: WKSContentListener.h:59
LotusSpreadsheetInternal::Cell::operator<<
friend std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: LotusSpreadsheet.cpp:267
WPSBorder::BottomBit
@ BottomBit
Definition: libwps_internal.h:401
WKSContentListener::FormulaInstruction::F_Double
@ F_Double
Definition: WKSContentListener.h:59
WKSContentListener::FormulaInstruction::m_longValue
double m_longValue
value ( if type==F_Long )
Definition: WKSContentListener.h:81
LotusSpreadsheetInternal::Spreadsheet::m_numRows
int m_numRows
the number of rows
Definition: LotusSpreadsheet.cpp:473
WPSStream
small structure use to store a stream and it debug file
Definition: WPSStream.h:29
LotusSpreadsheetInternal::Format123Style
the format style for lotus 123
Definition: LotusSpreadsheet.cpp:496
WKSContentListener::FormulaInstruction::F_Function
@ F_Function
Definition: WKSContentListener.h:59
LotusSpreadsheetInternal::Cell::m_comment
WPSEntry m_comment
the comment entry
Definition: LotusSpreadsheet.cpp:258
LotusSpreadsheet::readColumnDefinition
bool readColumnDefinition(std::shared_ptr< WPSStream > stream)
reads the columns definitions
Definition: LotusSpreadsheet.cpp:937
LotusSpreadsheetInternal::State::getSheet
Spreadsheet & getSheet(int id)
returns the ith spreadsheet
Definition: LotusSpreadsheet.cpp:674
LotusSpreadsheetInternal::Spreadsheet::setRowHeight
void setRowHeight(int row, WPSRowFormat const &format)
set the rows size
Definition: LotusSpreadsheet.cpp:351
WPSColumnFormat
Definition: WPSTable.h:39
WPSBorder::m_width
int m_width
the border width
Definition: libwps_internal.h:450
LotusSpreadsheetInternal::CellsList
a list of position of a Lotus spreadsheet
Definition: LotusSpreadsheet.cpp:193
LotusSpreadsheetInternal::Style::operator=
Style & operator=(Style const &)=default
LotusStyleManager
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
libwps_tools_win::Font::unicodeString
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true)
converts a list of character in unicode
Definition: libwps_tools_win.cpp:7283
LotusSpreadsheetInternal::ExtraStyle
the extra style
Definition: LotusSpreadsheet.cpp:101
LotusParser::getDefaultFontType
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Lotus.cpp:273
LotusSpreadsheetInternal::CellsList::operator<<
friend std::ostream & operator<<(std::ostream &o, CellsList const &pos)
operator<<
Definition: LotusSpreadsheet.cpp:202
WPSColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
WKSContentListener::FormulaInstruction::m_doubleValue
double m_doubleValue
value ( if type==F_Double )
Definition: WKSContentListener.h:83
LotusSpreadsheetInternal::State::m_sheetIdToTableStyleMap
std::map< Vec2i, Table123Styles > m_sheetIdToTableStyleMap
map Vec2i(sheetMin, sheetMax) to table style
Definition: LotusSpreadsheet.cpp:747
WPSCellFormat::setFormat
void setFormat(FormatType form, int subForm=0)
sets the format type
Definition: WPSCell.h:167
LotusSpreadsheetInternal::Spreadsheet
the spreadsheet of a LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:294
LotusSpreadsheet::readRowFormat
bool readRowFormat(std::shared_ptr< WPSStream > stream, LotusSpreadsheetInternal::Style &style, int &numCell, long endPos)
reads a cell's row format
Definition: LotusSpreadsheet.cpp:1200
WPSCellFormat::HALIGN_RIGHT
@ HALIGN_RIGHT
Definition: WPSCell.h:46
WPSFont
define the font properties
Definition: WPSFont.h:36
LotusSpreadsheetInternal::Cell::send
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: LotusSpreadsheet.cpp:240
WPSEntry::valid
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:89
WPS_ITALICS_BIT
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
LotusSpreadsheet::getSheetName
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition: LotusSpreadsheet.cpp:831
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
LotusSpreadsheet::readFormula
bool readFormula(WPSStream &stream, long endPos, int sId, bool newFormula, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition: LotusSpreadsheet.cpp:2925
Vec2i
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
LotusSpreadsheetInternal::SubDocument::operator==
bool operator==(std::shared_ptr< WPSSubDocument > const &doc) const final
operator==
Definition: LotusSpreadsheet.cpp:765
LotusSpreadsheetInternal::Spreadsheet::m_name
librevenge::RVNGString m_name
the sheet name
Definition: LotusSpreadsheet.cpp:469
WPSCell::setPosition
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
LotusSpreadsheetInternal::State::m_spreadsheetList
std::vector< Spreadsheet > m_spreadsheetList
the list of spreadsheet ( first: main spreadsheet, other report spreadsheet )
Definition: LotusSpreadsheet.cpp:737
LotusSpreadsheetInternal::Spreadsheet::m_heightDefault
float m_heightDefault
the default row size in point
Definition: LotusSpreadsheet.cpp:481
LotusSpreadsheetInternal::ExtraRowStyles
a class used to store the extra style of a row in LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:171
WKSContentListener::FormulaInstruction::m_type
What m_type
the type
Definition: WKSContentListener.h:77
LotusSpreadsheetInternal::Cell::Cell
Cell(RVNGInputStreamPtr const &input)
constructor
Definition: LotusSpreadsheet.cpp:230
libwps::readDouble10
bool readDouble10(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 10 bytes: mantisse 8 bytes, exponent 2 bytes
Definition: libwps_internal.cpp:224
WKSContentListener::FormulaInstruction::m_position
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
LotusSpreadsheet::readColumnSizes
bool readColumnSizes(std::shared_ptr< WPSStream > stream)
reads the column sizes ( in char )
Definition: LotusSpreadsheet.cpp:1019
LotusSpreadsheetInternal::Table123Styles::m_rowsToColsToFormatStyleMap
std::map< Vec2i, std::map< Vec2i, Format123Style > > m_rowsToColsToFormatStyleMap
map rows to cols to format style
Definition: LotusSpreadsheet.cpp:649
WPSListenerPtr
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
LotusSpreadsheetInternal::Style::~Style
~Style() final
destructor
Definition: LotusSpreadsheet.cpp:97
LotusSpreadsheetInternal::State::getNumSheet
int getNumSheet() const
returns the number of spreadsheet
Definition: LotusSpreadsheet.cpp:669
LotusSpreadsheetInternal::SubDocument
Internal: the subdocument of a LotusSpreadsheet.
Definition: LotusSpreadsheet.cpp:753
LotusSpreadsheetInternal::State::m_rowSheetIdToStyleIdMap
std::map< Vec2i, size_t > m_rowSheetIdToStyleIdMap
map Vec2i(row, sheetId) to row style id
Definition: LotusSpreadsheet.cpp:743
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
LotusSpreadsheetInternal::Spreadsheet::Spreadsheet
Spreadsheet()
a constructor
Definition: LotusSpreadsheet.cpp:298
LotusSpreadsheetInternal::Spreadsheet::compressRowHeights
void compressRowHeights()
try to compress the list of row height
Definition: LotusSpreadsheet.cpp:392
LotusSpreadsheet::readCellsFormat801
bool readCellsFormat801(std::shared_ptr< WPSStream > stream, WPSVec3i const &minC, WPSVec3i const &maxC, int typeZone)
reads a cell zone formats: zone 801, lotus 123
Definition: LotusSpreadsheet.cpp:1406
LotusSpreadsheetInternal::ExtraStyle::m_format
int m_format
the format
Definition: LotusSpreadsheet.cpp:151
LotusSpreadsheetInternal::Format123Style::Format123Style
Format123Style()
constructor
Definition: LotusSpreadsheet.cpp:499
LotusSpreadsheetInternal::Spreadsheet::m_widthCols
std::vector< WPSColumnFormat > m_widthCols
the column size
Definition: LotusSpreadsheet.cpp:477
LotusSpreadsheetInternal::ExtraStyle::ExtraStyle
ExtraStyle()
constructor
Definition: LotusSpreadsheet.cpp:104
Vec2< int >
LotusSpreadsheet::sendCellContent
void sendCellContent(LotusSpreadsheetInternal::Cell const &cell, LotusSpreadsheetInternal::Style const &style, int numRepeated=1)
send the cell data
Definition: LotusSpreadsheet.cpp:2738
WPSVec3< int >
LotusSpreadsheetInternal::Spreadsheet::m_rowToExtraStyleMap
std::map< int, ExtraRowStyles > m_rowToExtraStyleMap
map row to extra style
Definition: LotusSpreadsheet.cpp:489
LotusSpreadsheetInternal::Extra123Style::m_borders
WPSBorder m_borders[2]
the top/left border
Definition: LotusSpreadsheet.cpp:565
WPSBorder::TopBit
@ TopBit
Definition: libwps_internal.h:401
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
WPSFont::m_color
WPSColor m_color
the font color
Definition: WPSFont.h:91
WPSCellFormat::getDTFormat
std::string getDTFormat() const
returns the date/time format ( if set)
Definition: WPSCell.h:162
LotusParser
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
WPSCellFormat::F_TIME
@ F_TIME
Definition: WPSCell.h:54
LotusParser::version
int version() const
return the file version
Definition: Lotus.cpp:265
LotusSpreadsheet::parseVariable
static bool parseVariable(std::string const &variable, WKSContentListener::FormulaInstruction &instr)
Definition: LotusSpreadsheet.cpp:2787
WPSEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:57
LotusSpreadsheet::getLeftTopPosition
bool getLeftTopPosition(Vec2i const &cell, int spreadsheet, Vec2f &pos)
returns the left top position of a cell
Definition: LotusSpreadsheet.cpp:817
LotusSpreadsheetInternal::Spreadsheet::getRowStyleId
int getRowStyleId(int row) const
returns the row style id corresponding to a sheetId (or -1)
Definition: LotusSpreadsheet.cpp:455
LotusSpreadsheetInternal::State::getTablesStyle
Table123Styles * getTablesStyle(Vec2i pos)
returns a table style for a sheet zone, create it if needed
Definition: LotusSpreadsheet.cpp:694
WPSCellFormat::F_NUMBER
@ F_NUMBER
Definition: WPSCell.h:54
WKSContentListenerPtr
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
WKSContentListener::FormulaInstruction::m_sheetName
librevenge::RVNGString m_sheetName[2]
the sheet name
Definition: WKSContentListener.h:89
LotusSpreadsheetInternal::ExtraRowStyles::ExtraRowStyles
ExtraRowStyles()
constructor
Definition: LotusSpreadsheet.cpp:174
MAX_COLUMNS
static const int MAX_COLUMNS
Definition: LotusSpreadsheet.cpp:52
LotusSpreadsheetInternal::Cell::m_content
WKSContentListener::CellContent m_content
the content
Definition: LotusSpreadsheet.cpp:256
LotusSpreadsheetInternal::Table123Styles::m_defaultCellId
int m_defaultCellId
the default cell style
Definition: LotusSpreadsheet.cpp:643
LotusSpreadsheetInternal::RowStyles
a class used to store the styles of a row in LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:159
libwps::SubDocumentType
SubDocumentType
Definition: libwps_internal.h:248
WKSContentListener::FormulaInstruction
small class use to define a formula instruction
Definition: WKSContentListener.h:57
LotusSpreadsheetInternal::State::m_sheetCurrentId
int m_sheetCurrentId
the sheet id
Definition: LotusSpreadsheet.cpp:749
WPSCellFormat::setDTFormat
void setDTFormat(FormatType form, std::string const &dtFormat="")
sets the format type
Definition: WPSCell.h:173
WPSBorder::Dot
@ Dot
Definition: libwps_internal.h:397
WPSCellFormat::digits
int digits() const
returns the number of digits ( for a number)
Definition: WPSCell.h:181
LotusSpreadsheetInternal::ExtraStyle::empty
bool empty() const
returns true if the style is empty
Definition: LotusSpreadsheet.cpp:113
WPSFont.h
WPSCellFormat::F_TEXT
@ F_TEXT
Definition: WPSCell.h:54
WPSColumnFormat::m_useOptimalWidth
bool m_useOptimalWidth
a flag to know if we need to see use-optimal column width
Definition: WPSTable.h:88
WPSCellFormat::m_font
WPSFont m_font
the cell font ( used in spreadsheet code )
Definition: WPSCell.h:262
WPSStream::m_input
RVNGInputStreamPtr m_input
the stream
Definition: WPSStream.h:43
WPSBorder::RightBit
@ RightBit
Definition: libwps_internal.h:401
WPSEntry.h
WPSFont::m_attributes
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:87
LotusSpreadsheetInternal::ExtraStyle::update
void update(Style &style) const
update the cell style
Definition: LotusSpreadsheet.cpp:120
LotusStyleManager.h
WPS_HIDDEN_BIT
#define WPS_HIDDEN_BIT
Definition: libwps_internal.h:516
libwps::DebugFile::addNote
static void addNote(char const *)
Definition: WPSDebug.h:221
LotusSpreadsheetInternal::Format123Style::~Format123Style
~Format123Style() final
destructor
Definition: LotusSpreadsheet.cpp:523
libwps::readDouble4Inv
bool readDouble4Inv(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 4 bytes: exponent 3.5 bytes, mantisse 0.5 bytes
Definition: libwps_internal.cpp:303
LotusSpreadsheet::sendText
void sendText(RVNGInputStreamPtr &input, long endPos, LotusSpreadsheetInternal::Style const &style) const
try to send a formated text
Definition: LotusSpreadsheet.cpp:3343
LotusSpreadsheet::sendSpreadsheet
void sendSpreadsheet(int sheetId)
send the data
Definition: LotusSpreadsheet.cpp:2408
LotusSpreadsheetInternal::Functions
Definition: LotusSpreadsheet.cpp:2860
WPSEntry::begin
long begin() const
returns the begin offset
Definition: WPSEntry.h:73
LotusSpreadsheetInternal::Style::operator!=
bool operator!=(Style const &st) const
operator!=
Definition: LotusSpreadsheet.cpp:87
LotusSpreadsheetInternal::Style
a class used to store a style of a cell in LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:59
libwps::read8
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
WPSFont::m_size
double m_size
font size
Definition: WPSFont.h:85
WPSCellFormat
a structure used to defined the cell format
Definition: WPSCell.h:40
WPSBorder::m_style
Style m_style
the border style
Definition: libwps_internal.h:446
WPSSubDocumentPtr
std::shared_ptr< WPSSubDocument > WPSSubDocumentPtr
shared pointer to WPSSubDocument
Definition: libwps_internal.h:111
WPSColumnFormat::m_numRepeat
int m_numRepeat
the number times a column is repeated
Definition: WPSTable.h:92
libwps::readDouble8
bool readDouble8(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 8 bytes: mantisse 6.5 bytes, exponent 1.5 bytes
Definition: libwps_internal.cpp:173
LotusSpreadsheetInternal::ExtraRowStyles::m_colsToStyleMap
std::map< Vec2i, ExtraStyle > m_colsToStyleMap
a map Vec2i(minCol,maxCol) to style
Definition: LotusSpreadsheet.cpp:189
WPSBorder::Dash
@ Dash
Definition: libwps_internal.h:397
WPSCellFormat::HALIGN_LEFT
@ HALIGN_LEFT
Definition: WPSCell.h:46
Lotus.h
WPSCellFormat::setHAlignment
void setHAlignment(HorizontalAlignment align)
sets the horizontal alignement
Definition: WPSCell.h:114
WKSContentListener::CellContent::m_textEntry
WPSEntry m_textEntry
the cell string
Definition: WKSContentListener.h:153
LotusSpreadsheet::readExtraRowFormats
bool readExtraRowFormats(std::shared_ptr< WPSStream > stream)
try to read an extra row format: 0xc5
Definition: LotusSpreadsheet.cpp:1923
LotusSpreadsheet::m_mainParser
LotusParser & m_mainParser
the listener (if set)
Definition: LotusSpreadsheet.h:159
WPSCell
a structure used to defined the cell position, and a format
Definition: WPSCell.h:290
WKSSubDocument
Basic class used to store a spreadsheet sub document.
Definition: WKSSubDocument.h:35
libwps::DebugStream
Definition: WPSDebug.h:191
WPSCellFormat::HorizontalAlignment
HorizontalAlignment
the default horizontal alignement.
Definition: WPSCell.h:46
LotusSpreadsheet::LotusSpreadsheet
LotusSpreadsheet(LotusParser &parser)
constructor
Definition: LotusSpreadsheet.cpp:800
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
WPSBorder
a border list
Definition: libwps_internal.h:394
LotusSpreadsheetInternal::SubDocument::parse
void parse(std::shared_ptr< WKSContentListener > &listener, libwps::SubDocumentType subDocumentType) final
the parser function
Definition: LotusSpreadsheet.cpp:787
LotusSpreadsheet::readRowFormats
bool readRowFormats(std::shared_ptr< WPSStream > stream)
reads the row formats
Definition: LotusSpreadsheet.cpp:1073
LotusSpreadsheet::~LotusSpreadsheet
~LotusSpreadsheet()
destructor
Definition: LotusSpreadsheet.cpp:808
LotusParser::sendGraphics
void sendGraphics(int sheetId)
send the graphics corresponding to a sheetId
Definition: Lotus.cpp:308
WPSRowFormat::m_isMinimalHeight
bool m_isMinimalHeight
a flag to know if the height is only a minimum
Definition: WPSTable.h:144
LotusSpreadsheetInternal::SubDocument::SubDocument
SubDocument(RVNGInputStreamPtr const &input, LotusSpreadsheet &sheetParser, WPSEntry const &entry)
constructor for a text entry
Definition: LotusSpreadsheet.cpp:757
libwps_tools_win.h
LotusSpreadsheetInternal::Extra123Style
the extra style for lotus 123
Definition: LotusSpreadsheet.cpp:528
LotusSpreadsheetInternal::Cell
a cellule of a Lotus spreadsheet
Definition: LotusSpreadsheet.cpp:219
LotusSpreadsheetInternal::State::State
State()
constructor
Definition: LotusSpreadsheet.cpp:656
WKSContentListener::FormulaInstruction::m_content
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: WKSContentListener.h:79
WPSEntry::setEnd
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:67
LotusSpreadsheetInternal::SubDocument::operator=
SubDocument & operator=(SubDocument const &)=delete
WPSCellFormat::setFont
void setFont(WPSFont const &font)
sets the font
Definition: WPSCell.h:104
LotusSpreadsheetInternal::ExtraRowStyles::empty
bool empty() const
returns true if all style are empty
Definition: LotusSpreadsheet.cpp:180
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7332
WPSBox2::setMax
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libwps_internal.h:776
LotusSpreadsheetInternal::CellsList::m_positions
WPSBox2i m_positions
the first and last position
Definition: LotusSpreadsheet.cpp:215
WPSBorder::Double
@ Double
Definition: libwps_internal.h:399
LotusSpreadsheetInternal::RowStyles::m_colsToStyleMap
std::map< Vec2i, Style > m_colsToStyleMap
a map Vec2i(minCol,maxCol) to style
Definition: LotusSpreadsheet.cpp:167
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
LotusSpreadsheet::m_state
std::shared_ptr< LotusSpreadsheetInternal::State > m_state
the internal state
Definition: LotusSpreadsheet.h:163
WPSCellFormat::getFont
const WPSFont & getFont() const
returns the font
Definition: WPSCell.h:99
LotusSpreadsheetInternal::RowStyles::RowStyles
RowStyles()
constructor
Definition: LotusSpreadsheet.cpp:162
WPSBorder::LeftBit
@ LeftBit
Definition: libwps_internal.h:401
WPSSubDocument::m_input
RVNGInputStreamPtr m_input
Definition: WPSSubDocument.h:65
LotusSpreadsheet::operator=
LotusSpreadsheet & operator=(LotusSpreadsheet const &orig)=delete
LotusSpreadsheetInternal
Definition: LotusSpreadsheet.cpp:54
LotusSpreadsheet::sendTextNote
void sendTextNote(RVNGInputStreamPtr &input, WPSEntry const &entry) const
try to send a note
Definition: LotusSpreadsheet.cpp:3445
WPSBorder::m_type
Type m_type
the border repetition
Definition: libwps_internal.h:448
WPSDebug.h
libwps::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
LotusSpreadsheet::readNote
static bool readNote(std::shared_ptr< WPSStream > stream, long endPos)
try to read a note: subZone id 9065
Definition: LotusSpreadsheet.cpp:3302
LotusSpreadsheetInternal::Functions::m_name
const char * m_name
Definition: LotusSpreadsheet.cpp:2862
WPSCellFormat::setDigits
void setDigits(int newDigit)
set the number of digits ( for a number)
Definition: WPSCell.h:186
LotusSpreadsheetInternal::Spreadsheet::getPosition
Vec2f getPosition(Vec2i const &cell) const
returns the position corresponding to a cell
Definition: LotusSpreadsheet.cpp:356
WPSBorder::None
@ None
Definition: libwps_internal.h:397
LotusSpreadsheet
This class parses Microsoft Works spreadsheet file.
Definition: LotusSpreadsheet.h:52
LotusSpreadsheet.h
LotusSpreadsheet::readCellName
bool readCellName(std::shared_ptr< WPSStream > stream)
reads a cell or list of cell name
Definition: LotusSpreadsheet.cpp:2034
LotusSpreadsheet::cleanState
void cleanState()
clean internal state
Definition: LotusSpreadsheet.cpp:812
LotusSpreadsheetInternal::Functions::m_arity
int m_arity
Definition: LotusSpreadsheet.cpp:2863
LotusSpreadsheet::updateState
void updateState()
update internal state (must be called one time before sending data)
Definition: LotusSpreadsheet.cpp:836
LotusSpreadsheetInternal::State::getSheetName
librevenge::RVNGString getSheetName(int id) const
returns the ith spreadsheet name
Definition: LotusSpreadsheet.cpp:726
libwps::read16
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
LotusSpreadsheetInternal::State::m_rowSheetIdToChildRowIdMap
std::multimap< Vec2i, Vec2i > m_rowSheetIdToChildRowIdMap
map Vec2i(row, sheetId) to child style
Definition: LotusSpreadsheet.cpp:745
libwps_internal.h
WPSRowFormat
Definition: WPSTable.h:100
WKSContentListener::FormulaInstruction::m_positionRelative
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
WKSContentListener.h
WKSContentListener::CellContent::C_TEXT
@ C_TEXT
Definition: WKSContentListener.h:102
WPSCellFormat::F_DATE
@ F_DATE
Definition: WPSCell.h:54
WPSColor
the class to store a color
Definition: libwps_internal.h:280
LotusSpreadsheetInternal::Extra123Style::operator==
bool operator==(Extra123Style const &f) const
operator==
Definition: LotusSpreadsheet.cpp:546
LotusSpreadsheetInternal::Spreadsheet::m_rowToStyleIdMap
std::map< Vec2i, size_t > m_rowToStyleIdMap
map Vec2i(min row, max row) to state row style id
Definition: LotusSpreadsheet.cpp:487
LotusSpreadsheetInternal::Spreadsheet::setColumnWidth
void setColumnWidth(int col, WPSColumnFormat const &format)
set the columns size
Definition: LotusSpreadsheet.cpp:322
LotusSpreadsheetInternal::SubDocument::~SubDocument
~SubDocument() final
destructor
Definition: LotusSpreadsheet.cpp:762
LotusSpreadsheetInternal::ExtraStyle::m_backColor
WPSColor m_backColor
the backgroun color
Definition: LotusSpreadsheet.cpp:149
WPSBox2< int >
LotusSpreadsheetInternal::State::m_nameToCellsMap
std::map< std::string, CellsList > m_nameToCellsMap
map name to position
Definition: LotusSpreadsheet.cpp:739
WPSStream.h
Vec2b
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
LotusSpreadsheetInternal::Spreadsheet::m_boundsColsMap
std::map< int, Vec2i > m_boundsColsMap
a map used to stored the min/max row of each columns
Definition: LotusSpreadsheet.cpp:475
LotusSpreadsheetInternal::State::getTableStyle
const Table123Styles * getTableStyle(int id) const
returns a table style for a sheet(if it exists)
Definition: LotusSpreadsheet.cpp:685
LotusSpreadsheetInternal::SubDocument::m_entry
WPSEntry m_entry
a text zone entry
Definition: LotusSpreadsheet.cpp:781
LotusSpreadsheetInternal::Cell::m_input
RVNGInputStreamPtr m_input
the input
Definition: LotusSpreadsheet.cpp:250
WKSContentListener::CellContent
small class use to define a sheet cell content
Definition: WKSContentListener.h:99
LotusSpreadsheetInternal::Spreadsheet::m_positionToCellMap
std::map< Vec2i, Cell > m_positionToCellMap
a map cell to not empty cells
Definition: LotusSpreadsheet.cpp:485
WPSCellFormat::setBorders
void setBorders(int wh, WPSBorder const &border)
sets the cell border: wh=WPSBorder::LeftBit|...
Definition: WPSCell.cpp:143
WPSRowFormat::m_useOptimalHeight
bool m_useOptimalHeight
a flag to know if we need to see use-optimal row height
Definition: WPSTable.h:146
libwps::DebugFile
Definition: WPSDebug.h:207
LotusSpreadsheetInternal::Extra123Style::Extra123Style
Extra123Style()
constructor
Definition: LotusSpreadsheet.cpp:531
LotusSpreadsheetInternal::Cell::sendContent
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: LotusSpreadsheet.cpp:260
LotusSpreadsheetInternal::Table123Styles::m_rowsToColsToExtraStyleMap
std::map< Vec2i, std::map< Vec2i, Extra123Style > > m_rowsToColsToExtraStyleMap
map rows to cols to extra style
Definition: LotusSpreadsheet.cpp:647
LotusSpreadsheetInternal::State::m_rowStylesList
std::vector< RowStyles > m_rowStylesList
the list of row styles
Definition: LotusSpreadsheet.cpp:741
WPSCellFormat::compare
int compare(WPSCellFormat const &cell, bool onlyNumbering=false) const
a comparison function
Definition: WPSCell.cpp:366
LotusSpreadsheetInternal::Cell::m_hAlignement
WPSCellFormat::HorizontalAlignment m_hAlignement
the horizontal align (in dos file)
Definition: LotusSpreadsheet.cpp:254
WPSCellFormat::setBackgroundColor
void setBackgroundColor(WPSColor const &color)
set the background color
Definition: WPSCell.h:235
WKSContentListener::FormulaInstruction::F_CellList
@ F_CellList
Definition: WKSContentListener.h:59
LotusSpreadsheetInternal::Extra123Style::empty
bool empty() const
returns true if the style is empty
Definition: LotusSpreadsheet.cpp:537
LotusSpreadsheetInternal::Table123Styles::m_rowsToColsToCellIdMap
std::map< Vec2i, std::map< Vec2i, int > > m_rowsToColsToCellIdMap
map rows to cols to cell id
Definition: LotusSpreadsheet.cpp:645
LotusSpreadsheetInternal::Spreadsheet::getCell
Cell & getCell(RVNGInputStreamPtr input, Vec2i const &pos)
return a cell corresponding to a spreadsheet, create one if needed
Definition: LotusSpreadsheet.cpp:311
WKSContentListener::CellContent::C_NUMBER
@ C_NUMBER
Definition: WKSContentListener.h:102
LotusSpreadsheetInternal::Table123Styles::addCellStyle
void addCellStyle(Vec2i const &cols, Vec2i const &rows, int cellId)
add a style to a list of cell
Definition: LotusSpreadsheet.cpp:580
WPSCellFormat::getSubFormat
int getSubFormat() const
returns the subformat type
Definition: WPSCell.h:157
LotusSpreadsheetInternal::ExtraStyle::m_borders
int m_borders
the border
Definition: LotusSpreadsheet.cpp:155
WPSColor::black
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
LotusSpreadsheetInternal::CellsList::m_ids
int m_ids[2]
the sheets id
Definition: LotusSpreadsheet.cpp:213
LotusSpreadsheetInternal::Spreadsheet::m_numCols
int m_numCols
the number of columns
Definition: LotusSpreadsheet.cpp:471
WPSColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
LotusSpreadsheetInternal::Style::Style
Style(libwps_tools_win::Font::Type type)
construtor
Definition: LotusSpreadsheet.cpp:62
LotusSpreadsheetInternal::Spreadsheet::getWidths
std::vector< WPSColumnFormat > getWidths() const
convert the m_widthColsInChar in a vector of of point size
Definition: LotusSpreadsheet.cpp:430
LotusSpreadsheetInternal::State
the state of LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:653
LotusSpreadsheet::m_listener
std::shared_ptr< WKSContentListener > m_listener
Definition: LotusSpreadsheet.h:157
WPSCellFormat::HALIGN_CENTER
@ HALIGN_CENTER
Definition: WPSCell.h:46
LotusSpreadsheet::sendRowContent
void sendRowContent(LotusSpreadsheetInternal::Spreadsheet const &sheet, int row, LotusSpreadsheetInternal::Table123Styles const *table123Styles)
send the cell data in a row
Definition: LotusSpreadsheet.cpp:2504
LotusSpreadsheetInternal::operator<<
std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: LotusSpreadsheet.cpp:267
LotusSpreadsheet::setLastSpreadsheetId
void setLastSpreadsheetId(int id)
set the last spreadsheet number ( default 0)
Definition: LotusSpreadsheet.cpp:904