LibreOffice Module sc (master)  1
spellcheckcontext.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
11 #define INCLUDED_SC_INC_SPELLCHECKCONTEXT_HXX
12 
14 #include "types.hxx"
15 
16 #include <unordered_map>
17 #include <vector>
18 
19 namespace sc {
20 
22 {
23  struct CellPos
24  {
25  struct Hash
26  {
27  size_t operator() (const CellPos& rPos) const;
28  };
29 
32 
33  CellPos();
34  CellPos(SCCOL nCol, SCROW nRow);
35 
36  void setInvalid();
37  bool isValid() const;
38  void reset();
39 
40  bool operator== (const CellPos& r) const;
41  };
42 
43  typedef std::unordered_map<CellPos, std::vector<editeng::MisspellRanges>, CellPos::Hash> CellMapType;
44 
46  CellMapType maMisspellCells;
47 
49 
50  bool isMisspelled( SCCOL nCol, SCROW nRow ) const;
51  const std::vector<editeng::MisspellRanges>* getMisspellRanges( SCCOL nCol, SCROW nRow ) const;
52  void setMisspellRanges( SCCOL nCol, SCROW nRow, const std::vector<editeng::MisspellRanges>* pRanges );
53 
54  void reset();
55 };
56 
57 }
58 
59 #endif
60 
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const CellPos &r) const
void setMisspellRanges(SCCOL nCol, SCROW nRow, const std::vector< editeng::MisspellRanges > *pRanges)
bool isMisspelled(SCCOL nCol, SCROW nRow) const
std::unordered_map< CellPos, std::vector< editeng::MisspellRanges >, CellPos::Hash > CellMapType
sal_Int16 SCCOL
Definition: types.hxx:22
const std::vector< editeng::MisspellRanges > * getMisspellRanges(SCCOL nCol, SCROW nRow) const
size_t operator()(const CellPos &rPos) const
sal_Int32 SCROW
Definition: types.hxx:18