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

Reset autospell data when inserting/deleting cells.

Change-Id: I4ec48afe4a1aebe96dfb0fe5d507c786bdecae66
üst a50fe429
......@@ -2010,6 +2010,9 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
rDocShell.ErrorMessage(STR_INSERT_FULL); // Spalte/Zeile voll
}
if (pViewSh)
pViewSh->ResetAutoSpell();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
......@@ -2490,6 +2493,11 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
rDocShell.PostPaint( nPaintStartCol, nPaintStartRow, *itr, nPaintEndCol, nPaintEndRow, *itr+nScenarioCount, PAINT_TOP );
}
}
ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
if (pViewSh)
pViewSh->ResetAutoSpell();
aModificator.SetDocumentModified();
SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
......
......@@ -393,6 +393,7 @@ public:
void DrawLayerCreated();
bool ContinueOnlineSpelling();
void EnableAutoSpell( bool bEnable );
void ResetAutoSpell();
void DeleteCopySourceOverlay();
void UpdateCopySourceOverlay();
......
......@@ -523,6 +523,7 @@ public:
bool ContinueOnlineSpelling();
void EnableAutoSpell( bool bEnable );
void ResetAutoSpell();
};
......
......@@ -5523,6 +5523,16 @@ void ScGridWindow::EnableAutoSpell( bool bEnable )
mpSpellCheckCxt.reset();
}
void ScGridWindow::ResetAutoSpell()
{
if (mpSpellCheckCxt)
{
mpSpellCheckCxt->reset();
mpSpellCheckCxt->maPos.mnCol = maVisibleRange.mnCol1;
mpSpellCheckCxt->maPos.mnRow = maVisibleRange.mnRow1;
}
}
// #114409#
void ScGridWindow::CursorChanged()
{
......
......@@ -607,10 +607,7 @@ bool ScGridWindow::UpdateVisibleRange()
// Store the current visible range.
bool bChanged = maVisibleRange.set(nPosX, nPosY, nXRight, nYBottom);
if (bChanged)
{
if (mpSpellCheckCxt)
mpSpellCheckCxt->reset();
}
ResetAutoSpell();
return bChanged;
}
......
......@@ -2358,4 +2358,15 @@ void ScTabView::EnableAutoSpell( bool bEnable )
}
}
void ScTabView::ResetAutoSpell()
{
for (int i = 0; i < 4; ++i)
{
if (!pGridWin[i])
continue;
pGridWin[i]->ResetAutoSpell();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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