summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/datastream.cxx
diff options
context:
space:
mode:
authorxukai <xukai@multicorewareinc.com>2014-07-24 17:21:28 +0800
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-07-24 23:18:50 +0200
commitdc0b5fa230ff5624aff0d5ea174c17e895967dbd (patch)
tree7d1c64bfaff587af57926d033f0cc733c082d8c5 /sc/source/ui/docshell/datastream.cxx
parentd068f13596f6d1023a70d98ec2059d38ad6fd777 (diff)
avoid static variables
Change-Id: Ib73464cbd9ddc644b008ab7fdcab5ca70dcaa2f1
Diffstat (limited to 'sc/source/ui/docshell/datastream.cxx')
-rw-r--r--sc/source/ui/docshell/datastream.cxx18
1 files changed, 17 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