Fix build error when wx was not built with wxUSE_STL

Originally committed to SVN as r4424.
This commit is contained in:
Thomas Goyne 2010-06-03 20:54:46 +00:00
parent b6d29443a3
commit 3d04db9e90
2 changed files with 11 additions and 7 deletions

View file

@ -198,6 +198,10 @@
RelativePath="..\..\libaegisub\common\charset_ucd.cpp" RelativePath="..\..\libaegisub\common\charset_ucd.cpp"
> >
</File> </File>
<File
RelativePath="..\..\libaegisub\common\log.cpp"
>
</File>
<File <File
RelativePath="..\..\libaegisub\common\mru.cpp" RelativePath="..\..\libaegisub\common\mru.cpp"
> >

View file

@ -102,7 +102,7 @@ void HunspellSpellChecker::Reset() {
bool HunspellSpellChecker::CanAddWord(wxString word) { bool HunspellSpellChecker::CanAddWord(wxString word) {
if (!hunspell) return false; if (!hunspell) return false;
try { try {
conv->Convert(word); conv->Convert(STD_STR(word));
return true; return true;
} }
catch (agi::charset::ConvError const&) { catch (agi::charset::ConvError const&) {
@ -121,9 +121,9 @@ void HunspellSpellChecker::AddWord(wxString word) {
// Add to currently loaded file // Add to currently loaded file
#ifdef WITH_OLD_HUNSPELL #ifdef WITH_OLD_HUNSPELL
hunspell->put_word(conv->Convert(word).c_str()); hunspell->put_word(conv->Convert(STD_STR(word)).c_str());
#else #else
hunspell->add(conv->Convert(word).c_str()); hunspell->add(conv->Convert(STD_STR(word)).c_str());
#endif #endif
// Ensure that the path exists // Ensure that the path exists
@ -181,7 +181,7 @@ void HunspellSpellChecker::AddWord(wxString word) {
bool HunspellSpellChecker::CheckWord(wxString word) { bool HunspellSpellChecker::CheckWord(wxString word) {
if (!hunspell) return true; if (!hunspell) return true;
try { 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&) { catch (agi::charset::ConvError const&) {
return false; return false;
@ -201,7 +201,7 @@ wxArrayString HunspellSpellChecker::GetSuggestions(wxString word) {
try { try {
// Grab raw from Hunspell // Grab raw from Hunspell
char **results; 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 // Convert each
for (int i=0;i<n;i++) { for (int i=0;i<n;i++) {
@ -290,9 +290,9 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
wxString curLine = reader.ReadLineFromFile(); wxString curLine = reader.ReadLineFromFile();
if (curLine.IsEmpty() || curLine.IsNumber()) continue; if (curLine.IsEmpty() || curLine.IsNumber()) continue;
#ifdef WITH_OLD_HUNSPELL #ifdef WITH_OLD_HUNSPELL
hunspell->put_word(conv->Convert(curLine).c_str()); hunspell->put_word(conv->Convert(STD_STR(curLine)).c_str());
#else #else
hunspell->add(conv->Convert(curLine).c_str()); hunspell->add(conv->Convert(STD_STR(curLine)).c_str());
#endif #endif
} }
} }