mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-03 22:14:04 +00:00
a556652f6e
In the current code each paragraph contains a map<Language, WordList*>, which means that it contains a full copy of the language object. Since these objects contain translation tables nowadays, this is a very bad idea. This patch simply replaces the Language key by a string. When loading the Userguide on linux/x86_64, the total memory consumption decreases from 36.27MB to 31.50MB.
47 lines
722 B
C++
47 lines
722 B
C++
// -*- C++ -*-
|
|
/**
|
|
* \file WordList.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Stefan Schimanski
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef WORDLIST_H
|
|
#define WORDLIST_H
|
|
|
|
#include "support/docstring.h"
|
|
|
|
namespace lyx {
|
|
|
|
class WordList {
|
|
public:
|
|
///
|
|
WordList();
|
|
///
|
|
~WordList();
|
|
|
|
///
|
|
docstring const & word(size_t idx) const;
|
|
///
|
|
size_t size() const;
|
|
///
|
|
void insert(docstring const & w);
|
|
///
|
|
void remove(docstring const & w);
|
|
///
|
|
static void cleanupWordLists();
|
|
|
|
private:
|
|
struct Impl;
|
|
Impl * d;
|
|
};
|
|
|
|
WordList * theWordList(std::string const & lang);
|
|
|
|
} // namespace lyx
|
|
|
|
#endif // WORDLIST_H
|