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

Spell check iteration too slow when only a few cells are misspelled.

The method should return false when no text cells are encountered (to
tell the caller to set a longer iteration interval), not when no
misspelled cells are encountered.

Change-Id: I9d906d370af129640fdd0cb6dd18ad286e27d3a2
üst f4710e16
...@@ -5420,7 +5420,7 @@ bool ScGridWindow::ContinueOnlineSpelling() ...@@ -5420,7 +5420,7 @@ bool ScGridWindow::ContinueOnlineSpelling()
// Check only up to 256 cells at a time. // Check only up to 256 cells at a time.
size_t nTotalCellCount = 0; size_t nTotalCellCount = 0;
size_t nTextCellCount = 0; size_t nTextCellCount = 0;
bool bChanged = false; bool bSpellCheckPerformed = false;
while (pCell) while (pCell)
{ {
...@@ -5486,8 +5486,9 @@ bool ScGridWindow::ContinueOnlineSpelling() ...@@ -5486,8 +5486,9 @@ bool ScGridWindow::ContinueOnlineSpelling()
ScPaintHint aHint(ScRange(nCol, nRow, nTab), PAINT_GRID); ScPaintHint aHint(ScRange(nCol, nRow, nTab), PAINT_GRID);
aHint.SetPrintFlag(false); aHint.SetPrintFlag(false);
pDoc->GetDocumentShell()->Broadcast(aHint); pDoc->GetDocumentShell()->Broadcast(aHint);
bChanged = true;
} }
bSpellCheckPerformed = true;
} }
if (nTotalCellCount >= 255 || nTextCellCount >= 1) if (nTotalCellCount >= 255 || nTextCellCount >= 1)
...@@ -5512,7 +5513,7 @@ bool ScGridWindow::ContinueOnlineSpelling() ...@@ -5512,7 +5513,7 @@ bool ScGridWindow::ContinueOnlineSpelling()
mpSpellCheckCxt->maPos.setInvalid(); mpSpellCheckCxt->maPos.setInvalid();
} }
return bChanged; return bSpellCheckPerformed;
} }
void ScGridWindow::EnableAutoSpell( bool bEnable ) void ScGridWindow::EnableAutoSpell( bool bEnable )
......
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