diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-12-30 12:16:35 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-12-30 12:33:28 -0500 |
commit | 9a623cdca281a682d39b423aefac392c2cc22cf7 (patch) | |
tree | d8c7222f148818b163b40f1d9302f821542415c8 /sc/source/ui/inc/datastream.hxx | |
parent | 3ccb783be184102075fe1f9814f05e85d4968c32 (diff) |
Parse CSV lines in the reader thread.
Change-Id: I6329a0e6e6fa6576df2ed473482d558bfd6cce08
Diffstat (limited to 'sc/source/ui/inc/datastream.hxx')
-rw-r--r-- | sc/source/ui/inc/datastream.hxx | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx index 5a4d8cd444b7..5af2dc7c29a6 100644 --- a/sc/source/ui/inc/datastream.hxx +++ b/sc/source/ui/inc/datastream.hxx @@ -33,15 +33,37 @@ namespace datastreams { class ReaderThread; } -typedef std::vector<OString> LinesList; class DataStream : boost::noncopyable { - OString ConsumeLine(); - void MoveData(); - void Text2Doc(); - public: + struct Cell + { + struct Str + { + size_t Pos; + size_t Size; + }; + + union + { + Str maStr; + double mfValue; + }; + + bool mbValue; + + Cell(); + Cell( const Cell& r ); + }; + + struct Line + { + OString maLine; + std::vector<Cell> maCells; + }; + typedef std::vector<Line> LinesType; + enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP }; enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 }; @@ -75,6 +97,9 @@ public: void SetRefreshOnEmptyLine( bool bVal ); private: + Line ConsumeLine(); + void MoveData(); + void Text2Doc(); void Refresh(); private: @@ -89,7 +114,7 @@ private: bool mbRunning; bool mbValuesInLine; bool mbRefreshOnEmptyLine; - LinesList* mpLines; + LinesType* mpLines; size_t mnLinesCount; size_t mnLinesSinceRefresh; double mfLastRefreshTime; |