Some fixes for SVN wx compatibility (that doesn't work, anyway)

Originally committed to SVN as r1472.
This commit is contained in:
Rodrigo Braz Monteiro 2007-08-07 20:45:41 +00:00
parent acc6e13022
commit 2c60df7b53
5 changed files with 41 additions and 3 deletions

View file

@ -54,7 +54,32 @@
#pragma comment(lib, "wxpng.lib")
#endif
#if wxCHECK_VERSION(2, 8, 0)
#if wxCHECK_VERSION(2, 9, 0)
#ifdef __WXDEBUG__
#pragma comment(lib, "wxregexud.lib")
#pragma comment(lib, "wxbase29ud.lib")
#pragma comment(lib, "wxbase29ud_net.lib")
#pragma comment(lib, "wxmsw29ud_media.lib")
#pragma comment(lib, "wxmsw29ud_core.lib")
#pragma comment(lib, "wxmsw29ud_adv.lib")
#pragma comment(lib, "wxmsw29ud_gl.lib")
#pragma comment(lib, "wxmsw29ud_stc.lib")
#pragma comment(lib, "wxbase29ud_xml.lib")
#pragma comment(lib, "wxexpatd.lib")
#else
#pragma comment(lib, "wxregexu.lib")
#pragma comment(lib, "wxbase29u.lib")
#pragma comment(lib, "wxbase29u_net.lib")
#pragma comment(lib, "wxmsw29u_media.lib")
#pragma comment(lib, "wxmsw29u_core.lib")
#pragma comment(lib, "wxmsw29u_adv.lib")
#pragma comment(lib, "wxmsw29u_gl.lib")
#pragma comment(lib, "wxmsw29u_stc.lib")
#pragma comment(lib, "wxbase29u_xml.lib")
#pragma comment(lib, "wxexpat.lib")
#endif
#elif wxCHECK_VERSION(2, 8, 0)
#ifdef __WXDEBUG__
#pragma comment(lib, "wxregexud.lib")
#pragma comment(lib, "wxbase28ud.lib")

View file

@ -127,7 +127,8 @@ void HunspellSpellChecker::Reset() {
// Can add to dictionary?
bool HunspellSpellChecker::CanAddWord(wxString word) {
if (!hunspell) return false;
return (word.mb_str(*conv) != NULL);
wxCharBuffer buffer = word.mb_str(*conv);
return (buffer.data() != NULL);
}

View file

@ -680,7 +680,7 @@ void SubtitlesGrid::OnAudioClip(wxCommandEvent &event) {
end=(end>num_samples)?num_samples:end;
wxString filename = wxFileSelector(_("Save audio clip"),0,0,_T("wav"),0,wxFD_SAVE|wxFD_OVERWRITE_PROMPT,this);
wxString filename = wxFileSelector(_("Save audio clip"),_T(""),_T(""),_T("wav"),_T(""),wxFD_SAVE|wxFD_OVERWRITE_PROMPT,this);
if (!filename.empty()) {
std::ofstream outfile(filename.mb_str(wxConvLocal),std::ios::binary);

View file

@ -111,7 +111,11 @@ wxString TextFileReader::GetEncoding(const wxString _filename) {
CloseHandle(ifile);
#else
ifstream ifile;
#ifdef WIN32
ifile.open(_filename.wc_str());
#else
ifile.open(wxFNCONV(_filename));
#endif
if (!ifile.is_open()) {
return _T("unknown");
}
@ -288,8 +292,12 @@ void TextFileReader::Open() {
if (file == 0) {
throw _T("Failed opening file for reading.");
}
#else
#ifdef WIN32
file.open(filename.wc_str(),std::ios::in | std::ios::binary);
#else
file.open(wxFNCONV(filename),std::ios::in | std::ios::binary);
#endif
if (!file.is_open()) {
throw _T("Failed opening file for reading.");
}

View file

@ -78,7 +78,11 @@ TextFileWriter::~TextFileWriter() {
void TextFileWriter::Open() {
// Open file
if (open) return;
#ifdef WIN32
file.open(filename.wc_str(),std::ios::out | std::ios::binary | std::ios::trunc);
#else
file.open(wxFNCONV(filename),std::ios::out | std::ios::binary | std::ios::trunc);
#endif
if (!file.is_open()) {
throw _T("Failed opening file for writing.");
}