summaryrefslogtreecommitdiff
path: root/sc/inc/spellcheckcontext.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-30 23:40:52 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-09-01 14:48:48 -0400
commit547f4fec93a023ff244e3bf509baf4b8001effa0 (patch)
treebb77beb1224c111fe9eef04cd4300a187906323e /sc/inc/spellcheckcontext.hxx
parent4bc3a58a648f6c0ce95b4eb41f2cbf46175629ed (diff)
First step toward showing mis-spelled words without modifying cells.
There are still tons of problems to fix. Change-Id: Icae6e3d2c9b8b2266724d8d068abbab8acae96da
Diffstat (limited to 'sc/inc/spellcheckcontext.hxx')
-rw-r--r--sc/inc/spellcheckcontext.hxx57
1 files changed, 57 insertions, 0 deletions
diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
new file mode 100644
index 000000000000..c92cee4965e6
--- /dev/null
+++ b/sc/inc/spellcheckcontext.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef SC_SPELLCHECKCONTEXT_HXX
+#define SC_SPELLCHECKCONTEXT_HXX
+
+#include "address.hxx"
+#include "editeng/misspellrange.hxx"
+
+#include <boost/unordered_map.hpp>
+
+namespace sc {
+
+struct SpellCheckContext
+{
+ struct CellPos
+ {
+ struct Hash
+ {
+ size_t operator() (const CellPos& rPos) const;
+ };
+
+ SCCOL mnCol;
+ SCROW mnRow;
+
+ CellPos();
+ CellPos(SCCOL nCol, SCROW nRow);
+
+ void setInvalid();
+ bool isValid() const;
+
+ bool operator< (const CellPos& r) const;
+ bool operator== (const CellPos& r) const;
+ };
+
+ typedef boost::unordered_map<CellPos, std::vector<editeng::MisspellRanges>, CellPos::Hash> CellMapType;
+
+ CellPos maPos;
+ CellMapType maMisspellCells;
+
+ SpellCheckContext();
+
+ bool isMisspelled( SCCOL nCol, SCROW nRow ) const;
+ const std::vector<editeng::MisspellRanges>* getMisspellRanges( SCCOL nCol, SCROW nRow ) const;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */