Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / spellcheckcontext.hxx
blobe3f3f74f0af88822899c2db5bf56f42fb703ce81
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #ifndef SC_SPELLCHECKCONTEXT_HXX
11 #define SC_SPELLCHECKCONTEXT_HXX
13 #include "address.hxx"
14 #include "editeng/misspellrange.hxx"
16 #include <boost/unordered_map.hpp>
18 namespace sc {
20 struct SpellCheckContext
22 struct CellPos
24 struct Hash
26 size_t operator() (const CellPos& rPos) const;
29 SCCOL mnCol;
30 SCROW mnRow;
32 CellPos();
33 CellPos(SCCOL nCol, SCROW nRow);
35 void setInvalid();
36 bool isValid() const;
37 void reset();
39 bool operator< (const CellPos& r) const;
40 bool operator== (const CellPos& r) const;
43 typedef boost::unordered_map<CellPos, std::vector<editeng::MisspellRanges>, CellPos::Hash> CellMapType;
45 CellPos maPos;
46 CellMapType maMisspellCells;
48 SpellCheckContext();
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 );
54 void reset();
59 #endif
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */