summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-08-23 14:05:13 +0300
committerDennis Francis <dennis.francis@collabora.co.uk>2017-11-21 16:09:40 +0530
commit457e3b1978dee11a3a70b13869f35f52c83107e1 (patch)
tree810147a8e738c2b35d99360ac2edea516d1a087b /sc
parent12d70f4a89f5586f1b617c052b9573f706030d17 (diff)
Bin some YAGNI code
We don't do anything at the moment to check whether a formula group calculation thread "failed", I don't even know what it actually would mean. So just bin that code for now. Change-Id: Ie4b15a3c20169d08d338e255a71a139913528a16
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/formulacell.cxx25
1 files changed, 4 insertions, 21 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index d6996fa35036..ede2b15616fc 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4254,7 +4254,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
// Then do the threaded calculation
- bool result = true;
class Executor : public comphelper::ThreadTask
{
private:
@@ -4263,7 +4262,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
ScDocument* mpDocument;
const ScAddress& mrTopPos;
SCROW mnLength;
- std::vector<int>& mrResult;
public:
Executor(std::shared_ptr<comphelper::ThreadTaskTag>& rTag,
@@ -4271,24 +4269,19 @@ bool ScFormulaCell::InterpretFormulaGroup()
unsigned nThreadsTotal,
ScDocument* pDocument2,
const ScAddress& rTopPos,
- SCROW nLength,
- std::vector<int>& rResult) :
+ SCROW nLength) :
comphelper::ThreadTask(rTag),
mnThisThread(nThisThread),
mnThreadsTotal(nThreadsTotal),
mpDocument(pDocument2),
mrTopPos(rTopPos),
- mnLength(nLength),
- mrResult(rResult)
+ mnLength(nLength)
{
}
virtual void doWork() override
{
mpDocument->CalculateInColumnInThread(mrTopPos, mnLength, mnThisThread, mnThreadsTotal);
- // FIXME: How to determine whether it "worked" or not? Does it even have a meaning? Just
- // drop this as YAGNI?
- mrResult[mnThisThread] = static_cast<int>(true);
}
};
@@ -4302,30 +4295,20 @@ bool ScFormulaCell::InterpretFormulaGroup()
ScMutationGuard aGuard(pDocument, ScMutationGuardFlags::CORE);
// Start nThreadCount new threads
- std::vector<int> vResult(nThreadCount);
std::shared_ptr<comphelper::ThreadTaskTag> aTag = comphelper::ThreadPool::createThreadTaskTag();
for (int i = 0; i < nThreadCount; ++i)
{
- rThreadPool.pushTask(new Executor(aTag, i, nThreadCount, pDocument, mxGroup->mpTopCell->aPos, mxGroup->mnLength, vResult));
+ rThreadPool.pushTask(new Executor(aTag, i, nThreadCount, pDocument, mxGroup->mpTopCell->aPos, mxGroup->mnLength));
}
SAL_INFO("sc.threaded", "Joining threads");
rThreadPool.waitUntilDone(aTag);
SAL_INFO("sc.threaded", "Done");
-
- for (int i = 0; i < nThreadCount; ++i)
- {
- if (!vResult[i])
- {
- SAL_INFO("sc.threaded", "Thread " << i << " failed");
- result = false;
- }
- }
}
pDocument->HandleStuffAfterParallelCalculation(mxGroup->mpTopCell->aPos, mxGroup->mnLength);
- return result;
+ return true;
}
switch (pCode->GetVectorState())