summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2019-08-06 17:08:27 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2019-08-13 16:53:17 +0200
commit66063914e39f232efe2271d52e51a3458455d8b4 (patch)
tree56b7f27bf23540a107e1c22911bcf231ead14bc2
parent6e13585508ca3c9b66c6571ad1eb42bfcb66ef0b (diff)
Replace Calcs Idle time tracking with TaskStopwatch
I'm not sure this 32 cells limit makes any sense. Same for the exclusion of VclInputFlags::OTHER. Change-Id: I779aaeda5624f12eeab5bfeb73d10286f8d7ae1f Reviewed-on: https://gerrit.libreoffice.org/77039 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--sc/source/core/data/documen8.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 2bd74756266d..7440e84a4f95 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -42,6 +42,7 @@
#include <vcl/svapp.hxx>
#include <vcl/virdev.hxx>
#include <vcl/weld.hxx>
+#include <vcl/TaskStopwatch.hxx>
#include <inputopt.hxx>
#include <global.hxx>
@@ -467,12 +468,11 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress
namespace {
-class IdleCalcTextWidthScope
+class IdleCalcTextWidthScope : public TaskStopwatch
{
ScDocument& mrDoc;
ScAddress& mrCalcPos;
MapMode maOldMapMode;
- sal_uInt64 const mnStartTime;
ScStyleSheetPool* mpStylePool;
SfxStyleSearchBits const mnOldSearchMask;
SfxStyleFamily const meOldFamily;
@@ -483,7 +483,6 @@ public:
IdleCalcTextWidthScope(ScDocument& rDoc, ScAddress& rCalcPos) :
mrDoc(rDoc),
mrCalcPos(rCalcPos),
- mnStartTime(tools::Time::GetSystemTicks()),
mpStylePool(rDoc.GetStyleSheetPool()),
mnOldSearchMask(mpStylePool->GetSearchMask()),
meOldFamily(mpStylePool->GetSearchFamily()),
@@ -527,8 +526,6 @@ public:
void setNeedMore(bool b) { mbNeedMore = b; }
bool getNeedMore() const { return mbNeedMore; }
- sal_uInt64 getStartTime() const { return mnStartTime; }
-
void createProgressBar()
{
ScProgress::CreateInterpretProgress(&mrDoc, false);
@@ -692,13 +689,8 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again
++nCount;
- // Quit if either 1) its duration exceeds 50 ms, or 2) there is any
- // pending event after processing 32 cells.
- VclInputFlags ABORT_EVENTS = VCL_INPUT_ANY;
- ABORT_EVENTS &= ~VclInputFlags::TIMER;
- ABORT_EVENTS &= ~VclInputFlags::OTHER;
- if ((50L < tools::Time::GetSystemTicks() - aScope.getStartTime()) || (nCount > 31 && Application::AnyInput(ABORT_EVENTS)))
- nCount = CALCMAX;
+ if (!aScope.continueIter())
+ break;
}
return aScope.getNeedMore();