[Libreoffice-commits] core.git: 2 commits - sc/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Thu Jul 24 14:26:56 PDT 2014
sc/source/ui/docshell/datastream.cxx | 19 ++++++++++++++++++-
sc/source/ui/inc/datastream.hxx | 2 ++
2 files changed, 20 insertions(+), 1 deletion(-)
New commits:
commit 678ad50a5eaf2b8826e7f8b0f34eb3229559d4ec
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Thu Jul 24 23:18:26 2014 +0200
fix coding style
Change-Id: I4841929ac8f1a50892d72f7b2a32ba2f55b62a85
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index ba69d45..449a992 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -501,16 +501,17 @@ void DataStream::MoveData()
default:
;
}
- if(mbIsFirst&&mbIsUpdate)
+
+ if(mbIsFirst && mbIsUpdate)
{
- int importTimeout = 0;
- char * cenv = getenv( "streamtimeout" );
+ int nImportTimeout = 0;
+ static char * cenv = getenv( "streamtimeout" );
if(cenv)
{
- double denv = atof(cenv);
- importTimeout = 1000 * denv;
+ double nEnv = atof(cenv);
+ nImportTimeout = 1000 * nEnv;
}
- maImportTimer.SetTimeout(importTimeout);
+ maImportTimer.SetTimeout(nImportTimeout);
mbIsFirst = false;
}
}
commit dc0b5fa230ff5624aff0d5ea174c17e895967dbd
Author: xukai <xukai at multicorewareinc.com>
Date: Thu Jul 24 17:21:28 2014 +0800
avoid static variables
Change-Id: Ib73464cbd9ddc644b008ab7fdcab5ca70dcaa2f1
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 5a196d4..ba69d45 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 753cae6..793c359 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;
};
}
More information about the Libreoffice-commits
mailing list