diff options
author | xukai <xukai@multicorewareinc.com> | 2014-07-24 17:21:28 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-24 23:18:50 +0200 |
commit | dc0b5fa230ff5624aff0d5ea174c17e895967dbd (patch) | |
tree | 7d1c64bfaff587af57926d033f0cc733c082d8c5 /sc | |
parent | d068f13596f6d1023a70d98ec2059d38ad6fd777 (diff) |
avoid static variables
Change-Id: Ib73464cbd9ddc644b008ab7fdcab5ca70dcaa2f1
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/datastream.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/inc/datastream.hxx | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 5a196d406248..ba69d454676b 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -324,7 +324,9 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const ScRange& mnLinesCount(0), mnLinesSinceRefresh(0), mfLastRefreshTime(0.0), - mnCurRow(0) + mnCurRow(0), + mbIsFirst(true), + mbIsUpdate(false) { maImportTimer.SetTimeout(0); maImportTimer.SetTimeoutHdl( LINK(this, DataStream, ImportTimerHdl) ); @@ -477,6 +479,7 @@ void DataStream::MoveData() break; case MOVE_UP: { + mbIsUpdate = true; // Remove the top row and shift the remaining rows upward. Then // insert a new row at the end row position. ScRange aRange = maStartRange; @@ -486,6 +489,7 @@ void DataStream::MoveData() break; case MOVE_DOWN: { + mbIsUpdate = true; // Remove the end row and shift the remaining rows downward by // inserting a new row at the top row. ScRange aRange = maStartRange; @@ -497,6 +501,18 @@ void DataStream::MoveData() default: ; } + if(mbIsFirst&&mbIsUpdate) + { + int importTimeout = 0; + char * cenv = getenv( "streamtimeout" ); + if(cenv) + { + double denv = atof(cenv); + importTimeout = 1000 * denv; + } + maImportTimer.SetTimeout(importTimeout); + mbIsFirst = false; + } } #if ENABLE_ORCUS diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx index 753cae67774f..793c359d868c 100644 --- a/sc/source/ui/inc/datastream.hxx +++ b/sc/source/ui/inc/datastream.hxx @@ -124,6 +124,8 @@ private: Timer maImportTimer; rtl::Reference<datastreams::ReaderThread> mxReaderThread; + bool mbIsFirst; + bool mbIsUpdate; }; } |