From 75285192a31aee44cfd1e2c27c2652f65a5a894b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 17 Nov 2010 05:44:02 +0000 Subject: [PATCH] Add overloaded operator-> to agi::line_iterator Originally committed to SVN as r4846. --- aegisub/libaegisub/include/libaegisub/line_iterator.h | 5 ++++- aegisub/src/spellchecker_hunspell.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index 9f67b9810..2d00ec453 100644 --- a/aegisub/libaegisub/include/libaegisub/line_iterator.h +++ b/aegisub/libaegisub/include/libaegisub/line_iterator.h @@ -108,9 +108,12 @@ public: , width(that.width) { } - OutputType operator*() const { + OutputType const& operator*() const { return value; } + OutputType const* operator->() const { + return &value; + } line_iterator& operator++() { next(); return *this; diff --git a/aegisub/src/spellchecker_hunspell.cpp b/aegisub/src/spellchecker_hunspell.cpp index 7d60455da..d507fd826 100644 --- a/aegisub/src/spellchecker_hunspell.cpp +++ b/aegisub/src/spellchecker_hunspell.cpp @@ -234,7 +234,7 @@ void HunspellSpellChecker::SetLanguage(wxString language) { agi::line_iterator end; ++userDic; // skip entry count line for (; userDic != end; ++userDic) { - if ((*userDic).empty()) continue; + if (userDic->empty()) continue; try { #ifdef WITH_OLD_HUNSPELL hunspell->put_word(conv->Convert(*userDic).c_str());