Go to the documentation of this file.
22 #ifndef LOTUS_SPREADSHEET_H
23 #define LOTUS_SPREADSHEET_H
28 #include <librevenge-stream/librevenge-stream.h>
41 struct Table123Styles;
124 bool readRowSizes(std::shared_ptr<WPSStream> stream,
long endPos);
127 bool readCell(std::shared_ptr<WPSStream> stream);
141 bool readNote(std::shared_ptr<WPSStream> stream,
long endPos);
149 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
163 std::shared_ptr<LotusSpreadsheetInternal::State>
m_state;
bool operator==(Style const &st) const
operator==
Definition: LotusSpreadsheet.cpp:81
@ F_Text
Definition: WKSContentListener.h:59
bool readRowSizes(std::shared_ptr< WPSStream > stream, long endPos)
reads the row size ( in pt*32 )
Definition: LotusSpreadsheet.cpp:1760
Cell()
constructor
Definition: LotusSpreadsheet.cpp:223
int version() const
return the file version
Definition: LotusSpreadsheet.cpp:915
WKSParser * parser() const
returns the parser
Definition: WKSSubDocument.h:44
LotusSpreadsheet * m_sheetParser
the spreadsheet parse
Definition: LotusSpreadsheet.cpp:780
std::vector< int > m_rowPageBreaksList
the list of row page break
Definition: LotusSpreadsheet.cpp:484
int m_styleId
the style
Definition: LotusSpreadsheet.cpp:252
bool readSheetName1B(std::shared_ptr< WPSStream > stream, long endPos)
reads a sheet name: zone 0x1b 36b0
Definition: LotusSpreadsheet.cpp:3263
int m_version
the file version
Definition: LotusSpreadsheet.cpp:736
CellsList()
constructor
Definition: LotusSpreadsheet.cpp:196
librevenge::RVNGString m_fileName
the file name (external reference)
Definition: WKSContentListener.h:96
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: WKSContentListener.h:155
bool hasSomeSpreadsheetData() const
returns true if some spreadsheet are defined
Definition: LotusSpreadsheet.cpp:922
static std::string str()
Definition: WPSDebug.h:200
WPSRowFormat getRowHeight(int row) const
returns the row size in point
Definition: LotusSpreadsheet.cpp:341
bool readSheetHeader(std::shared_ptr< WPSStream > stream)
try to read a sheet header: 0xc3
Definition: LotusSpreadsheet.cpp:1880
@ F_Long
Definition: WKSContentListener.h:59
@ C_FORMULA
Definition: WKSContentListener.h:102
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
void addCellStyle(Vec2i const &cols, Vec2i const &rows, Format123Style const &format)
add a extra style to a list of cell
Definition: LotusSpreadsheet.cpp:622
static void addPos(long)
Definition: WPSDebug.h:220
a class used to store the styles of a table in LotusSpreadsheet in a lotus 123 files
Definition: LotusSpreadsheet.cpp:570
@ F_Cell
Definition: WKSContentListener.h:59
bool readCell(std::shared_ptr< WPSStream > stream)
reads a cell
Definition: LotusSpreadsheet.cpp:2110
long end() const
returns the end offset
Definition: WPSEntry.h:76
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: LotusSpreadsheet.h:67
bool empty() const
returns true if the spreedsheet is empty
Definition: LotusSpreadsheet.cpp:465
void setMin(Vec2< T > const &x)
resets the minimum point
Definition: libwps_internal.h:771
std::map< Vec2i, WPSRowFormat > m_rowHeightMap
the map Vec2i(min row, max row) to size in points
Definition: LotusSpreadsheet.cpp:480
static std::string getDebugStringForText(std::string const &text)
small debug function used to print text with format sequence
Definition: LotusSpreadsheet.cpp:3489
std::shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition: LotusSpreadsheet.h:161
Table123Styles()
constructor
Definition: LotusSpreadsheet.cpp:573
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
libwps_tools_win::Font::Type m_fontType
font encoding type
Definition: LotusSpreadsheet.cpp:92
static const Functions s_listFunctions[]
Definition: LotusSpreadsheet.cpp:2867
bool readSheetName(std::shared_ptr< WPSStream > stream)
reads a sheet name: zone 0x23
Definition: LotusSpreadsheet.cpp:1822
std::string m_extra
extra data
Definition: LotusSpreadsheet.cpp:94
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
void addCellStyle(Vec2i const &cols, Vec2i const &rows, Extra123Style const &extra)
add a extra style to a list of cell
Definition: LotusSpreadsheet.cpp:603
@ F_Operator
Definition: WKSContentListener.h:59
friend std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: LotusSpreadsheet.cpp:267
@ BottomBit
Definition: libwps_internal.h:401
@ F_Double
Definition: WKSContentListener.h:59
double m_longValue
value ( if type==F_Long )
Definition: WKSContentListener.h:81
int m_numRows
the number of rows
Definition: LotusSpreadsheet.cpp:474
small structure use to store a stream and it debug file
Definition: WPSStream.h:29
@ F_Function
Definition: WKSContentListener.h:59
WPSEntry m_comment
the comment entry
Definition: LotusSpreadsheet.cpp:258
bool readColumnDefinition(std::shared_ptr< WPSStream > stream)
reads the columns definitions
Definition: LotusSpreadsheet.cpp:938
Spreadsheet & getSheet(int id)
returns the ith spreadsheet
Definition: LotusSpreadsheet.cpp:675
void setRowHeight(int row, WPSRowFormat const &format)
set the rows size
Definition: LotusSpreadsheet.cpp:351
int m_width
the border width
Definition: libwps_internal.h:450
a list of position of a Lotus spreadsheet
Definition: LotusSpreadsheet.cpp:193
Style & operator=(Style const &)=default
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Lotus.cpp:273
friend std::ostream & operator<<(std::ostream &o, CellsList const &pos)
operator<<
Definition: LotusSpreadsheet.cpp:202
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
double m_doubleValue
value ( if type==F_Double )
Definition: WKSContentListener.h:83
std::map< Vec2i, Table123Styles > m_sheetIdToTableStyleMap
map Vec2i(sheetMin, sheetMax) to table style
Definition: LotusSpreadsheet.cpp:748
the spreadsheet of a LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:294
bool readRowFormat(std::shared_ptr< WPSStream > stream, LotusSpreadsheetInternal::Style &style, int &numCell, long endPos)
reads a cell's row format
Definition: LotusSpreadsheet.cpp:1201
define the font properties
Definition: WPSFont.h:36
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: LotusSpreadsheet.cpp:240
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:87
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition: LotusSpreadsheet.cpp:832
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
bool readFormula(WPSStream &stream, long endPos, int sId, bool newFormula, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition: LotusSpreadsheet.cpp:2926
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
bool operator==(std::shared_ptr< WPSSubDocument > const &doc) const final
operator==
Definition: LotusSpreadsheet.cpp:766
librevenge::RVNGString m_name
the sheet name
Definition: LotusSpreadsheet.cpp:470
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
std::vector< Spreadsheet > m_spreadsheetList
the list of spreadsheet ( first: main spreadsheet, other report spreadsheet )
Definition: LotusSpreadsheet.cpp:738
float m_heightDefault
the default row size in point
Definition: LotusSpreadsheet.cpp:482
What m_type
the type
Definition: WKSContentListener.h:77
Cell(RVNGInputStreamPtr const &input)
constructor
Definition: LotusSpreadsheet.cpp:230
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
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
bool readColumnSizes(std::shared_ptr< WPSStream > stream)
reads the column sizes ( in char )
Definition: LotusSpreadsheet.cpp:1020
std::map< Vec2i, std::map< Vec2i, Format123Style > > m_rowsToColsToFormatStyleMap
map rows to cols to format style
Definition: LotusSpreadsheet.cpp:650
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
~Style() final
destructor
Definition: LotusSpreadsheet.cpp:97
int getNumSheet() const
returns the number of spreadsheet
Definition: LotusSpreadsheet.cpp:670
Internal: the subdocument of a LotusSpreadsheet.
Definition: LotusSpreadsheet.cpp:754
bool parseVariable(std::string const &variable, WKSContentListener::FormulaInstruction &instr) const
Definition: LotusSpreadsheet.cpp:2788
std::map< Vec2i, size_t > m_rowSheetIdToStyleIdMap
map Vec2i(row, sheetId) to row style id
Definition: LotusSpreadsheet.cpp:744
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
Spreadsheet()
a constructor
Definition: LotusSpreadsheet.cpp:298
void compressRowHeights()
try to compress the list of row height
Definition: LotusSpreadsheet.cpp:392
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:1407
std::vector< WPSColumnFormat > m_widthCols
the column size
Definition: LotusSpreadsheet.cpp:478
small class which defines a vector with 2 elements
Definition: libwps_internal.h:534
void sendCellContent(LotusSpreadsheetInternal::Cell const &cell, LotusSpreadsheetInternal::Style const &style, int numRepeated=1)
send the cell data
Definition: LotusSpreadsheet.cpp:2739
std::map< int, ExtraRowStyles > m_rowToExtraStyleMap
map row to extra style
Definition: LotusSpreadsheet.cpp:490
@ TopBit
Definition: libwps_internal.h:401
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
WPSColor m_color
the font color
Definition: WPSFont.h:89
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
int version() const
return the file version
Definition: Lotus.cpp:265
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:55
bool getLeftTopPosition(Vec2i const &cell, int spreadsheet, Vec2f &pos)
returns the left top position of a cell
Definition: LotusSpreadsheet.cpp:818
int getRowStyleId(int row) const
returns the row style id corresponding to a sheetId (or -1)
Definition: LotusSpreadsheet.cpp:456
Table123Styles * getTablesStyle(Vec2i pos)
returns a table style for a sheet zone, create it if needed
Definition: LotusSpreadsheet.cpp:695
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
librevenge::RVNGString m_sheetName[2]
the sheet name
Definition: WKSContentListener.h:89
static const int MAX_COLUMNS
Definition: LotusSpreadsheet.cpp:52
WKSContentListener::CellContent m_content
the content
Definition: LotusSpreadsheet.cpp:256
int m_defaultCellId
the default cell style
Definition: LotusSpreadsheet.cpp:644
a class used to store the styles of a row in LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:159
SubDocumentType
Definition: libwps_internal.h:248
small class use to define a formula instruction
Definition: WKSContentListener.h:57
int m_sheetCurrentId
the sheet id
Definition: LotusSpreadsheet.cpp:750
@ Dot
Definition: libwps_internal.h:397
RVNGInputStreamPtr m_input
the stream
Definition: WPSStream.h:43
@ RightBit
Definition: libwps_internal.h:401
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:85
#define WPS_HIDDEN_BIT
Definition: libwps_internal.h:516
static void addNote(char const *)
Definition: WPSDebug.h:221
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
void sendText(RVNGInputStreamPtr &input, long endPos, LotusSpreadsheetInternal::Style const &style) const
try to send a formated text
Definition: LotusSpreadsheet.cpp:3344
void sendSpreadsheet(int sheetId)
send the data
Definition: LotusSpreadsheet.cpp:2409
Definition: LotusSpreadsheet.cpp:2861
long begin() const
returns the begin offset
Definition: WPSEntry.h:71
bool operator!=(Style const &st) const
operator!=
Definition: LotusSpreadsheet.cpp:87
a class used to store a style of a cell in LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:59
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
double m_size
font size
Definition: WPSFont.h:83
Style m_style
the border style
Definition: libwps_internal.h:446
std::shared_ptr< WPSSubDocument > WPSSubDocumentPtr
shared pointer to WPSSubDocument
Definition: libwps_internal.h:111
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
@ Dash
Definition: libwps_internal.h:397
WPSEntry m_textEntry
the cell string
Definition: WKSContentListener.h:153
bool readExtraRowFormats(std::shared_ptr< WPSStream > stream)
try to read an extra row format: 0xc5
Definition: LotusSpreadsheet.cpp:1924
LotusParser & m_mainParser
the listener (if set)
Definition: LotusSpreadsheet.h:159
a structure used to defined the cell position, and a format
Definition: WPSCell.h:290
Basic class used to store a spreadsheet sub document.
Definition: WKSSubDocument.h:35
Definition: WPSDebug.h:191
LotusSpreadsheet(LotusParser &parser)
constructor
Definition: LotusSpreadsheet.cpp:801
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
a border list
Definition: libwps_internal.h:394
void parse(std::shared_ptr< WKSContentListener > &listener, libwps::SubDocumentType subDocumentType) final
the parser function
Definition: LotusSpreadsheet.cpp:788
bool readRowFormats(std::shared_ptr< WPSStream > stream)
reads the row formats
Definition: LotusSpreadsheet.cpp:1074
~LotusSpreadsheet()
destructor
Definition: LotusSpreadsheet.cpp:809
void sendGraphics(int sheetId)
send the graphics corresponding to a sheetId
Definition: Lotus.cpp:308
SubDocument(RVNGInputStreamPtr const &input, LotusSpreadsheet &sheetParser, WPSEntry const &entry)
constructor for a text entry
Definition: LotusSpreadsheet.cpp:758
a cellule of a Lotus spreadsheet
Definition: LotusSpreadsheet.cpp:219
State()
constructor
Definition: LotusSpreadsheet.cpp:657
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: WKSContentListener.h:79
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:65
SubDocument & operator=(SubDocument const &)=delete
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
void setMax(Vec2< T > const &y)
resets the maximum point
Definition: libwps_internal.h:776
WPSBox2i m_positions
the first and last position
Definition: LotusSpreadsheet.cpp:215
@ Double
Definition: libwps_internal.h:399
std::map< Vec2i, Style > m_colsToStyleMap
a map Vec2i(minCol,maxCol) to style
Definition: LotusSpreadsheet.cpp:167
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
std::shared_ptr< LotusSpreadsheetInternal::State > m_state
the internal state
Definition: LotusSpreadsheet.h:163
RowStyles()
constructor
Definition: LotusSpreadsheet.cpp:162
@ LeftBit
Definition: libwps_internal.h:401
RVNGInputStreamPtr m_input
Definition: WPSSubDocument.h:65
LotusSpreadsheet & operator=(LotusSpreadsheet const &orig)=delete
Definition: LotusSpreadsheet.cpp:54
void sendTextNote(RVNGInputStreamPtr &input, WPSEntry const &entry) const
try to send a note
Definition: LotusSpreadsheet.cpp:3446
Type m_type
the border repetition
Definition: libwps_internal.h:448
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
bool readNote(std::shared_ptr< WPSStream > stream, long endPos)
try to read a note: subZone id 9065
Definition: LotusSpreadsheet.cpp:3303
const char * m_name
Definition: LotusSpreadsheet.cpp:2863
Vec2f getPosition(Vec2i const &cell) const
returns the position corresponding to a cell
Definition: LotusSpreadsheet.cpp:356
@ None
Definition: libwps_internal.h:397
This class parses Microsoft Works spreadsheet file.
Definition: LotusSpreadsheet.h:52
bool readCellName(std::shared_ptr< WPSStream > stream)
reads a cell or list of cell name
Definition: LotusSpreadsheet.cpp:2035
void cleanState()
clean internal state
Definition: LotusSpreadsheet.cpp:813
int m_arity
Definition: LotusSpreadsheet.cpp:2864
void updateState()
update internal state (must be called one time before sending data)
Definition: LotusSpreadsheet.cpp:837
librevenge::RVNGString getSheetName(int id) const
returns the ith spreadsheet name
Definition: LotusSpreadsheet.cpp:727
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
std::multimap< Vec2i, Vec2i > m_rowSheetIdToChildRowIdMap
map Vec2i(row, sheetId) to child style
Definition: LotusSpreadsheet.cpp:746
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
@ C_TEXT
Definition: WKSContentListener.h:102
the class to store a color
Definition: libwps_internal.h:280
std::map< Vec2i, size_t > m_rowToStyleIdMap
map Vec2i(min row, max row) to state row style id
Definition: LotusSpreadsheet.cpp:488
void setColumnWidth(int col, WPSColumnFormat const &format)
set the columns size
Definition: LotusSpreadsheet.cpp:322
~SubDocument() final
destructor
Definition: LotusSpreadsheet.cpp:763
std::map< std::string, CellsList > m_nameToCellsMap
map name to position
Definition: LotusSpreadsheet.cpp:740
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
std::map< int, Vec2i > m_boundsColsMap
a map used to stored the min/max row of each columns
Definition: LotusSpreadsheet.cpp:476
const Table123Styles * getTableStyle(int id) const
returns a table style for a sheet(if it exists)
Definition: LotusSpreadsheet.cpp:686
WPSEntry m_entry
a text zone entry
Definition: LotusSpreadsheet.cpp:782
RVNGInputStreamPtr m_input
the input
Definition: LotusSpreadsheet.cpp:250
small class use to define a sheet cell content
Definition: WKSContentListener.h:99
std::map< Vec2i, Cell > m_positionToCellMap
a map cell to not empty cells
Definition: LotusSpreadsheet.cpp:486
Definition: WPSDebug.h:207
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: LotusSpreadsheet.cpp:260
std::map< Vec2i, std::map< Vec2i, Extra123Style > > m_rowsToColsToExtraStyleMap
map rows to cols to extra style
Definition: LotusSpreadsheet.cpp:648
std::vector< RowStyles > m_rowStylesList
the list of row styles
Definition: LotusSpreadsheet.cpp:742
WPSCellFormat::HorizontalAlignment m_hAlignement
the horizontal align (in dos file)
Definition: LotusSpreadsheet.cpp:254
@ F_CellList
Definition: WKSContentListener.h:59
std::map< Vec2i, std::map< Vec2i, int > > m_rowsToColsToCellIdMap
map rows to cols to cell id
Definition: LotusSpreadsheet.cpp:646
Cell & getCell(RVNGInputStreamPtr input, Vec2i const &pos)
return a cell corresponding to a spreadsheet, create one if needed
Definition: LotusSpreadsheet.cpp:311
@ C_NUMBER
Definition: WKSContentListener.h:102
void addCellStyle(Vec2i const &cols, Vec2i const &rows, int cellId)
add a style to a list of cell
Definition: LotusSpreadsheet.cpp:581
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
int m_ids[2]
the sheets id
Definition: LotusSpreadsheet.cpp:213
int m_numCols
the number of columns
Definition: LotusSpreadsheet.cpp:472
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
Style(libwps_tools_win::Font::Type type)
construtor
Definition: LotusSpreadsheet.cpp:62
std::vector< WPSColumnFormat > getWidths() const
convert the m_widthColsInChar in a vector of of point size
Definition: LotusSpreadsheet.cpp:430
the state of LotusSpreadsheet
Definition: LotusSpreadsheet.cpp:654
std::shared_ptr< WKSContentListener > m_listener
Definition: LotusSpreadsheet.h:157
void sendRowContent(LotusSpreadsheetInternal::Spreadsheet const &sheet, int row, LotusSpreadsheetInternal::Table123Styles const *table123Styles)
send the cell data in a row
Definition: LotusSpreadsheet.cpp:2505
std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: LotusSpreadsheet.cpp:267
void setLastSpreadsheetId(int id)
set the last spreadsheet number ( default 0)
Definition: LotusSpreadsheet.cpp:905
Generated on Mon Apr 25 2022 14:03:04 for libwps by
doxygen 1.8.17