From: Vadim Zeitlin Date: Sun, 7 Nov 2010 14:00:43 +0000 (+0000) Subject: Make wxXmlResource::ReportError() wxXmlNode parameter const. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1f6ea93556fb59e6d8f50af1f36ddb16b5a0dc33 Make wxXmlResource::ReportError() wxXmlNode parameter const. This function (and the related DoReportError()) doesn't need to modify its "context" argument so take a const-pointer in it. See #11431. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index aba488cd0f..a585bfaa56 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -293,10 +293,10 @@ public: protected: // reports input error at position 'context' - void ReportError(wxXmlNode *context, const wxString& message); + void ReportError(const wxXmlNode *context, const wxString& message); // override this in derived class to customize errors reporting - virtual void DoReportError(const wxString& xrcFile, wxXmlNode *position, + virtual void DoReportError(const wxString& xrcFile, const wxXmlNode *position, const wxString& message); // Scans the resources list for unloaded files and loads them. Also reloads diff --git a/interface/wx/xrc/xmlres.h b/interface/wx/xrc/xmlres.h index 31672627ac..269aa39ec8 100644 --- a/interface/wx/xrc/xmlres.h +++ b/interface/wx/xrc/xmlres.h @@ -388,7 +388,7 @@ protected: @see wxXmlResourceHandler::ReportError(), DoReportError() */ - void ReportError(wxXmlNode *context, const wxString& message); + void ReportError(const wxXmlNode *context, const wxString& message); /** Implementation of XRC resources errors reporting. @@ -416,7 +416,7 @@ protected: @see ReportError() */ - virtual void DoReportError(const wxString& xrcFile, wxXmlNode *position, + virtual void DoReportError(const wxString& xrcFile, const wxXmlNode *position, const wxString& message); }; diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 4aeeb37a11..cc3649c9c3 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -90,7 +90,7 @@ const char *ATTR_INPUT_FILENAME = "__wx:filename"; // helper to get filename corresponding to an XML node wxString -GetFileNameFromNode(wxXmlNode *node, const wxXmlResourceDataRecords& files) +GetFileNameFromNode(const wxXmlNode *node, const wxXmlResourceDataRecords& files) { // this loop does two things: it looks for ATTR_INPUT_FILENAME among // parents and if it isn't used, it finds the root of the XML tree 'node' @@ -1944,7 +1944,7 @@ void wxXmlResourceHandler::ReportParamError(const wxString& param, m_resource->ReportError(GetParamNode(param), message); } -void wxXmlResource::ReportError(wxXmlNode *context, const wxString& message) +void wxXmlResource::ReportError(const wxXmlNode *context, const wxString& message) { if ( !context ) { @@ -1960,7 +1960,7 @@ void wxXmlResource::ReportError(wxXmlNode *context, const wxString& message) DoReportError(filename, context, message); } -void wxXmlResource::DoReportError(const wxString& xrcFile, wxXmlNode *position, +void wxXmlResource::DoReportError(const wxString& xrcFile, const wxXmlNode *position, const wxString& message) { const int line = position ? position->GetLineNumber() : -1;