summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/spellcheckcontext.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-09-01 13:57:52 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-09-01 14:48:50 -0400
commit309c766d99cc7efc11fc439d119ba1944f2d710a (patch)
tree38b0df248625639f1ef5afc3b5fb1dced8525da6 /sc/source/ui/view/spellcheckcontext.cxx
parent16c8c46d85d7aafcb9159b12e2d44bc0bf322c69 (diff)
Separate misspelled ranges when entering a new cell value.
And store them at appropriate locations. Change-Id: Iaf38c0cd01e9b3dc9dc98f7ccc1951d572a422e9
Diffstat (limited to 'sc/source/ui/view/spellcheckcontext.cxx')
-rw-r--r--sc/source/ui/view/spellcheckcontext.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx
index d6cec232e889..66c218e679b5 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -71,6 +71,26 @@ const std::vector<editeng::MisspellRanges>* SpellCheckContext::getMisspellRanges
return &it->second;
}
+void SpellCheckContext::setMisspellRanges(
+ SCCOL nCol, SCROW nRow, const std::vector<editeng::MisspellRanges>* pRanges )
+{
+ CellPos aPos(nCol, nRow);
+ CellMapType::iterator it = maMisspellCells.find(aPos);
+
+ if (pRanges)
+ {
+ if (it == maMisspellCells.end())
+ maMisspellCells.insert(CellMapType::value_type(aPos, *pRanges));
+ else
+ it->second = *pRanges;
+ }
+ else
+ {
+ if (it != maMisspellCells.end())
+ maMisspellCells.erase(it);
+ }
+}
+
void SpellCheckContext::reset()
{
maPos.reset();