summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2019-03-27 14:25:03 +0530
committerDennis Francis <dennis.francis@collabora.com>2019-04-02 17:06:35 +0200
commit33c1389a52be0e839584948be174ebed110522c5 (patch)
tree768cecf207502ecbb3a0049ba9f146e03c37539f /sc
parentc8e1f2fb1e5576dd85a1172d064480734e21d96e (diff)
tdf#124266 : Paint cell if formula-cell has changed even if...
not dirty. Change-Id: Id54811009079438945bb162dd3eb8705ce174781 Reviewed-on: https://gerrit.libreoffice.org/70043 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/output.cxx42
1 files changed, 28 insertions, 14 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 616e6d2073d7..bd3d0bafd60a 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1803,9 +1803,11 @@ void ScOutputData::FindChanged()
for (nArrY=0; nArrY<nArrCount; nArrY++)
pRowInfo[nArrY].bChanged = false;
- bool bProgress = false;
SCCOL nCol1 = MAXCOL, nCol2 = 0;
SCROW nRow1 = MAXROW, nRow2 = 0;
+ bool bAnyDirty = false;
+ bool bAnyChanged = false;
+
for (nArrY=0; nArrY<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
@@ -1817,26 +1819,34 @@ void ScOutputData::FindChanged()
continue;
ScFormulaCell* pFCell = rCell.mpFormula;
- if ( !bProgress && pFCell->GetDirty() )
- {
- ScProgress::CreateInterpretProgress(mpDoc);
- bProgress = true;
- }
if (pFCell->IsRunning())
// still being interpreted. Skip it.
continue;
- ScAddress& rPos(pFCell->aPos);
- nCol1 = std::min(rPos.Col(), nCol1);
- nCol2 = std::max(rPos.Col(), nCol2);
- nRow1 = std::min(rPos.Row(), nRow1);
- nRow2 = std::max(rPos.Row(), nRow2);
+ bool bDirty = pFCell->GetDirty();
+ bAnyChanged = bAnyChanged || pFCell->IsChanged();
+
+ if (bDirty)
+ {
+ if (!bAnyDirty)
+ {
+ ScProgress::CreateInterpretProgress(mpDoc);
+ bAnyDirty = true;
+ }
+
+ ScAddress& rPos(pFCell->aPos);
+ nCol1 = std::min(rPos.Col(), nCol1);
+ nCol2 = std::max(rPos.Col(), nCol2);
+ nRow1 = std::min(rPos.Row(), nRow1);
+ nRow2 = std::max(rPos.Row(), nRow2);
+ }
}
}
- if (bProgress)
+ if (bAnyDirty || bAnyChanged)
{
- mpDoc->EnsureFormulaCellResults(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab), true);
+ if (bAnyDirty)
+ mpDoc->EnsureFormulaCellResults(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab), true);
for (nArrY=0; nArrY<nArrCount; nArrY++)
{
@@ -1849,6 +1859,9 @@ void ScOutputData::FindChanged()
continue;
ScFormulaCell* pFCell = rCell.mpFormula;
+ if (pFCell->IsRunning())
+ // still being interpreted. Skip it.
+ continue;
if (!pFCell->IsChanged())
// the result hasn't changed. Skip it.
@@ -1868,7 +1881,8 @@ void ScOutputData::FindChanged()
}
}
- ScProgress::DeleteInterpretProgress();
+ if (bAnyDirty)
+ ScProgress::DeleteInterpretProgress();
}
mpDoc->EnableIdle(bWasIdleEnabled);