From 3d04db9e90b84dc8746a7c310ce41ef5eb9f9474 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 3 Jun 2010 20:54:46 +0000 Subject: [PATCH] Fix build error when wx was not built with wxUSE_STL Originally committed to SVN as r4424. --- .../libaegisub_vs2008/libaegisub_vs2008.vcproj | 4 ++++ aegisub/src/spellchecker_hunspell.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj b/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj index c31455340..20561ba4f 100644 --- a/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj +++ b/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj @@ -198,6 +198,10 @@ RelativePath="..\..\libaegisub\common\charset_ucd.cpp" > + + diff --git a/aegisub/src/spellchecker_hunspell.cpp b/aegisub/src/spellchecker_hunspell.cpp index 91cedc1a9..a9f22dba9 100644 --- a/aegisub/src/spellchecker_hunspell.cpp +++ b/aegisub/src/spellchecker_hunspell.cpp @@ -102,7 +102,7 @@ void HunspellSpellChecker::Reset() { bool HunspellSpellChecker::CanAddWord(wxString word) { if (!hunspell) return false; try { - conv->Convert(word); + conv->Convert(STD_STR(word)); return true; } catch (agi::charset::ConvError const&) { @@ -121,9 +121,9 @@ void HunspellSpellChecker::AddWord(wxString word) { // Add to currently loaded file #ifdef WITH_OLD_HUNSPELL - hunspell->put_word(conv->Convert(word).c_str()); + hunspell->put_word(conv->Convert(STD_STR(word)).c_str()); #else - hunspell->add(conv->Convert(word).c_str()); + hunspell->add(conv->Convert(STD_STR(word)).c_str()); #endif // Ensure that the path exists @@ -181,7 +181,7 @@ void HunspellSpellChecker::AddWord(wxString word) { bool HunspellSpellChecker::CheckWord(wxString word) { if (!hunspell) return true; try { - return hunspell->spell(conv->Convert(word).c_str()) == 1; + return hunspell->spell(conv->Convert(STD_STR(word)).c_str()) == 1; } catch (agi::charset::ConvError const&) { return false; @@ -201,7 +201,7 @@ wxArrayString HunspellSpellChecker::GetSuggestions(wxString word) { try { // Grab raw from Hunspell char **results; - int n = hunspell->suggest(&results,conv->Convert(word).c_str()); + int n = hunspell->suggest(&results,conv->Convert(STD_STR(word)).c_str()); // Convert each for (int i=0;iput_word(conv->Convert(curLine).c_str()); + hunspell->put_word(conv->Convert(STD_STR(curLine)).c_str()); #else - hunspell->add(conv->Convert(curLine).c_str()); + hunspell->add(conv->Convert(STD_STR(curLine)).c_str()); #endif } }