Kaydet (Commit) c3bd4353 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Call Yield() to unblock the main thread when refreshing.

Also, we don't seem to need this solar mutex locking and checking for
needs repaint flag here anymore, and not having these make the streaming
much faster esp on Windows.

Change-Id: I6e8ae82e5d986492ac576d28f11e2afffe954bc2
üst 3743df7d
...@@ -65,15 +65,11 @@ private: ...@@ -65,15 +65,11 @@ private:
{ {
while (!mbTerminate) while (!mbTerminate)
{ {
// wait for a small amount of time, so that
// painting methods have a chance to be called.
// And also to make UI more responsive.
TimeValue const aTime = {0, 100000};
maStart.wait(); maStart.wait();
maStart.reset(); maStart.reset();
if (!mbTerminate) if (!mbTerminate)
while (mpDataStream->ImportData()) while (mpDataStream->ImportData())
wait(aTime); ;
}; };
} }
}; };
...@@ -352,6 +348,7 @@ void DataStream::SetRefreshOnEmptyLine( bool bVal ) ...@@ -352,6 +348,7 @@ void DataStream::SetRefreshOnEmptyLine( bool bVal )
void DataStream::Refresh() void DataStream::Refresh()
{ {
// Hard recalc will repaint the grid area. // Hard recalc will repaint the grid area.
Application::Yield();
mpDocShell->DoHardRecalc(true); mpDocShell->DoHardRecalc(true);
mpDocShell->SetDocumentModified(true); mpDocShell->SetDocumentModified(true);
...@@ -513,14 +510,10 @@ void DataStream::Text2Doc() {} ...@@ -513,14 +510,10 @@ void DataStream::Text2Doc() {}
bool DataStream::ImportData() bool DataStream::ImportData()
{ {
SolarMutexGuard aGuard;
if (!mbValuesInLine) if (!mbValuesInLine)
// We no longer support this mode. To be deleted later. // We no longer support this mode. To be deleted later.
return false; return false;
if (ScDocShell::GetViewData()->GetViewShell()->NeedsRepaint())
return mbRunning;
Text2Doc(); Text2Doc();
return mbRunning; return mbRunning;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment