From fccf9404762b5c73af1dfa6523d6b8c2b3e91dd8 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 27 Dec 2013 21:57:25 -0500 Subject: More backporting of experimental data stream feature. This change eliminates its "caller" thread in favor of using a timer. Change-Id: I30b85be938c4aec152c52b67cf69ff3afa53399d --- sc/source/ui/inc/datastream.hxx | 44 ++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'sc/source/ui/inc/datastream.hxx') diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx index 5a4d8cd444b7..5600a09c1eb4 100644 --- a/sc/source/ui/inc/datastream.hxx +++ b/sc/source/ui/inc/datastream.hxx @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -33,15 +34,37 @@ namespace datastreams { class ReaderThread; } -typedef std::vector 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 maCells; + }; + typedef std::vector LinesType; + enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP }; enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 }; @@ -75,8 +98,13 @@ public: void SetRefreshOnEmptyLine( bool bVal ); private: + Line ConsumeLine(); + void MoveData(); + void Text2Doc(); void Refresh(); + DECL_LINK( ImportTimerHdl, void* ); + private: ScDocShell* mpDocShell; ScDocument* mpDoc; @@ -89,14 +117,16 @@ private: bool mbRunning; bool mbValuesInLine; bool mbRefreshOnEmptyLine; - LinesList* mpLines; + LinesType* mpLines; size_t mnLinesCount; size_t mnLinesSinceRefresh; double mfLastRefreshTime; SCROW mnCurRow; ScRange maStartRange; ScRange maEndRange; - rtl::Reference mxThread; + + Timer maImportTimer; + rtl::Reference mxReaderThread; }; -- cgit v1.2.3