Fixed compiling errors for wxWidgets 2.8

This commit is contained in:
Zane U. Ji 2013-12-17 19:21:13 +08:00
parent d58cbef4d7
commit bdd030850e
4 changed files with 11 additions and 10 deletions

View File

@ -449,7 +449,7 @@ bool WrapLibxml::xslt (
CONV ( styleFileName ) ); CONV ( styleFileName ) );
if ( !cur ) if ( !cur )
{ {
nonParserError = "Cannot parse stylesheet"; nonParserError = _("Cannot parse stylesheet");
return false; return false;
} }
@ -470,7 +470,7 @@ bool WrapLibxml::xslt (
doc = xmlCtxtReadFile ( ctxt, CONV ( docUrl ), NULL, flags ); doc = xmlCtxtReadFile ( ctxt, CONV ( docUrl ), NULL, flags );
if ( !doc ) if ( !doc )
{ {
nonParserError = "Cannot parse file"; nonParserError = _("Cannot parse file");
break; break;
} }
@ -481,7 +481,7 @@ bool WrapLibxml::xslt (
res = xsltApplyStylesheet ( cur, doc, NULL ); res = xsltApplyStylesheet ( cur, doc, NULL );
if ( !res ) if ( !res )
{ {
nonParserError = "Cannot apply stylesheet"; nonParserError = _("Cannot apply stylesheet");
break; break;
} }
@ -565,7 +565,7 @@ int WrapLibxml::saveEncoding (
docPtr = xmlCtxtReadMemory ( ctxt, utf8Buffer, utf8BufferSize, docPtr = xmlCtxtReadMemory ( ctxt, utf8Buffer, utf8BufferSize,
CONV ( fileNameSource ), "UTF-8", flags ); CONV ( fileNameSource ), "UTF-8", flags );
else else
docPtr = xmlCtxtReadFile ( ctxt, fileNameSource.c_str(), NULL, flags ); docPtr = xmlCtxtReadFile ( ctxt, CONV ( fileNameSource ), NULL, flags );
if ( !docPtr ) if ( !docPtr )
{ {
xmlFreeParserCtxt ( ctxt ); xmlFreeParserCtxt ( ctxt );

View File

@ -206,7 +206,7 @@ wxMemoryBuffer WrapXerces::toString ( const wxString &str )
return buffer; return buffer;
} }
void MySAX2Handler::logError ( const wxString &type, wxLogLevelValues level, void MySAX2Handler::logError ( const wxString &type, wxLogLevel level,
const SAXParseException& e ) const SAXParseException& e )
{ {
mErrors << wxString::Format ( mErrors << wxString::Format (

View File

@ -43,7 +43,7 @@ class MySAX2Handler : public DefaultHandler
public: public:
MySAX2Handler() MySAX2Handler()
{ {
mEOL = "\n"; mEOL = _T("\n");
resetErrors(); resetErrors();
} }
void error ( const SAXParseException& e ) void error ( const SAXParseException& e )
@ -77,7 +77,7 @@ class MySAX2Handler : public DefaultHandler
{ {
return mErrorPosition; return mErrorPosition;
} }
void logError ( const wxString &type, wxLogLevelValues level, void logError ( const wxString &type, wxLogLevel level,
const SAXParseException& e ); const SAXParseException& e );
void setEOL ( const wxChar *eol ) void setEOL ( const wxChar *eol )
{ {
@ -86,7 +86,7 @@ class MySAX2Handler : public DefaultHandler
protected: protected:
wxString mErrors; wxString mErrors;
std::pair<int, int> mErrorPosition; std::pair<int, int> mErrorPosition;
wxLogLevelValues mLevel; wxLogLevel mLevel;
wxString mEOL; wxString mEOL;
}; };

View File

@ -3926,7 +3926,7 @@ void MyFrame::OnValidateSchema ( wxCommandEvent& event )
doc->clearErrorIndicators(); doc->clearErrorIndicators();
wxString fileName = doc->getFullFileName(); wxString fileName = doc->getFullFileName();
wxString utf8Buffer = doc->myGetTextRaw(); std::string utf8Buffer = doc->myGetTextRaw();
std::auto_ptr<WrapXerces> validator ( new WrapXerces() ); std::auto_ptr<WrapXerces> validator ( new WrapXerces() );
if ( !validator->validateMemory ( utf8Buffer.c_str(), utf8Buffer.size(), if ( !validator->validateMemory ( utf8Buffer.c_str(), utf8Buffer.size(),
fileName ) ) fileName ) )
@ -4763,7 +4763,8 @@ bool MyFrame::saveFile ( XmlDoc *doc, wxString& fileName, bool checkLastModified
{ {
auto_ptr<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) ); auto_ptr<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess ) );
int result = wl->saveEncoding ( utf8Buffer, int result = wl->saveEncoding ( utf8Buffer,
doc->getFullFileName(), fileName, NULL, encoding ); doc->getFullFileName(), fileName, NULL,
wxString ( encoding.c_str(), wxConvUTF8 ) );
if ( result == -1 ) if ( result == -1 )
{ {
success = saveRawUtf8 ( fileNameLocal, utf8Buffer, false, isXml ); success = saveRawUtf8 ( fileNameLocal, utf8Buffer, false, isXml );