[LyX/master] Use a central typedef for vectors of WordLangTuple.

Stephan Witt switt at lyx.org
Fri Jul 16 14:23:26 UTC 2021


commit 4716b1f91a4d48532c92c40b8c4a879d083de7c8
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Jul 16 16:39:05 2021 +0200

    Use a central typedef for vectors of WordLangTuple.
---
 src/BufferParams.cpp    |    9 +++------
 src/BufferParams.h      |    6 ++----
 src/HunspellChecker.cpp |    8 +++-----
 src/WordLangTuple.h     |    5 +++++
 4 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index ec4cc0d..d9fb39e 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -341,7 +341,7 @@ public:
 
 	AuthorList authorlist;
 	BranchList branchlist;
-	IgnoreList spellignore;
+	WordLangTable spellignore;
 	Bullet temp_bullets[4];
 	Bullet user_defined_bullets[4];
 	IndicesList indiceslist;
@@ -602,16 +602,13 @@ IndicesList const & BufferParams::indiceslist() const
 }
 
 
-typedef std::vector<WordLangTuple> IgnoreList;
-
-
-IgnoreList & BufferParams::spellignore()
+WordLangTable & BufferParams::spellignore()
 {
 	return pimpl_->spellignore;
 }
 
 
-IgnoreList const & BufferParams::spellignore() const
+WordLangTable const & BufferParams::spellignore() const
 {
 	return pimpl_->spellignore;
 }
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 2c74f70..a1dfaa9 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -337,10 +337,8 @@ public:
 	IndicesList & indiceslist();
 	IndicesList const & indiceslist() const;
 	///
-	typedef std::vector<WordLangTuple> IgnoreList;
-	///
-	IgnoreList & spellignore();
-	IgnoreList const & spellignore() const;
+	WordLangTable & spellignore();
+	WordLangTable const & spellignore() const;
 	bool spellignored(WordLangTuple const & wl) const;
 	/**
 	 * The LyX name of the input encoding for LaTeX. This can be one of
diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp
index 1cac9ad..01ec194 100644
--- a/src/HunspellChecker.cpp
+++ b/src/HunspellChecker.cpp
@@ -41,8 +41,6 @@ namespace {
 typedef map<std::string, Hunspell *> Spellers;
 typedef map<std::string, PersonalWordList *> LangPersonalWordList;
 
-typedef vector<WordLangTuple> IgnoreList;
-
 docstring remap_result(docstring const & s)
 {
 	// substitute RIGHT SINGLE QUOTATION MARK
@@ -78,7 +76,7 @@ struct HunspellChecker::Private
 	/// the spellers
 	Spellers spellers_;
 	///
-	IgnoreList ignored_;
+	WordLangTable ignored_;
 	///
 	LangPersonalWordList personal_;
 	///
@@ -283,7 +281,7 @@ int HunspellChecker::Private::numDictionaries() const
 
 bool HunspellChecker::Private::isIgnored(WordLangTuple const & wl) const
 {
-	IgnoreList::const_iterator it = ignored_.begin();
+	WordLangTable::const_iterator it = ignored_.begin();
 	for (; it != ignored_.end(); ++it) {
 		if (it->lang()->code() != wl.lang()->code())
 			continue;
@@ -350,7 +348,7 @@ SpellChecker::Result HunspellChecker::check(WordLangTuple const & wl,
 	if (d->isIgnored(wl))
 		return WORD_OK;
 
-	IgnoreList::const_iterator it = docdict.begin();
+	WordLangTable::const_iterator it = docdict.begin();
 	for (; it != docdict.end(); ++it) {
 		if (it->lang()->code() != wl.lang()->code())
 			continue;
diff --git a/src/WordLangTuple.h b/src/WordLangTuple.h
index baf9338..6459c46 100644
--- a/src/WordLangTuple.h
+++ b/src/WordLangTuple.h
@@ -16,6 +16,8 @@
 
 #include "support/docstring.h"
 
+#include <vector>
+
 
 namespace lyx {
 
@@ -51,6 +53,9 @@ private:
 };
 
 
+typedef std::vector<WordLangTuple> WordLangTable;
+
+
 } // namespace lyx
 
 #endif // WORD_LANG_TUPLE_H


More information about the lyx-cvs mailing list