summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Voicu <vladv@rosedu.org>2012-03-08 13:10:15 (GMT)
committervlad <vlad@tyrion.(none)>2012-10-13 13:55:45 (GMT)
commitafdb2b3a61695b42162d09189d083e728da0c74f (patch)
tree5b99b51d9888bd8bd0d74f677751689acb6111a7 /SwifTools
parent9a4873e153ae16ef68e7c60de376ade7882874f0 (diff)
downloadswift-contrib-afdb2b3a61695b42162d09189d083e728da0c74f.zip
swift-contrib-afdb2b3a61695b42162d09189d083e728da0c74f.tar.bz2
Gracefully degrade when hunspell is not present
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/HunspellChecker.cpp3
-rw-r--r--SwifTools/SpellCheckerFactory.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/SwifTools/HunspellChecker.cpp b/SwifTools/HunspellChecker.cpp
index 6c1b4bb..fa5917a 100644
--- a/SwifTools/HunspellChecker.cpp
+++ b/SwifTools/HunspellChecker.cpp
@@ -43,7 +43,8 @@ void HunspellChecker::checkFragment(const std::string& fragment, PositionPairLis
for (PositionPairList::iterator it = misspelledPositions.begin(); it != misspelledPositions.end();) {
if (isCorrect(fragment.substr(boost::get<0>(*it), boost::get<1>(*it) - boost::get<0>(*it)))) {
misspelledPositions.erase(it++);
- } else {
+ }
+ else {
++it;
}
}
diff --git a/SwifTools/SpellCheckerFactory.h b/SwifTools/SpellCheckerFactory.h
index d58a9ec..5519db5 100644
--- a/SwifTools/SpellCheckerFactory.h
+++ b/SwifTools/SpellCheckerFactory.h
@@ -6,6 +6,10 @@
#pragma once
+#ifdef HAVE_HUNSPELL
+#define HAVE_SPELLCHECKER
+#endif
+
namespace Swift {
class SpellChecker;
class SpellCheckerFactory {