diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-12-27 21:57:25 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-12-31 10:42:14 -0500 |
commit | fccf9404762b5c73af1dfa6523d6b8c2b3e91dd8 (patch) | |
tree | bcf7906a7b1a37c88a4a125cb4e90ced1dd7931e /sc/source/ui/inc/datastream.hxx | |
parent | c1ed8bb33219a3c2f6b35e37f56febc022698121 (diff) |
More backporting of experimental data stream feature.
This change eliminates its "caller" thread in favor of using a timer.
Change-Id: I30b85be938c4aec152c52b67cf69ff3afa53399d
Diffstat (limited to 'sc/source/ui/inc/datastream.hxx')
-rw-r--r-- | sc/source/ui/inc/datastream.hxx | 44 |
1 files changed, 37 insertions, 7 deletions
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 <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <vcl/timer.hxx> #include <address.hxx> #include <boost/noncopyable.hpp> @@ -33,15 +34,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,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<datastreams::CallerThread> mxThread; + + Timer maImportTimer; + rtl::Reference<datastreams::ReaderThread> mxReaderThread; }; |